mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-24 10:40:49 +00:00
fix
This commit is contained in:
parent
2d4030f98b
commit
eaea0a3e40
@ -73,7 +73,7 @@ void PostgreSQLSource<T>::init(const Block & sample_block)
|
||||
template<typename T>
|
||||
void PostgreSQLSource<T>::onStart()
|
||||
{
|
||||
if (connection_holder)
|
||||
if (!tx)
|
||||
tx = std::make_shared<T>(connection_holder->get());
|
||||
|
||||
stream = std::make_unique<pqxx::stream_from>(*tx, pqxx::from_query, std::string_view(query_str));
|
||||
|
@ -76,19 +76,6 @@ public:
|
||||
const Block & sample_block_,
|
||||
const UInt64 max_block_size_)
|
||||
: PostgreSQLSource<T>(tx_, query_str_, sample_block_, max_block_size_, false) {}
|
||||
|
||||
Chunk generate() override
|
||||
{
|
||||
if (!is_initialized)
|
||||
{
|
||||
Base::stream = std::make_unique<pqxx::stream_from>(*Base::tx, pqxx::from_query, std::string_view(Base::query_str));
|
||||
is_initialized = true;
|
||||
}
|
||||
|
||||
return Base::generate();
|
||||
}
|
||||
|
||||
bool is_initialized = false;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user