mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Merge pull request #19064 from CurtizJ/restrict-modify-ttl
Restrict MODIFY TTL for tables created in old syntax
This commit is contained in:
commit
8d58ce532a
@ -1506,6 +1506,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",
|
"ALTER MODIFY ORDER BY is not supported for default-partitioned tables created with the old syntax",
|
||||||
ErrorCodes::BAD_ARGUMENTS);
|
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 (command.type == AlterCommand::MODIFY_SAMPLE_BY)
|
||||||
{
|
{
|
||||||
if (!is_custom_partitioned)
|
if (!is_custom_partitioned)
|
||||||
|
6
tests/queries/0_stateless/01652_ttl_old_syntax.sql
Normal file
6
tests/queries/0_stateless/01652_ttl_old_syntax.sql
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
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;
|
Loading…
Reference in New Issue
Block a user