Skip to content

[Subtask]: Move multi-target UPDATE semantics to MULTI_UPDATE #26340

Closed

Description

@XuPeng-SH

Parent issue

#26336

Problem

The modern binder already handles a joined UPDATE or PostgreSQL-style UPDATE ... FROM when only one target table is assigned. It uses Rowid-based row_number() deduplication to choose one whole source row.

The remaining fallback is specifically len(usedTbl) > 1: one statement assigns columns in more than one physical target table. This task must extend the existing modern invariants per target, not re-migrate single-target UPDATE ... FROM.

Required work

Acceptance criteria

  • Statements assigning columns in two or more target tables produce one modern plan with the expected target contexts.
  • A physical row is updated at most once per target, even with duplicate source matches.
  • Values for multiple SET expressions come from one selected source row, never a per-column mix.
  • LEFT/RIGHT join NULL-side rows are filtered by the corresponding target Rowid and are never inserted or updated accidentally.
  • Updating only one target in a multi-table source remains on the existing modern path.
  • Generated-column chains and ON UPDATE expressions use each target's final row image.
  • Base and hidden-index writes are atomic across all updated targets.
  • Lock order is deterministic and covered by concurrent conflict/retry tests.
  • Affected-row and IGNORE behavior match existing compatibility cases.
  • Existing single-target UPDATE ... FROM plan tests remain unchanged or are strengthened, not moved to legacy-specific expectations.

Test matrix

Dependencies

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

Metadata

Metadata

Assignees

Labels

area/optimizerkind/subtaskseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions