Repository navigation
fix: block OPTIMIZE DEDUPLICATE and MODIFY/MATERIALIZE TTL without CLICKHOUSE_ALLOW_DROP - #260
Merged
joe-clickhouse merged 3 commits intoNov 16, 2026
Conversation
…ICKHOUSE_ALLOW_DROP Both delete rows but passed the destructive-operation guard with only write access enabled. TTL in CREATE TABLE stays allowed. Fixes ClickHouse#259
Contributor
Author
|
@joe-clickhouse @chernser @alex-clickhouse could one of you take a look when you have a moment? Small follow-up to #220. cc @mosya415 since you wrote that one. |
joe-clickhouse
approved these changes
Nov 16, 2026
Collaborator
|
Approved, thanks for the fix! I added column TTL coverage, including the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #259
OPTIMIZE ... DEDUPLICATEandALTER TABLE ... MODIFY TTL/MATERIALIZE TTLdelete rows. Before this change they ran with onlyCLICKHOUSE_ALLOW_WRITE_ACCESS=trueset. This adds them to_DESTRUCTIVE_KEYWORDS, next to the cases from #220.\bDEDUPLICATE\bcoversOPTIMIZE ... [FINAL] DEDUPLICATE [BY ...]. PlainOPTIMIZEis still allowed.\b(?:MODIFY|MATERIALIZE)\s+TTL\bcovers table TTL changes. ATTLclause inCREATE TABLEandREMOVE TTLare still allowed.Checked against ClickHouse 26.3 through
run_query:Tests: I added both cases to
DESTRUCTIVE_QUERIESand the allowed forms toALLOWED_QUERIES.uv run pytest testsgives 875 passed, 1 xfailed, andruff check .is clean.