Merge branch 'pg-ch-replica' of github.com:kssenii/ClickHouse into pg-ch-replica

This commit is contained in:
kssenii 2021-06-29 23:20:33 +00:00
commit 1a5c30e249

View File

@ -109,10 +109,11 @@ StoragePtr DatabaseAtomic::detachTable(const String & name)
void DatabaseAtomic::dropTable(ContextPtr local_context, const String & table_name, bool no_delay)
{
auto * storage = tryGetTable(table_name, local_context).get();
auto storage = tryGetTable(table_name, local_context);
/// Remove the inner table (if any) to avoid deadlock
/// (due to attempt to execute DROP from the worker thread)
storage->dropInnerTableIfAny(no_delay, local_context);
if (storage)
storage->dropInnerTableIfAny(no_delay, local_context);
String table_metadata_path = getObjectMetadataPath(table_name);
String table_metadata_path_drop;