Repository navigation
Revert "Reject ATTACH TABLE with storage clauses but no ENGINE" - #105032
Merged
Algunenano merged 1 commit intoMay 15, 2026
Merged
Algunenano merged 1 commit into
Algunenano merged 1 commit into
Conversation
Algunenano
enabled auto-merge
May 15, 2026 13:55
Contributor
|
Workflow [PR], commit [f0500bd] AI ReviewSummaryThis PR cleanly reverts Final VerdictStatus: ✅ Approve |
Algunenano
deleted the
revert-104800-groeneai/fix-104791-attach-table-settings-silent-ignore
branch
May 15, 2026 14:09
pull Bot
pushed a commit
to Spencerx/ClickHouse
that referenced
this pull request
May 22, 2026
Re-land of ClickHouse#104800 with a narrower guard that does not break `ATTACH TABLE t SETTINGS log_comment = 'foo';`. PR ClickHouse#104800 was reverted in ClickHouse#105032 because it rejected that pattern, which internal CI relies on (reported by @Algunenano on ClickHouse#104791). `InterpreterSetQuery::applySettingsFromQuery` runs in `executeQueryImpl` before `InterpreterCreateQuery::createTable` and hoists session settings out of `create.storage->settings` into the context, resetting `storage->settings` to `nullptr` when nothing engine-specific is left. The reverted guard fired only on the existence of an `ASTStorage` without an `engine`, so by the time it ran the storage object had already been emptied — rejecting the legitimate `log_comment` shape. The narrower guard checks the individual non-engine fields (`partition_by`, `primary_key`, `order_by`, `sample_by`, `ttl_table`, `unique_key`, `settings`) so it only rejects when there is something the short-`ATTACH` path would actually drop: ATTACH TABLE t; OK (short ATTACH) ATTACH TABLE t SETTINGS log_comment = 'foo'; OK (session bind) ATTACH TABLE t SETTINGS index_granularity = 100; BAD_ARGUMENTS ATTACH TABLE t SETTINGS max_part_loading_threads = 16; BAD_ARGUMENTS ATTACH TABLE t ORDER BY id; BAD_ARGUMENTS ATTACH TABLE t PARTITION BY id; BAD_ARGUMENTS Regression test `04247_attach_table_storage_clauses_without_engine_error` covers all six cases. Closes ClickHouse#104791. Co-Authored-By: Claude Opus 4.7 <[email protected]>
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.
Reverts #104800
Broke CI
Version info
26.5.1.678