Merge pull request #34416 from kssenii/fixing-postgresql-replica-test-1

Fix test test_postgresql_replica_database_engine_2/test.py::test_table_schema_changes_2
This commit is contained in:
tavplubix 2022-02-08 22:38:38 +03:00 committed by GitHub
commit 15bcbb97e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -277,10 +277,16 @@ Pipe StorageMaterializedPostgreSQL::read(
size_t max_block_size,
unsigned num_streams)
{
auto materialized_table_lock = lockForShare(String(), context_->getSettingsRef().lock_acquire_timeout);
auto nested_table = getNested();
return readFinalFromNestedStorage(nested_table, column_names, metadata_snapshot,
auto pipe = readFinalFromNestedStorage(nested_table, column_names, metadata_snapshot,
query_info, context_, processed_stage, max_block_size, num_streams);
auto lock = lockForShare(context_->getCurrentQueryId(), context_->getSettingsRef().lock_acquire_timeout);
pipe.addTableLock(lock);
pipe.addStorageHolder(shared_from_this());
return pipe;
}

View File

@ -57,6 +57,7 @@ Pipe readFinalFromNestedStorage(
Pipe pipe = nested_storage->read(require_columns_name, nested_metadata, query_info, context, processed_stage, max_block_size, num_streams);
pipe.addTableLock(lock);
pipe.addStorageHolder(nested_storage);
if (!expressions->children.empty() && !pipe.empty())
{