提交 0d8ec4b2 编写于 作者: R robot-clickhouse

Backport #19064 to 20.12: Restrict MODIFY TTL for tables created in old syntax

上级 e5d36883
......@@ -1491,6 +1491,12 @@ void MergeTreeData::checkAlterIsPossible(const AlterCommands & commands, const S
"ALTER MODIFY ORDER BY is not supported for default-partitioned tables created with the old syntax",
ErrorCodes::BAD_ARGUMENTS);
}
if (command.type == AlterCommand::MODIFY_TTL && !is_custom_partitioned)
{
throw Exception(
"ALTER MODIFY TTL is not supported for default-partitioned tables created with the old syntax",
ErrorCodes::BAD_ARGUMENTS);
}
if (command.type == AlterCommand::MODIFY_SAMPLE_BY)
{
if (!is_custom_partitioned)
......
DROP TABLE IF EXISTS ttl_old_syntax;
CREATE TABLE ttl_old_syntax (d Date, i Int) ENGINE = MergeTree(d, i, 8291);
ALTER TABLE ttl_old_syntax MODIFY TTL toDate('2020-01-01'); -- { serverError 36 }
DROP TABLE ttl_old_syntax;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册