Repository navigation
Add a test for EXPLAIN AST optimize = 1 with an IN subquery over remote in PREWHERE - #124634
Conversation
…te in PREWHERE `EXPLAIN AST optimize = 1` analyses the query with the interpreter that preceded the analyzer, and `appendPrewhere` builds the set of an `IN` subquery in `PREWHERE`. Before ClickHouse#121639 that set was planned without a query tree, so reading `remote` through `StorageDistributed::read` dereferenced a null `PlannerContext`. None of ClickHouse#121639's tests goes through `EXPLAIN`, so this adds the minimal case from ClickHouse#117253. CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117253&sha=546cd65f39602b759209f1649d527c047d1bc250&name_0=PR&name_1=AST%20fuzzer%20%28amd_release%2C%20oracle%29 Related: ClickHouse#121639 Related: ClickHouse#117253 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold review (1 nit).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261008-132400 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-7:20261008-130122 |
|
Workflow [PR], commit [7c90c8d] Summary: ✅ AI ReviewSummaryThis PR adds one stateless regression test for the Missing context / blind spots
Final Verdict✅ No blocking or major findings. |
Related: #121639
Related: #117253
Related: #121464
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
This adds the minimal case from #117253 as a regression test for the
EXPLAINpath of theStorageDistributed::readnull dereference that #121639 fixed. None of the tests in #121639 goes throughEXPLAIN.EXPLAIN AST optimize = 1analyses the query with the interpreter that preceded the analyzer. That interpreter builds the set of anINsubquery inPREWHERE(appendPrewhere->ActionsMatcher::makeSet). Before #121639 the set's plan forremote(...)reachedStorageDistributed::readwithout aPlannerContext. The test reads the explained AST throughSELECT ... FROM (EXPLAIN ...):*must be expanded, which proves the analysis ran, andFunction remotemust still be in the AST.Validation: on a master build without #121639 (
44b568f4) the test segfaults the debug binary, and ASan+UBSan reportsmember call on null pointer of type 'DB::PlannerContext'atStorageDistributed.cpp:1036. On master it prints0 1and passes 50/50 runs with randomized settings.CI report of the original failure: AST fuzzer (amd_release, oracle) on #117253
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/124634]
Version info
26.10.1.1987-master(included in26.10and later)