Fix stupid bug with settings alter

This commit is contained in:
alesapin 2020-02-28 15:44:50 +03:00
parent 6fb48c5e9a
commit fc18f82189
4 changed files with 22 additions and 1 deletions

View File

@ -628,6 +628,11 @@ void AlterCommands::validate(const StorageInMemoryMetadata & metadata, const Con
ErrorCodes::NOT_FOUND_COLUMN_IN_BLOCK}; ErrorCodes::NOT_FOUND_COLUMN_IN_BLOCK};
} }
} }
else if (command.type == AlterCommand::MODIFY_SETTING)
{
if (metadata.settings_ast == nullptr)
throw Exception{"Cannot alter settings, because table engine doesn't support settings changes", ErrorCodes::BAD_ARGUMENTS};
}
} }
} }

View File

@ -5,7 +5,7 @@ CREATE TABLE log_for_alter (
Data String Data String
) ENGINE = Log(); ) ENGINE = Log();
ALTER TABLE log_for_alter MODIFY SETTING aaa=123; -- { serverError 48 } ALTER TABLE log_for_alter MODIFY SETTING aaa=123; -- { serverError 36 }
DROP TABLE IF EXISTS log_for_alter; DROP TABLE IF EXISTS log_for_alter;

View File

@ -0,0 +1,15 @@
DROP TABLE IF EXISTS old_format_mt;
CREATE TABLE old_format_mt (
event_date Date,
key UInt64,
value1 UInt64,
value2 String
)
ENGINE = MergeTree(event_date, (key, value1), 8192);
ALTER TABLE old_format_mt MODIFY SETTING enable_mixed_granularity_parts = 1; --{serverError 36}
SELECT 1;
DROP TABLE IF EXISTS old_format_mt;