This commit is contained in:
kssenii 2021-08-13 20:57:40 +00:00
parent 37554014aa
commit 3012fad56d
5 changed files with 3 additions and 9 deletions

View File

@ -164,7 +164,7 @@ StoragePtr DatabasePostgreSQL::tryGetTable(const String & table_name, ContextPtr
} }
StoragePtr DatabasePostgreSQL::fetchTable(const String & table_name, ContextPtr local_context, const bool table_checked) const StoragePtr DatabasePostgreSQL::fetchTable(const String & table_name, ContextPtr, const bool table_checked) const
{ {
if (!cache_tables || !cached_tables.count(table_name)) if (!cache_tables || !cached_tables.count(table_name))
{ {
@ -179,7 +179,7 @@ StoragePtr DatabasePostgreSQL::fetchTable(const String & table_name, ContextPtr
auto storage = StoragePostgreSQL::create( auto storage = StoragePostgreSQL::create(
StorageID(database_name, table_name), pool, table_name, StorageID(database_name, table_name), pool, table_name,
ColumnsDescription{*columns}, ConstraintsDescription{}, String{}, local_context, postgres_schema); ColumnsDescription{*columns}, ConstraintsDescription{}, String{}, postgres_schema);
if (cache_tables) if (cache_tables)
cached_tables[table_name] = storage; cached_tables[table_name] = storage;

View File

@ -98,7 +98,7 @@ StorageExternalDistributed::StorageExternalDistributed(
context->getSettingsRef().postgresql_connection_pool_size, context->getSettingsRef().postgresql_connection_pool_size,
context->getSettingsRef().postgresql_connection_pool_wait_timeout); context->getSettingsRef().postgresql_connection_pool_wait_timeout);
shard = StoragePostgreSQL::create(table_id_, std::move(pool), remote_table, columns_, constraints_, String{}, context); shard = StoragePostgreSQL::create(table_id_, std::move(pool), remote_table, columns_, constraints_, String{});
break; break;
} }
#endif #endif

View File

@ -47,12 +47,10 @@ StoragePostgreSQL::StoragePostgreSQL(
const ColumnsDescription & columns_, const ColumnsDescription & columns_,
const ConstraintsDescription & constraints_, const ConstraintsDescription & constraints_,
const String & comment, const String & comment,
ContextPtr context_,
const String & remote_table_schema_) const String & remote_table_schema_)
: IStorage(table_id_) : IStorage(table_id_)
, remote_table_name(remote_table_name_) , remote_table_name(remote_table_name_)
, remote_table_schema(remote_table_schema_) , remote_table_schema(remote_table_schema_)
, global_context(context_)
, pool(std::move(pool_)) , pool(std::move(pool_))
{ {
StorageInMemoryMetadata storage_metadata; StorageInMemoryMetadata storage_metadata;
@ -347,7 +345,6 @@ void registerStoragePostgreSQL(StorageFactory & factory)
args.columns, args.columns,
args.constraints, args.constraints,
args.comment, args.comment,
args.getContext(),
remote_table_schema); remote_table_schema);
}, },
{ {

View File

@ -27,7 +27,6 @@ public:
const ColumnsDescription & columns_, const ColumnsDescription & columns_,
const ConstraintsDescription & constraints_, const ConstraintsDescription & constraints_,
const String & comment, const String & comment,
ContextPtr context_,
const std::string & remote_table_schema_ = ""); const std::string & remote_table_schema_ = "");
String getName() const override { return "PostgreSQL"; } String getName() const override { return "PostgreSQL"; }
@ -48,7 +47,6 @@ private:
String remote_table_name; String remote_table_name;
String remote_table_schema; String remote_table_schema;
ContextPtr global_context;
postgres::PoolWithFailoverPtr pool; postgres::PoolWithFailoverPtr pool;
}; };

View File

@ -37,7 +37,6 @@ StoragePtr TableFunctionPostgreSQL::executeImpl(const ASTPtr & /*ast_function*/,
columns, columns,
ConstraintsDescription{}, ConstraintsDescription{},
String{}, String{},
context,
remote_table_schema); remote_table_schema);
result->startup(); result->startup();