Repository navigation
refactor(sql): consolidate UPDATE target ownership - #31798
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? |
|
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: 088d4c5b34e867507c825f47a0d38e8dd143fce7
Assessment: approve
The shared lookup preserves normalization, mapping semantics, and each caller’s database-selection rules. No actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a1869d-820c-7212-9788-aecfb86a4141 · slot 0 · generation 2
Validation:
-
Focused tests passed: 19 root tests, 101 total cases.
-
Frontend suite: 2,755 roots passed, one preexisting skip, and one read-only-filesystem failure. The failing export test subsequently passed from writable diagnostic storage using the frozen-source binary.
-
Source identity, cleanliness, patch, formatting, native provenance, and discussion coverage audits passed.
-
Commands, exit receipts, retained logs, and hashes are reconciled in attempt-1/validation-evidence.json.
Limitations:
-
The original full-suite command exited 1; its environment failure and successful targeted recovery are recorded separately.
-
CI was pending in the supplied snapshot. Author-reported BVT, race, SCA, and mutation results were not independently verified; those additional runs were unnecessary for this behavior-preserving extraction.
|
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: dcfb2654318fb7176fce927d082b3147b74b3bdb
Assessment: approve
The refactor preserves admission timing and FK target ownership, and correctly validates generated-column assignments before deduplication. No actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a1869d-999c-7481-b340-ae4a63e8cee4 · slot 1 · generation 2
Validation:
-
84 focused top-level tests passed.
-
Planner suite: 4,457 top-level tests passed.
-
Frontend suite: 2,765 passed, one skipped, and one export test failed on the read-only checkout. That test subsequently passed from writable storage using the frozen-source binary.
-
Source identity, formatting, native provenance, discussion coverage, and receipt/log reconciliation passed. Evidence is retained in attempt-1/validation-evidence.json.
Limitations:
-
The original full-suite command remains exit 1; its environment failure and successful targeted recovery are recorded separately.
-
Author-reported BVT, race, SCA, and benchmark results were not independently verified. The supplied CI snapshot contains no results.
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Refs #29249 ## What this PR does / why we need it: The combination of #31795 and #31798 left a boolean return in a function that now returns `writeDisposition`, breaking the main build. Return `writePersistent` for an unresolved or derived DELETE source, preserving the existing fail-closed behavior. The same one-line correction is proposed in #31813; that PR's main CI is currently blocked by its preflight description check. Validation on darwin/arm64, Go 1.27.1, `GOEXPERIMENT=simd`: - Full `pkg/frontend` unit suite passed (`-count=1`). - Affected read-only classification tests passed with `-race -count=1`, including the existing derived-source case. - Configured incremental SCA for `./pkg/frontend` passed with 0 issues. GitHub CI is pending.
What type of PR is this?
Which issue(s) this PR fixes:
Refs #29249
What this PR does / why we need it:
UPDATE planning already resolves writable targets in the modern DML context, but self-referencing foreign-key detection previously ran a second legacy resolution after the plan was built. Reuse the existing context for those checks, in source-table order, and remove the obsolete UPDATE rebinding and unused legacy fields. Preserve the checks' existing position and foreign-key setting. Remove a DELETE projection branch whose only caller always selected the other path.
READ ONLY admission now uses one disposition for allowed, persistent, and deferred decisions. READ WRITE transactions avoid UPDATE ownership classification after their mode is stamped. For READ ONLY multi-table UPDATE, successful source-column lookups are reused within one admission check, while unresolved lookups remain retryable and per-assignment ambiguity is preserved. Existing pre- and post-transaction admission boundaries remain unchanged. Database remap consumers also share the existing pure lookup policy without adding state.
A later duplicate
SET generated_col = DEFAULTmust not hide an earlier invalid generated-column assignment when the nonsequential multi-table path deduplicates assignments. Validate the original occurrences while preserving sequential error order. This also rejects that invalid statement with foreign-key checks disabled; the previous modern path could accept it.The design records ownership and validation boundaries.
Validation
On darwin/arm64 with Go 1.27.1 and
GOEXPERIMENT=simd:pkg/sql/planandpkg/frontendunit suites passed: 4,457 and 2,766 top-level tests; 3 existing skips.-race -count=1.An independent gpt-6-astra/xhigh review of the complete merged diff found and verified closure of a generated-column regression; the final overall review reported no remaining code blocker. CI results for this new head are pending.