mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 17:02:25 +00:00
fix
This commit is contained in:
parent
18dd0c8f8c
commit
3c5d6cf6f1
@ -770,7 +770,7 @@ bool Context::isDictionaryExists(const String & database_name, const String & di
|
||||
{
|
||||
auto lock = getLock();
|
||||
String db = resolveDatabase(database_name);
|
||||
auto db_ptr = DatabaseCatalog::instance().tryGetDatabase(database_name);
|
||||
auto db_ptr = DatabaseCatalog::instance().tryGetDatabase(db);
|
||||
return db_ptr && db_ptr->isDictionaryExist(*this, dictionary_name);
|
||||
}
|
||||
|
||||
|
@ -83,17 +83,20 @@ StoragePtr DatabaseCatalog::getTable(const StorageID & table_id, const Context &
|
||||
// return db_and_table.second;
|
||||
//}
|
||||
|
||||
std::lock_guard _lock{databases_mutex};
|
||||
|
||||
auto it = databases.find(table_id.getDatabaseName());
|
||||
if (databases.end() == it)
|
||||
DatabasePtr database;
|
||||
{
|
||||
if (exception)
|
||||
exception->emplace("Database " + backQuoteIfNeed(table_id.getDatabaseName()) + " doesn't exist", ErrorCodes::UNKNOWN_DATABASE);
|
||||
return {};
|
||||
std::lock_guard _lock{databases_mutex};
|
||||
auto it = databases.find(table_id.getDatabaseName());
|
||||
if (databases.end() == it)
|
||||
{
|
||||
if (exception)
|
||||
exception->emplace("Database " + backQuoteIfNeed(table_id.getDatabaseName()) + " doesn't exist",
|
||||
ErrorCodes::UNKNOWN_DATABASE);
|
||||
return {};
|
||||
}
|
||||
database = it->second;
|
||||
}
|
||||
|
||||
auto database = it->second;
|
||||
auto table = database->tryGetTable(local_context, table_id.table_name);
|
||||
if (!table && exception)
|
||||
exception->emplace("Table " + table_id.getNameForLogs() + " doesn't exist.", ErrorCodes::UNKNOWN_TABLE);
|
||||
|
@ -113,7 +113,7 @@ private:
|
||||
|
||||
private:
|
||||
//[[maybe_unused]] Context & global_context;
|
||||
mutable std::mutex databases_mutex;
|
||||
mutable std::recursive_mutex databases_mutex;
|
||||
//const String default_database;
|
||||
Databases databases;
|
||||
UUIDToStorageMap uuid_map;
|
||||
|
Loading…
Reference in New Issue
Block a user