Skip to content

Cherry pick #119032 to 26.3: Text index: make mergeTreeTextIndex stricter when a row policy applies - #120294

Merged
PedroTadim merged 21 commits into
backport/26.3/119032from
cherrypick/26.3/119032
Sep 17, 2026
Merged

PedroTadim merged 21 commits into
backport/26.3/119032from
cherrypick/26.3/119032

Conversation

@robot-clickhouse

Copy link
Copy Markdown
Member

Original pull-request #119032

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-pick locally.
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:

  • delete the pr-cherrypick label from the PR
  • delete this branch from the repository

You also need to check the Original pull-request for pr-backports-created label, and delete if it's presented there

The PR source

The PR is created in the CI job

ahmadov and others added 20 commits September 9, 2026 15:19
Previously, reading the text index was denied only when the row policy
referenced an indexed column. But the index contains tokens of all rows,
including those hidden by a policy on any other column, so the tokens of
hidden rows were exposed.

Now reading from `mergeTreeTextIndex` is not allowed whenever a row
policy applies to the table, regardless of which columns it uses.

Closes ClickHouse/clickhouse-private#69196.
…-row-policy

Text index: make `mergeTreeTextIndex` stricter when a row policy applies
@robot-clickhouse robot-clickhouse added pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! do not test disable testing on pull request pr-critical-bugfix labels Sep 15, 2026
Resolutions:
- `TableFunctionMergeTreeTextIndex.cpp`: dropped `dependsOnCurrentUserGrants`.
  The virtual does not exist on `ITableFunction` here, nor on any release
  branch; it and its `InterpreterCreateQuery` consumer are master-only, so the
  `override` would not compile. Kept `canBeUsedToCreateTable`, which the
  cherry-pick carries as context and which the branch's `InterpreterCreateQuery`
  does consume, as the merged 26.6 and 26.8 backports did. 26.3's
  `MergeTreeIndexFactory::get` takes only the index description, so
  `resolveIndex` calls the single-argument form and the `MergeTreeData` cast
  that master needs only to reach `getSettings()` is dropped.
- `StorageMergeTreeTextIndex.{h,cpp}`: kept `checkAccess` and dropped
  `createVirtuals`, which the cherry-pick carries as context and 26.3 does not
  have. 26.3 still names the read entry point `read`, not `readImpl`, so that
  name is kept.

`05153_text_index_mergeTreeTextIndex_create_table_as` is reduced to the form
26.6 and 26.8 carry: its two nested-`remote` cases assert the refusal that
`dependsOnCurrentUserGrants` drives, which this branch cannot do. All twelve
test files are now identical to the merged 26.8 backport.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not test disable testing on pull request pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! pr-critical-bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants