From fbd2f40b051cdf030d83d9386b9afed19b366859 Mon Sep 17 00:00:00 2001 From: kssenii Date: Fri, 3 Sep 2021 09:04:46 +0000 Subject: [PATCH] Fix --- src/Interpreters/MySQL/InterpretersMySQLDDLQuery.cpp | 1 + src/Storages/PostgreSQL/PostgreSQLReplicationHandler.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Interpreters/MySQL/InterpretersMySQLDDLQuery.cpp b/src/Interpreters/MySQL/InterpretersMySQLDDLQuery.cpp index 90917a0fd7e..f2860235117 100644 --- a/src/Interpreters/MySQL/InterpretersMySQLDDLQuery.cpp +++ b/src/Interpreters/MySQL/InterpretersMySQLDDLQuery.cpp @@ -571,6 +571,7 @@ ASTs InterpreterAlterImpl::getRewrittenQueries( auto rewritten_rename_query = std::make_shared(); rewritten_alter_query->database = mapped_to_database; rewritten_alter_query->table = alter_query.table; + rewritten_alter_query->alter_object = ASTAlterQuery::AlterObjectType::TABLE; rewritten_alter_query->set(rewritten_alter_query->command_list, std::make_shared()); String default_after_column; diff --git a/src/Storages/PostgreSQL/PostgreSQLReplicationHandler.cpp b/src/Storages/PostgreSQL/PostgreSQLReplicationHandler.cpp index c47e003a681..7cc3340bbb7 100644 --- a/src/Storages/PostgreSQL/PostgreSQLReplicationHandler.cpp +++ b/src/Storages/PostgreSQL/PostgreSQLReplicationHandler.cpp @@ -456,7 +456,7 @@ void PostgreSQLReplicationHandler::setSetting(const SettingChange & setting) { consumer_task->deactivate(); consumer->setSetting(setting); - consumer_task->schedule(); + consumer_task->activateAndSchedule(); } @@ -658,6 +658,7 @@ void PostgreSQLReplicationHandler::addTableToReplication(StorageMaterializedPost } catch (...) { + consumer_task->activate(); consumer_task->scheduleAfter(RESCHEDULE_MS); auto error_message = getCurrentExceptionMessage(false); @@ -685,13 +686,14 @@ void PostgreSQLReplicationHandler::removeTableFromReplication(const String & pos } catch (...) { + consumer_task->activate(); consumer_task->scheduleAfter(RESCHEDULE_MS); auto error_message = getCurrentExceptionMessage(false); throw Exception(ErrorCodes::POSTGRESQL_REPLICATION_INTERNAL_ERROR, "Failed to remove table `{}` from replication. Info: {}", postgres_table_name, error_message); } - consumer_task->schedule(); + consumer_task->activateAndSchedule(); }