Repository navigation
Cherry pick #120080 to 26.8: Fix privilege check bypass in text index transform expressions - #130393
Merged
robot-ch-test-poll3 merged 68 commits intoNov 10, 2026
Merged
Conversation
…metadata revalidation
`countmin` sketches need the `datasketches` library, which the Fast test build lacks, so the test failed there with `Unknown statistic type 'CountMinSketch'`. `minmax` is always available and exercises the same implicit-statistics path. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=120080&sha=882c0069c412492821ef30f9d69cff26d4ccc683&name_0=PR&name_1=Fast%20test #120080 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since the hosts of an `ON CLUSTER` query do not run it as the initiating user unless `distributed_ddl_use_initial_user_and_roles` is enabled, a text index transform is now refused with `INCORRECT_QUERY` before the per-function privilege check. Update the expectations in `02346_text_index_transform_access_replicated_database` accordingly, and drop the missing-table case, whose check was removed together with the binding. Cases 3 and 4 of `02346_text_index_transform_alter_segments` tested how an `ON CLUSTER` transform is bound for the hosts, which is no longer reachable; the refusal is covered by `02346_text_index_transform_on_cluster`. The test no longer uses ZooKeeper, so its tags are removed. CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=120080&sha=dfd5282fd456ecfbd0a600e8160317804ee28074&name_0=PR&name_1=Fast%20test PR: #120080 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eclared The check refusing subqueries, table references, table/set `IN` operands and non-deterministic functions in a text index `preprocessor` / `postprocessor` ran inside `buildActionsDAGFromAST`, i.e. on every construction of the index: on server start, on `ATTACH` of stored metadata, and on the revalidation of existing indices during unrelated `ALTER`s. Metadata written by older releases with such transforms would then fail to load. Move it into `checkTextIndexPreAndPostProcessorPermissions`, which runs only where a user declares an index (`CREATE`, full-definition `ATTACH`, `AS src`, and indices added by `ALTER ... ADD INDEX`), alongside the function permission checks it complements. Address review: #120080 (comment) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fix privilege check bypass in text index transform expressions
Resolve conflicts for the 26.8 tree: - 26.8 has no `DDLQueryOnClusterParams::additional_access_check`, so the `ON CLUSTER` rejection of text index transforms in `InterpreterAlterQuery` and `InterpreterCreateQuery::executeQueryOnCluster` is done inline before `executeDDLQueryOnCluster`, using `distributed_ddl_use_initial_user_and_roles` and `distributed_ddl_entry_format_version` >= `DDLLogEntry::INITIATOR_USER_VERSION`. - Drop master-only context (`normalizeLegacyToTime*`, constraint row-count checks, `checkNoRowPolicyForSetOperands`, the `settings_defaults` parameter of `AlterCommands::apply`) that the conflict hunks pulled in. Co-Authored-By: Claude Opus 5.5 <[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.
Original pull-request #120080
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Before you resolve anything
Conflicts are often caused by a prerequisite change that has not been backported yet, rather than by a real divergence. The bot re-tries this cherry-pick against the release branch on every run, so if that is the case here it will merge itself as soon as the prerequisite lands, and you will see a comment saying so. Manual resolution is only needed while the conflict persists.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job