mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Backport #70354 to 24.9: Fix MODIFY COLUMN MODIFY SETTINGS
crash for special columns
This commit is contained in:
parent
4336ee367c
commit
ce59b6f09e
@ -908,7 +908,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