Merge pull request #5613 from sundy-li/improve/distribute-alter-more

make isSupportedAlterType better
This commit is contained in:
alexey-milovidov 2019-06-14 15:39:09 +03:00 committed by GitHub
commit eb1fe2ed17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -200,21 +200,16 @@ static std::unique_ptr<zkutil::Lock> createSimpleZooKeeperLock(
static bool isSupportedAlterType(int type)
{
static const std::unordered_set<int> 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<int> 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;
}