Repository navigation
Use castStorage for the Join row policy check in the legacy analyzer - #124441
Merged
Merged
Conversation
`typeid_cast` compares the exact dynamic type, so the check added in #121398 matched `StorageJoin` itself and nothing derived from it. `castStorage` is a `dynamic_pointer_cast` that also looks through `StorageTableProxy`, and it is how the new analyzer, `joinGet`, and the `setStorageJoin` branch a few lines below already detect a `Join` table. On master the legacy analyzer is not reachable from user queries (`enable_analyzer = 0` is replaced with `1`), so this changes nothing observable here. It matters for the release branches that still run the legacy analyzer, where the backport of the same check otherwise joins a storage derived from `StorageJoin` under a row policy as a filtered stream instead of failing with `ACCESS_DENIED` like a `Join` table does. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Contributor
|
Workflow [PR], commit [d59ee36] Summary: ✅
AI ReviewSummaryThis PR tightens the legacy-analyzer row-policy guard in Missing context / blind spots
Final Verdict
LLVM Coverage ReportMeasured on commit d59ee36.
Changed lines: Changed C/C++ lines covered: 2/6 (33.33%) · Uncovered code |
This was referenced Oct 8, 2026
robot-ch-test-poll
added a commit
that referenced
this pull request
Oct 9, 2026
Cherry pick #124441 to 26.3: Use `castStorage` for the `Join` row policy check in the legacy analyzer
robot-clickhouse
added a commit
that referenced
this pull request
Oct 9, 2026
… check in the legacy analyzer
robot-ch-test-poll
added a commit
that referenced
this pull request
Oct 9, 2026
Cherry pick #124441 to 26.7: Use `castStorage` for the `Join` row policy check in the legacy analyzer
robot-clickhouse
added a commit
that referenced
this pull request
Oct 9, 2026
… check in the legacy analyzer
robot-ch-test-poll
added a commit
that referenced
this pull request
Oct 9, 2026
Cherry pick #124441 to 26.8: Use `castStorage` for the `Join` row policy check in the legacy analyzer
robot-clickhouse
added a commit
that referenced
this pull request
Oct 9, 2026
… check in the legacy analyzer
robot-ch-test-poll
added a commit
that referenced
this pull request
Oct 9, 2026
Cherry pick #124441 to 26.9: Use `castStorage` for the `Join` row policy check in the legacy analyzer
robot-clickhouse
added a commit
that referenced
this pull request
Oct 9, 2026
… check in the legacy analyzer
vdimir
added a commit
that referenced
this pull request
Oct 10, 2026
The resolved cherry-pick kept both sides of the conflict: the `Join` table check from #124441 and the trimmed guard backported earlier from #121398, with the old comment split between them. Keep the check only and declare `ErrorCodes::ACCESS_DENIED`, which the file never had. `castStorage` comes to 26.3 with #124513, which has to be merged first; include `Storages/StorageProxy.h` for it as the other branches do. Co-Authored-By: Claude Fable 5.1 <[email protected]>
vdimir
added a commit
that referenced
this pull request
Oct 10, 2026
The resolved cherry-pick kept both sides of the conflict: the `Join` table check from #124441 and the trimmed guard backported earlier from #121398, with the old comment split between them. Keep the check only and declare `ErrorCodes::ACCESS_DENIED`, which the file never had. Co-Authored-By: Claude Fable 5.1 <[email protected]>
vdimir
added a commit
that referenced
this pull request
Oct 10, 2026
The resolved cherry-pick kept both sides of the conflict: the `Join` table check from #124441 and the trimmed guard backported earlier from #121398, with the old comment split between them. Keep the check only and declare `ErrorCodes::ACCESS_DENIED`, which the file never had. Co-Authored-By: Claude Fable 5.1 <[email protected]>
vdimir
added a commit
that referenced
this pull request
Oct 10, 2026
The resolved cherry-pick of #124441 uses `ErrorCodes::ACCESS_DENIED`, `RowPolicyFilterType` and `RowPolicyFilter::isAlwaysTrue`, but the file neither declares the error code nor includes the row policy headers: `Context.h` only forward-declares those types. Co-Authored-By: Claude Fable 5.1 <[email protected]>
vdimir
added a commit
that referenced
this pull request
Oct 10, 2026
The earlier backport of #121398 to this branch was reverted. Add it back on top of #124441: `joinGet` and `joinGetOrNull` fail with `ACCESS_DENIED` while a row policy applies to the `Join` table, the analyzer does the same in `buildQueryPlanForJoinNode` instead of joining the table as a stream, the documentation says so, and tests 05233 and 05234 cover it. Co-Authored-By: Claude Fable 5.1 <[email protected]>
clickhouse-gh Bot
added a commit
that referenced
this pull request
Oct 10, 2026
Backport #124441 to 26.8: Use `castStorage` for the `Join` row policy check in the legacy analyzer
clickhouse-gh Bot
added a commit
that referenced
this pull request
Oct 10, 2026
Backport #124441 to 26.9: Use `castStorage` for the `Join` row policy check in the legacy analyzer
clickhouse-gh Bot
added a commit
that referenced
this pull request
Oct 10, 2026
Backport #124441 to 26.7: Use `castStorage` for the `Join` row policy check in the legacy analyzer
1 task
vdimir
added a commit
that referenced
this pull request
Oct 14, 2026
Backport #124441 to 26.3: Use `castStorage` for the `Join` row policy check in the legacy analyzer
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.
Follow-up to #121398. That PR was also not fully backported, so the missing changes will be included in the backports of the current PR.
typeid_castcompares the exact dynamic type, so the row policy check forJointables in the legacy analyzer (JoinedTables::makeTableJoin) matchedStorageJoinitself and nothing derived from it.castStorageis adynamic_pointer_castthat also looks throughStorageTableProxy, and it is how the new analyzer,joinGet, and thesetStorageJoinbranch a few lines below already detect aJointable.On master the legacy analyzer is not reachable from user queries, so this changes nothing observable here. It matters for the release branches that still run the legacy analyzer, where the backport of #121398 otherwise joins a storage derived from
StorageJoinunder a row policy as a filtered stream instead of failing withACCESS_DENIED.Changelog category (leave one):
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/124441]
Version info
26.10.1.1804-master(included in26.10and later)26.9.15.5,26.8.23.6,26.7.26.9,26.3.51.8