Repository navigation
fix(plan): allow GROUP BY and HAVING in recursive CTE scalar subqueries - #30082
mergify[bot] merged 2 commits into
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
22566e4 to
838b815
Compare
|
本轮维护更新:rebase 到 main 仅 rebase。原 CI 的 logservice 测试辅助函数调用签名不匹配已与 main 中兼容调用对齐;本地相关 planner 检查通过,不能据此宣称新 CI 已通过。 本地验证:受影响路径的普通 UT、单轮 race 和完整变更 Go 包范围的增量 SCA 均通过。未运行整套 CI/BVT、GPU 或性能负载;不将历史作者记录标作本轮新运行。 变更保留检查覆盖完整原 PR 与 main 的集成结果;仅保留本轮明确说明的维护增量。新提交的 GitHub CI 结果待运行,原 CI 中未定位或未归因的失败仍需单独跟踪。 |
838b815 to
95f7de5
Compare
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-xupeng · review
Commit: 95f7de570349c257b2d1c75fbdd4e6488431d6d5
Assessment: needs_validation
The complete four-file review found no confirmed defect. The fix consistently reuses existing query-block ownership, and focused and full planner tests pass. Public SQL execution evidence remains necessary for approval.
Model: gpt-6-astra / xhigh
Session: 01a14d34-4e51-79a3-a62d-6c9c16279dc8 · slot 0 · generation 0
Validation:
-
All 14 aggregate/grouping scope subtests and six recursive-reference scope subtests passed with -count=1 and the supplied test-exec. planner-focused-native.log matches checks/1792334995824793681-3.json.
-
Full pkg/sql/plan passed in 28.443s with -count=1. planner-package.log matches checks/1792335049029068623-3.json.
-
Isolation preflight passed. Native prerequisites were freshly built through make cgo and checked against pinned input hashes; the initial native setup rejection was recovered.
-
Pinned head, unchanged source and git diff --check verified. Logs, receipt mappings and review record are retained under /home/xupeng/.local/state/mo-bot/jobs/3bfb4cbb86a35cb6d22f2473/attempt-1.
Limitations:
-
No traceable exact-candidate public BVT execution is supplied. Author claims lack matching revision and terminal artifacts; supplied CI does not exercise this SQL path. Close the gap with normal-comparison runs of recursive_cte_scalar_aggregate.sql, including same-instance rerun and teardown verification, proving NULL/empty groups, cardinality errors and prepared reuse.
-
The linked issue body is absent from the frozen evidence. Issue scope was assessed from the PR's explicit compatibility contract, which preserves rejection of direct recursive aggregation.
Merge Queue Status
This pull request spent 1 hour 26 minutes 44 seconds in the queue, including 49 minutes 48 seconds running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR addresses:
What this PR does / why we need it:
A scalar subquery inside a recursive CTE inherits the recursive statement state even though it owns an independent SELECT query block. As a result, valid scalar subqueries over ordinary tables were rejected when they used
GROUP BYorHAVING.Scope those two clause restrictions to the owning recursive query block using the existing ownership check. Anchor grouping and independent scalar grouping/aggregation work, while direct recursive
GROUP BY/aggregation and nested recursive-table scans remain rejected. This follows the selected MySQL compatibility scope: the original issue examples contain direct recursive aggregation, which MySQL also prohibits.Extend the existing planner and SQL regression fixtures to cover grouped projection/predicate subqueries, standalone
HAVING, correlation, nested queries, NULL/empty groups, prepared reuse, ordinary scalar cardinality errors, and preserved rejection boundaries. The change adds no allocation or execution mechanism.Validation
pkg/sql/plantests andgo vetpassed.Issue verification remains with the reporter after merge; this PR does not request automatic issue closure.