mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
Merge pull request #29201 from ClickHouse/follow_up_to_28373
Follow up to #28373
This commit is contained in:
commit
5f4c665c76
@ -106,9 +106,11 @@ std::string ExternalDictionariesLoader::resolveDictionaryNameFromDatabaseCatalog
|
|||||||
/// Try to split name and get id from associated StorageDictionary.
|
/// Try to split name and get id from associated StorageDictionary.
|
||||||
/// If something went wrong, return name as is.
|
/// If something went wrong, return name as is.
|
||||||
|
|
||||||
|
String res = name;
|
||||||
|
|
||||||
auto qualified_name = QualifiedTableName::tryParseFromString(name);
|
auto qualified_name = QualifiedTableName::tryParseFromString(name);
|
||||||
if (!qualified_name)
|
if (!qualified_name)
|
||||||
return name;
|
return res;
|
||||||
|
|
||||||
if (qualified_name->database.empty())
|
if (qualified_name->database.empty())
|
||||||
{
|
{
|
||||||
@ -116,9 +118,10 @@ std::string ExternalDictionariesLoader::resolveDictionaryNameFromDatabaseCatalog
|
|||||||
/// or it's an XML dictionary.
|
/// or it's an XML dictionary.
|
||||||
bool is_xml_dictionary = has(name);
|
bool is_xml_dictionary = has(name);
|
||||||
if (is_xml_dictionary)
|
if (is_xml_dictionary)
|
||||||
return name;
|
return res;
|
||||||
else
|
|
||||||
qualified_name->database = current_database_name;
|
qualified_name->database = current_database_name;
|
||||||
|
res = current_database_name + '.' + name;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto [db, table] = DatabaseCatalog::instance().tryGetDatabaseAndTable(
|
auto [db, table] = DatabaseCatalog::instance().tryGetDatabaseAndTable(
|
||||||
@ -126,13 +129,13 @@ std::string ExternalDictionariesLoader::resolveDictionaryNameFromDatabaseCatalog
|
|||||||
const_pointer_cast<Context>(getContext()));
|
const_pointer_cast<Context>(getContext()));
|
||||||
|
|
||||||
if (!db)
|
if (!db)
|
||||||
return name;
|
return res;
|
||||||
assert(table);
|
assert(table);
|
||||||
|
|
||||||
if (db->getUUID() == UUIDHelpers::Nil)
|
if (db->getUUID() == UUIDHelpers::Nil)
|
||||||
return name;
|
return res;
|
||||||
if (table->getName() != "Dictionary")
|
if (table->getName() != "Dictionary")
|
||||||
return name;
|
return res;
|
||||||
|
|
||||||
return toString(table->getStorageID().uuid);
|
return toString(table->getStorageID().uuid);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user