Repository navigation
Fix segfault when moving conditions to PREWHERE with the old analyzer on 26.8 - #133157
Merged
Merged
Conversation
…ptimization The backport of #131054 to `26.8` calls `conditionMayThrow` on `RPNBuilderTreeNode::getDAGNode`, which is null when the conditions are moved to PREWHERE by the AST-based `MergeTreeWhereOptimizer::optimize` (the old analyzer with `query_plan_optimize_prewhere` or `query_plan_enable_optimizations` disabled). Master no longer has that path. Skip the check when there is no DAG node, as before the backport. Seen in stress tests on `26.8` since 2026-11-14 (STID 2044-429a): https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=133058&sha=028918ffb14f792e6702c2733a65dc2b676a56ad&name_0=BackportPR&name_1=Stress%20test%20%28amd_tsan%29 #133058 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
Workflow [BackportPR], commit [cc78c9e] Summary: ✅ |
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.
On
26.8, the backport of #131054 (#131109) callsconditionMayThrowonRPNBuilderTreeNode::getDAGNode. That node is null when the AST-basedMergeTreeWhereOptimizer::optimizemoves the conditions, which happens with the old analyzer whenquery_plan_optimize_prewhereorquery_plan_enable_optimizationsis disabled. AnySELECTfrom aMergeTreetable with a movableWHEREcondition then segfaults. Master and26.10+ no longer have the AST path, so this only affects26.8. This PR skips the check when there is no DAG node, so the behavior is the same as before the backport.Since 2026-11-14, stress tests on
26.8fail with this crash (STID2044-429a), for example https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=133058&sha=028918ffb14f792e6702c2733a65dc2b676a56ad&name_0=BackportPR&name_1=Stress%20test%20%28amd_tsan%29The new test segfaults with the current
26.8build from #133058 (build_arm_release).Related: #131109
Related: #131054
Related: #133058
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix a segfault in a
SELECTfrom aMergeTreetable with the old analyzer (enable_analyzer = 0) whenquery_plan_optimize_prewhereorquery_plan_enable_optimizationsis disabled.🤖 Generated with Claude Code
Version info
26.8.42.15