Make check more specific

This commit is contained in:
János Benjamin Antal 2024-08-28 13:30:25 +00:00
parent 0d463b839e
commit f76e6ecdaf

View File

@ -22,6 +22,7 @@ namespace ErrorCodes
{ {
extern const int UNKNOWN_MUTATION_COMMAND; extern const int UNKNOWN_MUTATION_COMMAND;
extern const int MULTIPLE_ASSIGNMENTS_TO_COLUMN; extern const int MULTIPLE_ASSIGNMENTS_TO_COLUMN;
extern const int LOGICAL_ERROR;
} }
@ -115,10 +116,10 @@ std::optional<MutationCommand> MutationCommand::parse(ASTAlterCommand * command,
res.column_name = getIdentifierName(command->column); res.column_name = getIdentifierName(command->column);
return res; return res;
} }
/// MODIFY COLUMN x REMOVE MATERIALIZED is a valid alter command, but doesn't have any specified column type, thus no mutation is needed /// MODIFY COLUMN x REMOVE MATERIALIZED/RESET SETTING/MODIFY SETTING is a valid alter command, but doesn't have any specified column type,
/// thus no mutation is needed
else if ( else if (
parse_alter_commands && command->type == ASTAlterCommand::MODIFY_COLUMN && command->col_decl parse_alter_commands && command->type == ASTAlterCommand::MODIFY_COLUMN && command->remove_property.empty() && nullptr == command->settings_changes && nullptr == command->settings_resets)
&& command->col_decl->as<ASTColumnDeclaration &>().type)
{ {
MutationCommand res; MutationCommand res;
res.ast = command->ptr(); res.ast = command->ptr();