Repository navigation
Antalya 25.8 Backport of 7a5f464 - Fix null pointer dereference in executeQueryImpl when use_query_cache=1 and stage=QueryPlan - #2568
Merged
Conversation
…che=1` and `stage=QueryPlan` When `remote()` is used with a single address and `serialize_query_plan=1`, the remote node receives the query with `stage=QueryPlan` and `query_kind=INITIAL_QUERY`. In that path, `executeQueryImpl` skips parsing, leaving `out_ast` null. The `can_use_query_result_cache` check at line 1649 then dereferences the null `out_ast` before the null guard can fire. Fix: add `&& out_ast` before the `as<ASTSelectQuery>()` call. The same guard already exists on line 1683 for a nearby check. Observed in stress test `01018_Distributed__shard_num` with fuzz-injected `use_query_cache=1`: https://altinity-build-artifacts.s3.amazonaws.com/PRs/1867/0f1a2bdd63003e2d54b41fcaf7d71c020de69cca/stress_test_arm_asan_s3/clickhouse-server.err.log Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
|
PR verification AI-assisted analysis confirms the code change:
Adding the |
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.
When
remote()is used with a single address andserialize_query_plan=1, the remote node receives the query withstage=QueryPlanandquery_kind=INITIAL_QUERY. In that path,executeQueryImplskips parsing, leavingout_astnull. Thecan_use_query_result_cachecheck at line 1649 then dereferences the nullout_astbefore the null guard can fire.Fix: add
&& out_astbefore theas<ASTSelectQuery>()call. The same guard already exists on line 1683 for a nearby check.Observed in stress test
01018_Distributed__shard_numwith fuzz-injecteduse_query_cache=1:https://altinity-build-artifacts.s3.amazonaws.com/PRs/1867/0f1a2bdd63003e2d54b41fcaf7d71c020de69cca/stress_test_arm_asan_s3/clickhouse-server.err.log
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix a failure in tsan stress test
Documentation entry for user-facing changes
...
CI/CD Options
Exclude tests:
Regression jobs to run: