This commit is contained in:
Alexander Tokmakov 2020-03-24 22:03:37 +03:00
parent 01d283c24f
commit d0b37a5a70
2 changed files with 4 additions and 2 deletions

View File

@ -281,6 +281,7 @@ void DatabaseOnDisk::renameTable(
/// Notify the table that it is renamed. It will move data to new path (if it stores data on disk) and update StorageID
table->rename(to_database.getTableDataPath(create), to_database.getDatabaseName(), to_table_name, table_lock);
table->resetStorageIDForTableFunction({create.database, create.table, create.uuid}); /// reset UUID
}
catch (const Exception &)
{

View File

@ -76,8 +76,9 @@ BlockIO InterpreterDropQuery::executeToTable(
auto table_id = context.resolveStorageID(table_id_, Context::ResolveOrdinary);
std::unique_ptr<DDLGuard> ddl_guard;
if (DatabaseCatalog::instance().getDatabase(table_id.database_name)->getEngineName() != "Atomic")
ddl_guard = (!query.no_ddl_lock ? DatabaseCatalog::instance().getDDLGuard(table_id.database_name, table_id.table_name) : nullptr);
if (auto db = DatabaseCatalog::instance().tryGetDatabase(table_id.database_name)) //FIXME
if (db->getEngineName() != "Atomic")
ddl_guard = (!query.no_ddl_lock ? DatabaseCatalog::instance().getDDLGuard(table_id.database_name, table_id.table_name) : nullptr);
auto [database, table] = tryGetDatabaseAndTable(table_id.database_name, table_id.table_name, query.if_exists);