Skip to content

fix: honor UPDATE IGNORE on duplicate keys - #25706

Merged
XuPeng-SH merged 8 commits into
matrixorigin:mainfrom
aptend:fix/25347-update-ignore
Jul 14, 2026
Merged

XuPeng-SH merged 8 commits into
matrixorigin:mainfrom
aptend:fix/25347-update-ignore

Conversation

@aptend

@aptend aptend commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve the IGNORE modifier in the UPDATE AST and formatter
  • use the existing dedup Node_IGNORE action for primary-key and unique-key conflicts
  • filter conflicting rows before MULTI_UPDATE, keeping their original data unchanged
  • add parser and planner regression coverage

SHOW WARNINGS emission is unchanged; this PR fixes the reported skip-without-error behavior.

Validation

  • go test -count=1 ./pkg/sql/parsers/dialect/mysql
  • go test -count=1 -run ^TestUpdateIgnoreUsesIgnoreDedupAction$ ./pkg/sql/plan
  • go vet ./pkg/sql/parsers/dialect/mysql ./pkg/sql/plan
  • make build
  • reproduced [Bug]: UPDATE IGNORE still errors on duplicate unique-key updates #25347 against the rebuilt local server: the conflicting row is skipped, ROW_COUNT() is 0, and the row remains unchanged

Fixes #25347

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed the latest head d242c9e.

The previous blocker is fixed: UPDATE IGNORE now propagates the old-row identity, excludes its own old-key match, preserves an existing key owner independent of input order, and rebuilds the survivor/group mappings after filtering. I also checked multi-unique-key interactions, nullable unique keys, shuffle and join orientation, cleanup, and bounded-memory behavior.

Local validation passed:

  • focused hashbuild and dedupjoin regressions repeated 20x
  • planner regressions repeated 10x and parser package repeated 5x
  • full relevant package tests
  • focused race tests repeated 5x
  • go vet on all relevant packages

The current CI is green. I found no remaining correctness, performance, or unhappy-path merge blocker.

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: UPDATE IGNORE still errors on duplicate unique-key updates

3 participants