Skip to content

fix: evaluate single-table UPDATE assignments left to right - #27337

Merged
XuPeng-SH merged 7 commits into
matrixorigin:mainfrom
Lundomn:agent/fix-update-assignment-order
Aug 21, 2026
Merged

XuPeng-SH merged 7 commits into
matrixorigin:mainfrom
Lundomn:agent/fix-update-assignment-order

Conversation

@Lundomn

@Lundomn Lundomn commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #27336

What this PR does / why we need it:

Fixes single-table UPDATE assignment evaluation so SET expressions are evaluated from left to right, matching MySQL compatibility semantics. Later assignments now read values produced by earlier assignments in the same statement.

The change preserves SET-clause order during planning and uses sequential projections for standard single-table UPDATE statements. Multi-target UPDATE and UPDATE ... FROM keep their existing simultaneous-assignment behavior.

Adds end-to-end regression coverage for chained and swap assignments, prepared execution, transactions, and volatile expressions. It also updates affected BVT expected results to the corrected semantics.

@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 exact head cbec91d1825977e314bcbb265a9f043e69a6bbcf.

The remaining ENUM/SET projection-representation blocker is fixed: each sequential binding now inherits the actual type emitted by the preceding projection instead of redeclaring carried display vectors with catalog storage types. Assigned columns still carry the canonical cast result into the next generation, so carried and newly assigned special values remain consistent.

The full embedded left-to-right UPDATE regression (including carried and reassigned ENUM/SET values) passed, as did focused planner assignment tests under -race -count=10. The earlier repeated-target, subquery/qualifier, numeric-target, and plan-size fixes remain intact. No blocking issue remains.

@Lundomn
Lundomn requested a review from aptend August 21, 2026 06:41

@aptend aptend 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 complete diff and the increments after my previous review on exact head cbec91d1825977e314bcbb265a9f043e69a6bbcf.

The earlier blockers are closed in the implementation, not only in the reported scenarios: assignment occurrences remain ordered (including repeated targets), each RHS binds against the preceding projected row image with normal qualifier/subquery semantics and target numeric context, old values remain distinct for maintenance, and the projection-growth guard bounds the wide-table case. The latest type-provenance change also keeps carried ENUM/SET display vectors and newly assigned storage values consistent across generations.

Focused exact-head planner validation passed for the projection bound and the full prepared numeric-target matrix; go build, go vet, and git diff --check also passed for the owning package/diff. Current required CI checks are green. No blocking issue found.

@mergify mergify Bot added the queued label Aug 21, 2026
@mergify

mergify Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-08-21 09:09 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-08-21 12:12 UTC · at 839b97f388f76378a024d31266b821c93bd24db5

This pull request spent 3 hours 3 minutes 4 seconds in the queue, with no time running CI.

Waiting for
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64
    • check-success = Matrixone CI / SCA Test on Linux/arm64
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
    • check-success = Matrixone Utils CI / Coverage
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-skipped = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-success = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-success = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
All conditions
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64
    • check-success = Matrixone CI / SCA Test on Linux/arm64
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
    • check-success = Matrixone Utils CI / Coverage
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-skipped = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-success = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-success = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]

Reason

Pull request #27337 has been dequeued

Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.

The author needs to enable "Allow edits from maintainers" on this pull request.

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

@XuPeng-SH
XuPeng-SH merged commit 71c9eb3 into matrixorigin:main Aug 21, 2026
3 of 5 checks passed
@mergify mergify Bot added dequeued and removed queued labels Aug 21, 2026
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…igin#27337)

## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#27336

## What this PR does / why we need it:

Fixes single-table UPDATE assignment evaluation so SET expressions are
evaluated from left to right, matching MySQL compatibility semantics.
Later assignments now read values produced by earlier assignments in the
same statement.

The change preserves SET-clause order during planning and uses
sequential projections for standard single-table UPDATE statements.
Multi-target UPDATE and UPDATE ... FROM keep their existing
simultaneous-assignment behavior.

Adds end-to-end regression coverage for chained and swap assignments,
prepared execution, transactions, and volatile expressions. It also
updates affected BVT expected results to the corrected semantics.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…igin#27337)

## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#27336

## What this PR does / why we need it:

Fixes single-table UPDATE assignment evaluation so SET expressions are
evaluated from left to right, matching MySQL compatibility semantics.
Later assignments now read values produced by earlier assignments in the
same statement.

The change preserves SET-clause order during planning and uses
sequential projections for standard single-table UPDATE statements.
Multi-target UPDATE and UPDATE ... FROM keep their existing
simultaneous-assignment behavior.

Adds end-to-end regression coverage for chained and swap assignments,
prepared execution, transactions, and volatile expressions. It also
updates affected BVT expected results to the corrected semantics.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

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

kind/bug Something isn't working size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants