Repository navigation
[4.2-dev] Fix repeated-target UPDATE and UNIQUE arbitration - #32883
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? |
|
This pull request is merged. |
|
mo-bot review · Commit: {"message": "This content was flagged for possible cybersecurity risk. If this seems wrong, try rephrasing your request. If you\u2019re doing authorized security work that requires more cyber permissive safeguards, apply for Daybreak access via https://platform.openai.com/settings/organization/status-and-access before retrying.", "codexErrorInfo": "cyberPolicy", "additionalDetails": null, "misalignment": null} |
|
mo-bot review · Commit: New discussion was assessed; the previous review remains unchanged. |
|
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: b472a1e4bb1b78f987400e8a85799f10bd108c9b
Assessment: request_changes
The new repeated-target plan can leave uploaded objects untracked after an aborted write. Its single-row writer and per-key arbitration otherwise fit the problem. The partition safety guard rejects the previously reported unsafe routes; two sampled partition cases also panicked on the assigned base, so they do not establish a new regression.
Model: gpt-6.1-terra / max
Session: 01a20d4a-e012-78c2-a9c3-fb5e273c4075 · slot 1 · generation 4
- P2
pkg/sql/plan/repeated_update_plan.go:106: A large repeated-target UPDATE uses the legacy S3 insert writer, flushes object metadata into the insert operator under memory pressure, and then fails or is cancelled before MergeBlock transfers that metadata to the transaction workspace.
Impact: The transaction rolls back, but the uploaded objects remain without a workspace record. Repeated failed attempts can accumulate orphaned storage.
Evidence: This call reaches the legacy insert plan in pkg/sql/plan/build_dml_util.go:390; pkg/sql/compile/compile.go:5676 can select its S3 branch. SyncAndFillBlockInfoBat removes object stats from the sinker before Insert buffers them, while Insert.Reset only closes the writer and clears that buffer. The diagnostic TestReviewInsertFailureOwnershipAfterMetadataExtraction reproduced the retained object after Reset; its unextracted-staging control removed the object. See focused-tests.log and checks/1795541496697340440-3.json. Keep ownership of extracted objects until workspace handoff and clean up only those not transferred on failure, cancellation and retry, or land the shared writer fix before enabling this path.
Validation:
-
Private /tmp and loopback preflight passed; 170 native inputs were verified before recovering the matching build.
-
Focused executor, planner and compiler tests passed. The insert ownership probe confirmed the leak and its staged-cleanup control passed.
-
The public repeated-update SQL suite, two-CN contention tests and lock-refresh tests passed without race instrumentation.
-
Role expansion, forced group spill and the changed Datalink source-admission integration test passed.
-
Two assigned-base overlay controls failed with the pre-existing PartitionInsert panic. Their failed status and logs were retained; they are not candidate test failures.
-
Diff whitespace, generated-plan audit, receipt correlation and final clean-source checks passed.
Limitations:
-
The ownership reproduction used an insert-operator probe with an in-memory file service; end-to-end SQL failure, cancellation and retry against real S3 were not independently tested.
-
Race and production-scale performance checks were not independently repeated. Relevant exact-head CI jobs were still in progress in the supplied snapshot.
|
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: 32f0b50a28f213bfc58a227235197331b1e8cdc1
Assessment: request_changes
The per-role grouping and unique-key arbiter fit the repeated-target update contract and reuse the existing writers. The previously reported object-storage ownership defect remains reachable through the new plan.
Model: gpt-6.1-terra / max
Session: 01a20de6-4798-7d33-92a8-6fabbca9bb9d · slot 3 · generation 1
- P2
pkg/sql/plan/repeated_update_plan.go:106: A large repeated-target UPDATE selects the S3 insert writer, flushes under memory pressure, and then fails or is cancelled before the extracted object metadata reaches the transaction workspace.
Impact: The statement rolls back, but uploaded objects can remain untracked and accumulate after repeated failures or retries.
Evidence: The call reaches the shared INSERT path, whose S3 branch is selected in pkg/sql/compile/compile.go:5676. SyncAndFillBlockInfoBat takes the persisted stats from the sinker; Insert.Reset then closes the writer and clears its buffer without deleting objects that the workspace has not adopted. The prior review at b472a1e reports a fault-injected operator reproduction and an unextracted-staging cleanup control; production code is unchanged at this head. Retain cleanup ownership until workspace adoption and clean up untransferred objects on failure, cancellation, and retry, or land the shared writer fix before enabling this path.
Validation:
-
Private /tmp and loopback preflight passed; receipt checks/1795545981729432359-2.json and preflight.log.
-
The frozen base-to-head diff passed git diff --check; receipt checks/1795545981227711010-2.json and diff-check.log.
-
The current head differs from the prior reviewed b472a1e revision only in two foreign-key BVT fixture files; the source checkout was clean. Receipts checks/1795546466271463489-2.json and checks/1795546466285580729-2.json.
-
The discussion assessment covers all 23 indexed keys exactly once; discussion-assessment.json and discussion-check.log.
-
The author reports refreshed SQL, concurrency, BVT, and race checks; the preceding review reports focused executor and public SQL checks. These reported runs were not independently repeated.
Limitations:
-
The frozen CI snapshot has a successful shared build, while several relevant test jobs remain in progress.
-
The earlier ownership reproduction used an in-memory file service; an end-to-end failure or cancellation against real S3 was not independently exercised.
-
A MySQL control for an explicit timestamp assignment combined with automatic ON UPDATE across two aliases timed out before producing a result; that comparison remains inconclusive. Receipt checks/1795546355973030219-2.json and mysql-on-update-control.log.
iamlinjunhong
left a comment
There was a problem hiding this comment.
Review of 32f0b50a28f213bfc58a227235197331b1e8cdc1
pkg/sql/plan/repeated_update_plan.go:106[P2] Keep cleanup ownership until the transaction workspace adopts uploaded objects. A large repeated-target UPDATE can select the legacy S3 INSERT path atpkg/sql/compile/compile.go:5677. On a memory-pressure flush,pkg/sql/colexec/insert/insert.go:502takes the uploaded object stats out of the sinker and buffers them locally. If a later batch fails or the pipeline is cancelled beforeMergeBlockwrites those stats to the workspace,Insert.Resetcloses the sinker and clears the buffer. The statement rolls back, but the uploaded objects remain in shared storage and can accumulate across retries. The shared writer fix should retain cleanup ownership through workspace adoption. The PR description acknowledges the issue and records the shared 4.2 writer fix as a merge dependency. The earlier operator fault-injection review reproduced object retention after cleanup. Exact-head assessment
The exact-head CI snapshot contains 33 completed checks. 15 succeeded, 16 were skipped, and 2 were neutral. The required CI check succeeded. CI Required
git diff --check and the read-only PR artifact check passed. This is my first review, so there was no prior review from me to follow up. I skipped local test execution because the exact-head source trace and the existing operator probe establish the finding. End-to-end failure, cancellation, and retry on S3 remain unverified in this review.
| // Checked FK key transitions were rejected by the safety boundary. | ||
| up.skipForeignKeyChecks = true | ||
| // The final assignment map already includes every role's changes. | ||
| if err = buildUpdatePlans(ctx, builder, NewBindContext(builder, nil), up, false, false); err != nil { |
There was a problem hiding this comment.
[P2] Keep cleanup ownership until the transaction workspace adopts uploaded objects. A large repeated-target UPDATE can select the legacy S3 INSERT path at pkg/sql/compile/compile.go:5677. On a memory-pressure flush, pkg/sql/colexec/insert/insert.go:502 takes the uploaded object stats out of the sinker and buffers them locally. If a later batch fails or the pipeline is cancelled before MergeBlock writes those stats to the workspace, Insert.Reset closes the sinker and clears the buffer. The statement rolls back, but the uploaded objects remain in shared storage and can accumulate across retries. The shared writer fix should retain cleanup ownership through workspace adoption.
|
mo-bot review · Commit: New discussion was assessed; the previous review remains unchanged. |
|
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: c88edf2253e38cbc1aa3e20cb0e551c81eeccc9b
Assessment: request_changes
The repeated-target plan reuses the existing write path, and the new local object registry addresses the previously reported orphaning scenario in the source trace. The added lifecycle and worker have a concrete purpose, but the writer-to-workspace ownership transition lacks a maintained regression for that failure.
Model: gpt-6.1-terra / max
Session: 01a20f45-e8c1-71d1-b4be-5d82b90b9189 · slot 0 · generation 11
- P2
pkg/sql/compile/compile.go:5769: A coordinator-local S3 INSERT uploads an object and then fails or is cancelled after its metadata leaves the sinker but before the workspace accepts it.
Impact: This previously reproduced path can leave orphaned files if the new reservation wiring or handoff regresses. The current implementation appears to retain ownership, but the checked-in tests would not detect a break in that integration.
Evidence: pkg/sql/colexec/local_insert_objects_test.go:58 calls Reserve and Adopt directly. The existing post-Sync failure fixture at pkg/sql/colexec/insert/insert_test.go:451 uses no local object owner and does not assert file cleanup. The repository testing contract requires preserving a practical reproduction of the bug. Add a focused maintained test using the actual writer and workspace handoff, or equivalent small integration tests, that verifies deletion of an uploaded but unadopted object after failure and preservation of an adopted object. The existing append-error fixture provides a failure seam.
Validation:
-
Isolation preflight passed. Native prerequisites were built from the frozen checkout, and the 170-input provenance ledger passed; receipts and logs are mapped in review-validation.md.
-
The combined focused race command returned exit 1 overall, but its log records individual passes for the selected colexec, aggexec, group, updateunique and compile packages. The three selected SQL issue tests failed during embedded-cluster startup with HAKeeper connection-ID timeouts and driver connection errors, before their SQL assertions. See focused-race-retry.log and checks/1795577756739298397-3.json.
-
A prior review reports passing public repeated-update SQL and contention tests on the earlier planner revision. The current source retains that planner, but adds the local object handoff and shared scope changes afterward.
-
Diff whitespace and clean-source checks passed. discussion-assessment.json accounts for all 28 indexed discussion keys exactly once.
Limitations:
-
The isolated SQL retry timed out without a test result. The planner retry, diagnostic INSERT ownership probe and selected-package rerun also timed out without test output; none is counted as a pass.
-
The PR body reports a 160,000-row fault-injection, cancellation and retry exercise, but the supplied local validation evidence contains no retained log or receipt for it. Relevant CI jobs were still in progress in the supplied snapshot.
|
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: b6e05c4f16c54bc7b2bfaa8c65ec4aec0713487a
Assessment: request_changes
The repeated-target UPDATE behavior lacks the repository-required mo-tester regression. The single-writer plan reuses the existing write and index paths, and the bounded object registry addresses a concrete upload-to-workspace ownership gap. The new object-handoff test addresses the prior review concern.
Model: gpt-6.1-terra / max
Session: 01a21244-6c6c-7240-bf19-37c0cdedc87d · slot 1 · generation 15
- P2
pkg/sql/plan/repeated_update_plan.go:97: A repeated-target UPDATE or UPDATE IGNORE encounters a unique-key conflict.
Impact: The required mo-tester BVT does not exercise the new arbitration and rollback behavior, leaving that release-test path without a regression for the issue this change addresses.
Evidence: The target branch's testing-contract.md sections 1 and 4 require public SQL behavior to have BVT coverage under test/distributed/cases using mo-tester. The PR's changed BVT covers the foreign-key rejection boundary; the conflict and IGNORE cases are in pkg/tests/issues/issue_31824_test.go. The existing update_ignore.test covers single-target updates. Extend a suitable UPDATE BVT with a small repeated-target conflict case for ordinary UPDATE and IGNORE, including base-row and index-result assertions.
Validation:
-
Isolation preflight passed: preflight.log and checks/1795624034935457427-2.json.
-
The maintained TestIssue31824RepeatedUpdate passed all 42 subtests through the isolated embedded SQL frontend: maintained-sql.log and checks/1795627444375796220-2.json. The selected test ran with a diagnostic overlay present.
-
TestLocalS3InsertObjectOwnership and its three subtests passed, but the combined command timed out while linking the other package: focused-tests-retry.log and checks/1795625883634163006-2.json.
-
Native inputs matched the retained build, and git diff --check passed: native-input-check.log and diff-check.log, with receipts checks/1795624094700863781-2.json and checks/1795625825192481287-2.json.
-
All 30 discussion keys are accounted for in discussion-assessment.json; coverage was checked in discussion-check.log and checks/1795625932035567164-2.json.
Limitations:
-
No independent current-head multi-CN or race run completed. The focused ledger probe timed out before executing tests.
-
A reviewer-written signed-zero SQL assertion failed, but the frozen baseline BVT explicitly permits both signed-zero encodings in the same composite unique index on INSERT. That probe alone is therefore not treated as a PR regression; the separate ENUM backfill test has a different oracle. The probe log and receipt are signed-zero-probe-final.log and checks/1795626723835507515-2.json.
|
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: cf129e1c94af03cc4b33124e470f8a2527f7c4a5
Assessment: request_changes
A literal NULL in an alias that should lose UNIQUE arbitration can abort UPDATE IGNORE before a valid sibling update is applied. The design otherwise reuses the existing writers and index lookups; the bounded object registry addresses the prior local upload-to-workspace ownership concern, and the requested conflict BVT is present.
Model: gpt-6.1-terra / max
Session: 01a21456-006d-7b41-b150-908a3e9d9152 · slot 3 · generation 6
- P2
pkg/sql/plan/repeated_update_roles.go:128: For t(id PRIMARY KEY, k UNIQUE, v NOT NULL) containing (1,10,10) and (2,20,20), run UPDATE IGNORE t x JOIN t y ON x.id=1 AND y.id=1 SET x.k=20, x.v=NULL, y.v=30.
Impact: The planner rejects the statement with a NOT NULL error, so the valid y.v update is lost even though x's entire contribution should be skipped because k=20 belongs to row 2.
Evidence: bindRepeatedAssignment calls checkNotNull before UNIQUE admission, and checkNotNull immediately rejects a literal NULL. The later UpdateUnique operator validates NOT NULL only for accepted rows. The existing accepted-row test at pkg/tests/issues/issue_31824_test.go:623 demonstrates the intended result with an equivalent runtime NULL. Defer the literal check for UPDATE IGNORE until admission while retaining validation for accepted contributions, and cover both forms.
Validation:
-
Private-runtime preflight, native build and input provenance passed. The frozen patch matched the checkout except for the patch file's final newline; source and discussion coverage checks passed. Receipts and logs are mapped in review-validation.md.
-
The focused Go command exited 1 overall. Selected tests passed in updateunique, insert, aggexec, group, table_function, colexec and plan; the compile selection ran zero tests. Receipt: checks/1795665509941766860-5.json.
-
The three embedded SQL test roots failed before their SQL assertions because the frontend could not obtain HAKeeper connection IDs. The literal-NULL finding is based on source tracing and the existing accepted-row test.
Limitations:
-
The reviewer-written public SQL and planner probes were interrupted during compilation and produced no test result or check-run receipt.
-
The PR author reports two 45/45 mo-tester comparisons and additional race and fault-injection checks; matching retained logs were not supplied for independent verification. Relevant frozen CI checks were pending.
Let accepted repeated-target roles use the existing NOT NULL check. Cover literal and runtime NULL, surviving sibling writes, and the index result in SQL and BVT. Seed the INSERT cleanup queue directly in the timeout test to make the order independent of the background worker.
|
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: be7b0c510c6295f705dd677ad2aa3a188c92d852
Assessment: approve
The prior literal-NULL finding is resolved: rejected UNIQUE candidates no longer trigger the early NOT NULL check, while admitted candidates remain validated. The repeated-target plan reuses the existing writers and index paths; its coordinator-owned arbitration and local object registry address the required ownership and conflict decisions. Previously reported unsafe partition and checked foreign-key transitions are explicitly rejected.
Model: gpt-6.1-terra / max
Session: 01a21456-006d-7b41-b150-908a3e9d9152 · slot 3 · generation 6
Validation:
-
The private-runtime preflight passed. The exact-head public SQL test for accepted and rejected literal and computed NULL assignments passed using test-exec; see literal-null-test.log and checks/1795687138236722033-5.json.
-
The frozen diff passed whitespace checks, the checkout was clean, the supplied patch matched the frozen diff apart from its final newline, and all 34 discussion entries were assessed. Receipts and logs are mapped in review-validation.md.
-
Earlier retained evidence records passing selected admission, spill, ownership-handoff and planner tests on the preceding head. That combined command failed overall because its embedded SQL tests failed during HAKeeper startup; those SQL attempts are not counted as passes.
Limitations:
-
The author reports broader current-rebase race, multi-CN and mo-tester runs, but matching logs and receipts were not supplied for independent verification. Relevant unit and BVT CI jobs were pending in the frozen snapshot.
-
This review did not independently run full mo-tester, multi-CN or race validation, remote S3 placement, or production-scale performance tests.
iamlinjunhong
left a comment
There was a problem hiding this comment.
Reviewed be7b0c510c6295f705dd677ad2aa3a188c92d852 against 4.2-dev at bf72bfbc376186521e5e20f74ddfa8bf99b2c404. The published acceptance criteria include skipping conflicting candidates under repeated-target UPDATE IGNORE while preserving valid sibling writes. Issue #31824 and the 4.2-dev IGNORE case
- [P1] Keep a separate scan schema for primary-key arbitration. At
pkg/sql/plan/repeated_update_ignore.go:85, the lookup scan shares the update writer's mutableTableDefand projects the old RowID position. With an optimistic CN andprimary-key-check = false, createt(id INT PRIMARY KEY, v INT)with rows(1,10),(2,20)and runUPDATE IGNORE t x JOIN t y ON x.id=1 AND y.id=1 SET x.id=2, y.v=30. The lookup reads row 2.buildUpdatePlansremoves the hidden RowID from the shared definition atpkg/sql/plan/build_dml_util.go:332, and the disabled CN primary-key check skips the code that would reappend it atpkg/sql/plan/build_constraint_util.go:2435. The scan then reads onlyid,vand its projection indexes the missing third vector. The statement fails during execution instead of retaining id 1 and updating its payload to 30. Give the lookup its own table definition with a stable projection and cover the existing primary-key conflict case with CN primary-key checking disabled.
The prior S3 ownership finding is resolved for the coordinator-local writer. The writer reserves object IDs before upload, MergeBlock releases reservations after workspace adoption, and scope teardown queues the remaining objects after joining the writers. The author explains this change and the handoff tests in the PR description. The frozen conversation and inline thread contain no direct author reply to the prior review. Prior inline finding
The exact-head CI snapshot contains 33 completed checks. 15 succeeded, 16 were skipped, and 2 were neutral. The required check succeeded, and the optimistic-mode standalone BVT was skipped. CI Required · Optimistic-mode BVT
git diff --check and the read-only PR artifact check passed. I skipped local test execution because the configuration-dependent scan and projection mismatch is established by the current-head source trace. The optimistic-mode SQL case was verified by source inspection.
| for i, col := range table.Cols { | ||
| scanProject[i] = &planpb.Expr{Typ: col.Typ, Expr: &planpb.Expr_Col{Col: &planpb.ColRef{ColPos: int32(i), Name: col.Name}}} | ||
| } | ||
| scan := &planpb.Node{NodeType: planpb.Node_TABLE_SCAN, Stats: &planpb.Stats{}, ObjRef: target.objRef, TableDef: table, ProjectList: scanProject} |
There was a problem hiding this comment.
[P1] Give the primary-key lookup its own scan schema. On an optimistic CN with primary-key-check = false, take t(id INT PRIMARY KEY, v INT) with rows (1,10),(2,20) and run UPDATE IGNORE t x JOIN t y ON x.id=1 AND y.id=1 SET x.id=2, y.v=30. The lookup reads row 2, but buildUpdatePlans removes RowID from this shared TableDef, and the disabled CN check skips the code that would reappend it. The scan projection then indexes a missing vector and the statement fails before applying y.v=30. Clone the scan definition before the writer changes it and cover this configuration in the primary-key conflict test.
|
mo-bot review · Commit: Review belongs to an older commit; it is not a review of the current head. |
|
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: c22d5146cbbbbe6e0d21883a5d503740b6c38dd2
Assessment: approve
No actionable defects remain. The design reuses the existing table and index writers while adding coordinator-owned conflict arbitration and a bounded registry for local object handoff. The prior primary-key lookup schema issue is fixed. Partitioned targets and checked foreign-key key changes remain intentionally unsupported by the repeated-target path.
Model: gpt-6.1-terra / max
Session: 01a2172e-434d-7533-8bcf-86e4c749a300 · slot 1 · generation 20
Validation:
-
Private-runtime preflight, frozen-source audit, native input provenance, and generated plan descriptor checks passed. Receipts and logs are mapped in review-validation.md.
-
Focused repeated-update SQL, primary-key checking enabled and disabled, admission, spill, compiler, role expansion, and local object ownership tests passed. See focused-tests.log and closure-tests.log.
-
Selected local object lifecycle, writer handoff, and two-CN conflict tests passed under the race detector. See race-tests.log.
-
The changed asynchronous Datalink integration case passed through the embedded SQL entry point. See datalink-test.log.
-
All 39 discussion keys are reconciled in discussion-assessment.json.
Limitations:
-
Unit and BVT CI jobs were pending or skipped in the supplied snapshot. The author's reported standalone mo-tester and additional stress results were not independently verified from retained logs.
-
Remote S3 handoff and cleanup after process crashes or outages beyond shutdown were outside the locally validated cleanup scope. Production-scale performance was not independently measured.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #31824 on 4.2-dev and the coordinator-local INSERT path in #29257.
What this PR does / why we need it:
A multi-table UPDATE can write the same physical table through multiple aliases and panic on 4.2-dev. The planner now builds a candidate per writable alias and combines accepted changes into one write per physical row. Ordinary UPDATE preserves duplicate-key rollback. UPDATE IGNORE checks each alias's complete candidate against its affected unique keys, then keeps the other valid changes. Generated-column DEFAULT normalization runs before counting writable aliases.
The repeated-target planner rejects unsupported writes before execution, including partitioned targets, changes to auto-increment columns, and changes to foreign-key columns while checks are enabled. It also rejects primary-key changes that affect synchronous full-text/vector indexes and top-level aggregates.
Large repeated UPDATE statements can use the existing coordinator-local S3 INSERT writer. The writer reserves each object ID before upload, and MergeBlock releases the reservation after the transaction workspace accepts it. After the writers finish, a CN-level worker reclaims unadopted objects and retries failed deletes. The worker starts when cleanup first marks an object pending, and the CN drains the queue during shutdown. The shared lifecycle fix lives in its own commit. The remote INSERT handoff and tombstone cleanup remain tracked under #29257. Review finding
Successful local S3 uploads add in-memory tracking per object. Cleanup I/O runs off the statement path. A CN caps outstanding reservations at 500,000 objects and returns a resource error if it reaches the cap. Pending cleanup is in memory and depends on the file service reporting delete errors. Process crashes and outages that outlast shutdown can leave objects for storage reclamation.
Validation
86a86738e55. The repeated-target UNIQUE lookup passes its base table definition to the updated index helper.TestLocalS3InsertObjectOwnershipexercises the actual INSERT and MergeBlock operators with a local shared file service. Workspace rejection and cancellation reclaim the uploaded object, and successful adoption preserves it. The two controls using the prior writer or omitting adoption fail at the corresponding file assertion.update_ignoremo-tester case now covers two writable aliases proposing one UNIQUE key. It checks atomic rollback on UPDATE and preserves only the accepted alias on UPDATE IGNORE, with both base-row and forced-index reads. The rebased standalone build passed two consecutive normal comparisons at 45/45 statements per run and left zero case tables. A MySQL client confirmed error 1062, and EXPLAIN confirmed the unique-index scan. The same case on v4.2.9 returned executor panics for both repeated-target UPDATE statements and failed the two result checks after UPDATE IGNORE. The clean target branch build was interrupted during local linking. ReviewNOT NULL validation after UNIQUE arbitration
Rebased onto
4.2-devatbf72bfbc. The generated plan descriptor contains both the repeated-update nodes and the target branch's exact-row lock field.Repeated-target
UPDATE IGNOREvalidatesNOT NULLthrough the existing accepted-role checks. A rejected UNIQUE candidate can no longer discard a valid sibling update merely because the rejected candidate contains a literalNULL. Review3819for the rejected alias. With the fix, the sibling write succeeded for both literal and computedNULL. AcceptedNULLassignments still failed and preserved the previous rows. All 42 repeated-update subtests, cross-CN UNIQUE arbitration, and lock refresh passed.update_ignore.test, including the rejected alias, the accepted invalid alias, and the forced-index read.