This commit is contained in:
Duc Canh Le 2024-09-18 23:54:18 +03:00 committed by GitHub
commit c45ba15ab7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -1488,6 +1488,11 @@ void AlterCommands::validate(const StoragePtr & table, ContextPtr context) const
ErrorCodes::BAD_ARGUMENTS,
"Column {} doesn't have COMMENT, cannot remove it",
backQuote(column_name));
if (command.to_remove == AlterCommand::RemoveProperty::SETTINGS && column_from_table.settings.empty())
throw Exception(
ErrorCodes::BAD_ARGUMENTS,
"Column {} doesn't have SETTINGS, cannot remove it",
backQuote(column_name));
}
modified_columns.emplace(column_name);

View File

@ -71,3 +71,8 @@ CREATE TABLE tab
ENGINE = MergeTree
ORDER BY id
SETTINGS min_bytes_for_wide_part = 1; -- {serverError UNKNOWN_SETTING}
-- https://github.com/ClickHouse/ClickHouse/issues/69634
CREATE TABLE t0 (c0 Int8) ENGINE = CollapsingMergeTree(c0) ORDER BY tuple();
ALTER TABLE t0 MODIFY COLUMN c0 REMOVE SETTINGS; -- {serverError BAD_ARGUMENTS}
DROP TABLE t0;