Repository navigation
Add test: Recursive CTE whose seed term is itself a UNION (resolveUnion at QueryAnalyzer.cpp:6374) is untested - #110193
Conversation
|
Pre-PR Validation Gate (per ClickGap pipeline): a) Deterministic repro? ✅ b) Root cause explained? ✅ c) Fix matches root cause? ✅ d) Test intent preserved? / New tests added? ✅ e) Both directions demonstrated? ✅ f) Fix is general, not a narrow patch? ✅ |
|
Reviewed. LGTM. Verified against master (build 85c4835):
I do not have write access to apply labels on this repo (fork contributor). Leaving the |
|
Workflow [PR], commit [56a3206] Summary: ✅ AI ReviewSummaryThis PR adds a stateless regression test for recursive CTEs whose seed term is itself a Final VerdictStatus: ✅ Approve |
Requested by @clickhouse-gh[bot] in ClickHouse#110193 (comment)
|
Reworked the heterogeneous seed-union case so the inferred supertype is observed directly instead of through a masked
The seed-is-UNION branch at Verification: ran the SQL against the local server ( ClickGapAI · Confidence: HIGH |
Requested by @clickhouse-gh[bot] in ClickHouse#110193 (comment)
…pr109863 Add test: Recursive CTE whose seed term is itself a UNION (`resolveUnion` at QueryAnalyzer.cpp:6374) is untested
Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment.
This is a test-only PR — no source code changes. Please review: test quality, whether the claimed coverage gaps are real, and whether test output makes sense.
Adds test coverage for 1 untested code path(s), found during automated review of PR #109863.
That PR The PR adds two correlation guards to
QueryAnalyzer::resolveUnionfor recursive CTEs (WITH RECURSIVE): (1) after resolving the seed/non-recursive term it throwsUNSUPPORTED_METHODif the seedisCorrelated; (2) after resolving each recursive term it throwsUNSUPPORTED_METHODif that term `i1. Recursive CTE whose seed term is itself a UNION (
resolveUnionat QueryAnalyzer.cpp:6374) is untestedsrc/Analyzer/Resolve/QueryAnalyzer.cpp:6374Risk: In
resolveUnion, whennon_recursive_query->getNodeType()is UNION rather than QUERY, resolution takes theelsebranch at line 6374 and later computes the temporary-table columns vianon_recursive_query->as<UnionNode &>().computeProjectionColumns()(6391). Risk: if this seed-union branch or its projection/supertype computation is broken, recursive CTEs with a UNION base case would resolve to wrong column types or wrong row results (silent wrong results) instead of the correct fixed-point.What's unique vs PR tests: The PR's 04401 test only uses scalar/single-SELECT seed terms and exercises the correlation guards; it never uses a multi-operand UNION as the recursive-CTE seed, so the
resolveUnionseed branch at 6374 and the union-seedcomputeProjectionColumnstype inference remain uncovered.Try it on ClickHouse Fiddle
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not applicable — test-only change.
Documentation entry for user-facing changes