From 464542217609b12f296e84ce77d0c97cd1e6956e Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Thu, 28 Mar 2019 22:13:59 +0300 Subject: [PATCH] Fixed TSan report in StorageSystemTables --- dbms/src/Storages/System/StorageSystemTables.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dbms/src/Storages/System/StorageSystemTables.cpp b/dbms/src/Storages/System/StorageSystemTables.cpp index 3413e8609f4..45691072461 100644 --- a/dbms/src/Storages/System/StorageSystemTables.cpp +++ b/dbms/src/Storages/System/StorageSystemTables.cpp @@ -174,9 +174,8 @@ protected: for (; rows_count < max_block_size && tables_it->isValid(); tables_it->next()) { auto table_name = tables_it->name(); - const auto table = context.tryGetTable(database_name, table_name); - if (!table) - continue; + const StoragePtr & table = tables_it->table(); + auto lock = table->lockStructureForShare(false, context.getCurrentQueryId()); ++rows_count; @@ -190,13 +189,13 @@ protected: res_columns[res_index++]->insert(table_name); if (columns_mask[src_index++]) - res_columns[res_index++]->insert(tables_it->table()->getName()); + res_columns[res_index++]->insert(table->getName()); if (columns_mask[src_index++]) res_columns[res_index++]->insert(0u); // is_temporary if (columns_mask[src_index++]) - res_columns[res_index++]->insert(tables_it->table()->getDataPath()); + res_columns[res_index++]->insert(table->getDataPath()); if (columns_mask[src_index++]) res_columns[res_index++]->insert(database->getTableMetadataPath(table_name));