Add RESET_SETTING to check if is a settings alter

This commit is contained in:
Elena 2022-11-30 19:42:31 +01:00
parent ba7c3c5eae
commit 0a35a072d9
2 changed files with 12 additions and 1 deletions

View File

@ -509,7 +509,7 @@ bool ASTAlterQuery::isOneCommandTypeOnly(const ASTAlterCommand::Type & type) con
bool ASTAlterQuery::isSettingsAlter() const
{
return isOneCommandTypeOnly(ASTAlterCommand::MODIFY_SETTING);
return isOneCommandTypeOnly(ASTAlterCommand::MODIFY_SETTING) || isOneCommandTypeOnly(ASTAlterCommand::RESET_SETTING);
}
bool ASTAlterQuery::isFreezeAlter() const

View File

@ -52,3 +52,14 @@ def test_default_database_on_cluster(started_cluster):
database="test_default_database",
sql="SHOW CREATE test_local_table FORMAT TSV",
).endswith("old_parts_lifetime = 100\n")
ch1.query(
database="test_default_database",
sql="ALTER TABLE test_local_table ON CLUSTER 'cluster' RESET SETTING old_parts_lifetime;",
)
for node in [ch1, ch2]:
assert not node.query(
database="test_default_database",
sql="SHOW CREATE test_local_table FORMAT TSV",
).endswith("old_parts_lifetime = 100\n")