fix hang up with command 'drop table system.query_log sync'

This commit is contained in:
zhanghuajie 2021-12-29 22:10:13 +08:00
parent 8c9a369588
commit fc097173ef

View File

@ -168,6 +168,8 @@ public:
void shutdown() override
{
stopFlushThread();
auto table = DatabaseCatalog::instance().tryGetTable(table_id, getContext());
if (table)
table->flushAndShutdown();
}
@ -186,7 +188,6 @@ private:
/* Saving thread data */
const StorageID table_id;
const String storage_def;
StoragePtr table;
String create_query;
String old_create_query;
bool is_prepared = false;
@ -525,7 +526,7 @@ void SystemLog<LogElement>::prepareTable()
{
String description = table_id.getNameForLogs();
table = DatabaseCatalog::instance().tryGetTable(table_id, getContext());
auto table = DatabaseCatalog::instance().tryGetTable(table_id, getContext());
if (table)
{