Skip to content

Commit

Permalink
fixed (ClickHouse#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgbo-ustc committed Dec 26, 2022
1 parent 11ecd0e commit 5ab0b59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/local-engine/Storages/StorageMergeTreeFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ CustomStorageMergeTreePtr
StorageMergeTreeFactory::getStorage(StorageID id, ColumnsDescription columns, std::function<CustomStorageMergeTreePtr()> creator)
{
auto table_name = id.database_name + "." + id.table_name;
std::lock_guard lock(storage_map_mutex);
if (!storage_map.contains(table_name))
{
std::lock_guard lock(storage_map_mutex);
if (storage_map.contains(table_name))
{
std::set<std::string> existed_columns = storage_columns_map.at(table_name);
Expand Down Expand Up @@ -45,9 +45,9 @@ StorageInMemoryMetadataPtr StorageMergeTreeFactory::getMetadata(StorageID id, st
{
auto table_name = id.database_name + "." + id.table_name;

std::lock_guard lock(metadata_map_mutex);
if (!metadata_map.contains(table_name))
{
std::lock_guard lock(metadata_map_mutex);
if (!metadata_map.contains(table_name))
{
metadata_map.emplace(table_name, creator());
Expand Down

0 comments on commit 5ab0b59

Please sign in to comment.