mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Merge pull request #70405 from ClickHouse/backport/24.8/70354
Backport #70354 to 24.8: Fix `MODIFY COLUMN MODIFY SETTINGS` crash for special columns
This commit is contained in:
commit
577a82cc32
@ -884,7 +884,15 @@ void checkSpecialColumn(const std::string_view column_meta_name, const AlterComm
|
||||
{
|
||||
if (command.type == AlterCommand::MODIFY_COLUMN)
|
||||
{
|
||||
if (!typeid_cast<const TMustHaveDataType *>(command.data_type.get()))
|
||||
if (!command.data_type)
|
||||
{
|
||||
throw Exception(
|
||||
ErrorCodes::ALTER_OF_COLUMN_IS_FORBIDDEN,
|
||||
"Trying to modify settings for column {} ({}) ",
|
||||
column_meta_name,
|
||||
command.column_name);
|
||||
}
|
||||
else if (!typeid_cast<const TMustHaveDataType *>(command.data_type.get()))
|
||||
{
|
||||
throw Exception(
|
||||
ErrorCodes::ALTER_OF_COLUMN_IS_FORBIDDEN,
|
||||
|
@ -21,6 +21,7 @@ CREATE TABLE collapsing (key Int64, sign Int8) ENGINE = CollapsingMergeTree(sign
|
||||
ALTER TABLE collapsing MODIFY COLUMN sign String; -- { serverError ALTER_OF_COLUMN_IS_FORBIDDEN }
|
||||
ALTER TABLE collapsing DROP COLUMN sign; -- { serverError ALTER_OF_COLUMN_IS_FORBIDDEN }
|
||||
ALTER TABLE collapsing RENAME COLUMN sign TO sign2; -- { serverError ALTER_OF_COLUMN_IS_FORBIDDEN }
|
||||
ALTER TABLE collapsing MODIFY COLUMN sign MODIFY SETTING max_compress_block_size = 123456; -- { serverError ALTER_OF_COLUMN_IS_FORBIDDEN }
|
||||
|
||||
CREATE TABLE versioned_collapsing_wrong (key Int64, version UInt8, sign Int8) ENGINE = VersionedCollapsingMergeTree(sign, sign) ORDER BY key; -- { serverError BAD_ARGUMENTS }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user