提交 9033f1ad 编写于 作者: A Alexey Milovidov

Merge branch 'master' of github.com:yandex/ClickHouse

......@@ -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
......
......@@ -433,7 +433,7 @@ int Server::main(const std::vector<std::string> & args)
global_context->shutdown();
LOG_DEBUG(log, "Shutted down storages.");
/** Explicitly destroy Context. It is more convenient than in destructor of Server, becuase logger is still available.
/** Explicitly destroy Context. It is more convenient than in destructor of Server, because logger is still available.
* At this moment, no one could own shared part of Context.
*/
global_context.reset();
......
......@@ -29,7 +29,7 @@ Graphite хранит в ClickHouse полные данные, а получат
.. code-block:: text
pattern
pattern
regexp
function
age -> precision
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册