Repository navigation
fix(plan): reject recursive CTE anchor self-references - #32831
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? |
|
Queue requested — the merge queue status continues in this comment ↓. |
8ec92c3 to
a6e41bd
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-local · review
Commit: a6e41bd5698985730a7e470609d25c094663716e
Assessment: approve
The narrow guard reuses CTE declaration identity and existing binding state to reject anchor reentry while preserving lexical shadowing and valid recursion. No actionable findings remain.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
Validation:
-
Reviewed all five changed files, affected binding consumers, linked issue 32795 and all three discussion entries. Saved review-plan.md and discussion-assessment.json.
-
Reused frozen exact-head successful UT, SCA, coverage and both multi-CN BVT statuses; traced repository selectors to the planner package and recursive_cte fixtures.
-
git diff --check and gofmt -d passed with no output; receipts: checks/1794885944516644601-2.json and checks/1794885950717492757-2.json.
-
Corrected integrity audit passed: source clean, all five files match HEAD, frozen delta matches apart from its terminal newline, and discussion coverage is complete. Receipt: checks/1794886095601158606-2.json.
Limitations:
- No fresh local Go or server execution. Raw CI per-test logs and external reusable-workflow definitions were not supplied; historical author test counts were not treated as current-head results.
✅ Merged into
|
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #32795.
What this PR does / why we need it:
Reject a table reference that resolves to the exact recursive CTE declaration while its anchor is still being bound. This prevents repeated anchor binding from overflowing the planner stack. Same-name inner CTEs and aliases, schema-qualified real tables, legal recursive members, and existing recursive-member diagnostics retain their behavior.
Historical validation on upstream main
f491aaab4519b29313c5747d3ce3b3f84e865c71plus this change (the SQL service/BVT results below are not claimed as a new service run one765c5fd44e842167d4271c37af6d25586511e16):mo-cgo-test -mod=readonly -v -count=1 -timeout=300s -run '^TestRecursiveCteAnchorReentry$' ./pkg/sql/plan: 17/17 subtests passed, including typed errors, lexical controls and compiler-context reuse after rejection.mo-cgo-test -mod=readonly -v -count=1 -timeout=1500s ./pkg/sql/plan: 5045 top-level and 17949 direct subtests passed; exit 0.147a3f213653) and golangci-lint (2.14.0) incremental SCA: changed package/tests plus 111 affected reverse-dependent packages; exit 0, 0 issues. Exact selector/command below.nometaand 3/3 with strict metadata on the same instance. Both client processes and MO stop cleanly; implicit DB absence, the full TCP/TCP6/UDP/UDP6 window and removal of this run's owned data root were verified.Current validation on upstream main
e765c5fd44e842167d4271c37af6d25586511e16plus the unchanged five-file change (single linear commita6e41bd5698985730a7e470609d25c094663716e):0 issues.; exact command below..agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -v -count=1 -timeout=360s -short -tags matrixone_test -run '^TestPreparedTimeArithmeticOverMySQLProtocol$' ./pkg/embed: 19 RUN records, parent/package PASS, exit 0..agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -v -count=1 -timeout=360s -short -tags matrixone_test -run '^TestPreparedTimeArithmeticOverMySQLProtocol$' ./pkg/embed: 19 RUN, 19 PASS, 0 FAIL, 0 race warnings, exit 0.Limit: the original CI failure was a deferred
DROP DATABASEtimeout accompanied by log-service checker/heartbeat/propose timeouts. It was not reproduced by either standalone target. This rebase-only phase made no product/test-code change and does not claim an infrastructure diagnosis or complete parallel CI recovery.Current e765 incremental SCA command (explicit 111-package selector)