提交 6d74a5f5 编写于 作者: V Vitaliy Lyudvichenko 提交者: alexey-milovidov

Resolves #851. Table was in shutdown state after aborted drop. [#CLICKHOUSE-2184]

上级 91b55994
......@@ -89,6 +89,13 @@ BlockIO InterpreterDropQuery::execute()
for (auto & table : tables_to_drop)
{
if (!drop.detach)
{
if (!table.first->checkTableCanBeDropped())
throw Exception("Table " + database_name + "." + table.first->getTableName() + " couldn't be dropped due to failed pre-drop check",
ErrorCodes::TABLE_WAS_NOT_DROPPED);
}
table.first->shutdown();
/// If table was already dropped by anyone, an exception will be thrown
......@@ -103,10 +110,6 @@ BlockIO InterpreterDropQuery::execute()
}
else
{
if (!table.first->checkTableCanBeDropped())
throw Exception("Table " + database_name + "." + current_table_name + " couldn't be dropped due to failed pre-drop check",
ErrorCodes::TABLE_WAS_NOT_DROPPED);
/// Delete table metdata and table itself from memory
database->removeTable(current_table_name);
/// Delete table data
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册