mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-19 16:20:50 +00:00
Merge pull request #66240 from azat/ATTACH-ignore-async_load_databases
Ignore async_load_databases for ATTACH query
This commit is contained in:
commit
a38c2e558b
@ -361,18 +361,10 @@ BlockIO InterpreterCreateQuery::createDatabase(ASTCreateQuery & create)
|
||||
TablesLoader loader{getContext()->getGlobalContext(), {{database_name, database}}, mode};
|
||||
auto load_tasks = loader.loadTablesAsync();
|
||||
auto startup_tasks = loader.startupTablesAsync();
|
||||
if (getContext()->getGlobalContext()->getServerSettings().async_load_databases)
|
||||
{
|
||||
scheduleLoad(load_tasks);
|
||||
scheduleLoad(startup_tasks);
|
||||
}
|
||||
else
|
||||
{
|
||||
/// First prioritize, schedule and wait all the load table tasks
|
||||
waitLoad(currentPoolOr(TablesLoaderForegroundPoolId), load_tasks);
|
||||
/// Only then prioritize, schedule and wait all the startup tasks
|
||||
waitLoad(currentPoolOr(TablesLoaderForegroundPoolId), startup_tasks);
|
||||
}
|
||||
/// First prioritize, schedule and wait all the load table tasks
|
||||
waitLoad(currentPoolOr(TablesLoaderForegroundPoolId), load_tasks);
|
||||
/// Only then prioritize, schedule and wait all the startup tasks
|
||||
waitLoad(currentPoolOr(TablesLoaderForegroundPoolId), startup_tasks);
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
|
@ -1,4 +1,4 @@
|
||||
NOT_LOADED
|
||||
0 NOT_LOADED
|
||||
0 LOADED
|
||||
10
|
||||
1 LOADED
|
||||
|
@ -12,7 +12,7 @@ LAYOUT(FLAT());
|
||||
DETACH DATABASE {CLICKHOUSE_DATABASE:Identifier};
|
||||
ATTACH DATABASE {CLICKHOUSE_DATABASE:Identifier};
|
||||
|
||||
SELECT COALESCE((SELECT status FROM system.dictionaries WHERE database = currentDatabase() AND name = 'dict')::Nullable(String), 'NOT_LOADED');
|
||||
SELECT query_count, status FROM system.dictionaries WHERE database = currentDatabase() AND name = 'dict';
|
||||
SYSTEM RELOAD DICTIONARY dict;
|
||||
SELECT query_count, status FROM system.dictionaries WHERE database = currentDatabase() AND name = 'dict';
|
||||
SELECT dictGetUInt64('dict', 'val', toUInt64(0));
|
||||
|
Loading…
Reference in New Issue
Block a user