mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
fix terminate on uncaught exception
This commit is contained in:
parent
5f4c665c76
commit
7e346ec6ec
@ -42,12 +42,17 @@ void DatabaseMemory::dropTable(
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
table->drop();
|
table->drop();
|
||||||
fs::path table_data_dir{getTableDataPath(table_name)};
|
if (table->storesDataOnDisk())
|
||||||
if (fs::exists(table_data_dir))
|
{
|
||||||
fs::remove_all(table_data_dir);
|
assert(database_name != DatabaseCatalog::TEMPORARY_DATABASE);
|
||||||
|
fs::path table_data_dir{getTableDataPath(table_name)};
|
||||||
|
if (fs::exists(table_data_dir))
|
||||||
|
fs::remove_all(table_data_dir);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
|
assert(database_name != DatabaseCatalog::TEMPORARY_DATABASE);
|
||||||
attachTableUnlocked(table_name, table, lock);
|
attachTableUnlocked(table_name, table, lock);
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user