From eac978f1e0303d83b53516a8e02b96fbd479ca4a Mon Sep 17 00:00:00 2001 From: sundy-li <543950155@qq.com> Date: Fri, 14 Jun 2019 11:06:08 +0800 Subject: [PATCH] make isSupportedAlterType better --- dbms/src/Interpreters/DDLWorker.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/dbms/src/Interpreters/DDLWorker.cpp b/dbms/src/Interpreters/DDLWorker.cpp index 3df46ba8870..1608feb798d 100644 --- a/dbms/src/Interpreters/DDLWorker.cpp +++ b/dbms/src/Interpreters/DDLWorker.cpp @@ -200,21 +200,16 @@ static std::unique_ptr createSimpleZooKeeperLock( static bool isSupportedAlterType(int type) { - static const std::unordered_set supported_alter_types{ - ASTAlterCommand::ADD_COLUMN, - ASTAlterCommand::DROP_COLUMN, - ASTAlterCommand::MODIFY_COLUMN, - ASTAlterCommand::DROP_PARTITION, - ASTAlterCommand::DELETE, - ASTAlterCommand::UPDATE, - ASTAlterCommand::COMMENT_COLUMN, - ASTAlterCommand::MODIFY_ORDER_BY, - ASTAlterCommand::MODIFY_TTL, - ASTAlterCommand::ADD_INDEX, - ASTAlterCommand::DROP_INDEX, + static const std::unordered_set unsupported_alter_types{ + ASTAlterCommand::ATTACH_PARTITION, + ASTAlterCommand::REPLACE_PARTITION, + ASTAlterCommand::FETCH_PARTITION, + ASTAlterCommand::FREEZE_PARTITION, + ASTAlterCommand::FREEZE_ALL, + ASTAlterCommand::NO_TYPE, }; - return supported_alter_types.count(type) != 0; + return unsupported_alter_types.count(type) == 0; }