mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 17:02:25 +00:00
Remove dropTable of temp table from InterpreterDropQuery.
This commit is contained in:
parent
b0ced21c30
commit
f410834bfb
@ -121,14 +121,9 @@ TemporaryTableHolder::~TemporaryTableHolder()
|
||||
{
|
||||
if (id != UUIDHelpers::Nil)
|
||||
{
|
||||
/// Table maybe dropped before by DROP TEMPORARY TABLE
|
||||
/// Thus we need to verify the existence of the table before calling dropTable
|
||||
auto table = temporary_tables->tryGetTable("_tmp_" + toString(id), getContext());
|
||||
if (table && !table->is_dropped)
|
||||
{
|
||||
table->flushAndShutdown();
|
||||
temporary_tables->dropTable(getContext(), "_tmp_" + toString(id));
|
||||
}
|
||||
auto table = getTable();
|
||||
table->flushAndShutdown();
|
||||
temporary_tables->dropTable(getContext(), "_tmp_" + toString(id));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -282,12 +282,6 @@ BlockIO InterpreterDropQuery::executeToTemporaryTable(const String & table_name,
|
||||
else if (kind == ASTDropQuery::Kind::Drop)
|
||||
{
|
||||
context_handle->removeExternalTable(table_name);
|
||||
table->flushAndShutdown();
|
||||
auto table_lock = table->lockExclusively(getContext()->getCurrentQueryId(), getContext()->getSettingsRef().lock_acquire_timeout);
|
||||
/// Delete table data
|
||||
DatabasePtr database = DatabaseCatalog::instance().getDatabase(DatabaseCatalog::TEMPORARY_DATABASE);
|
||||
UUID table_uuid = table->getStorageID().uuid;
|
||||
database->dropTable(getContext(), "_tmp_" + toString(table_uuid));
|
||||
}
|
||||
else if (kind == ASTDropQuery::Kind::Detach)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user