Skip to content

[Subtask]: Migrate remaining legacy UPDATE special cases or reject them explicitly #26342

Closed

Description

@XuPeng-SH

Parent issue

#26336

Problem

After FK, multi-target, and synchronous irregular-index routes move off the legacy planner, several smaller ErrUnsupportedDML branches still need an explicit disposition. Some are compatibility workloads; others are sentinels that currently reach buildTableUpdate only because UPDATE has a catch-all.

Known cases on current main include:

  • PK/UNIQUE-key updates on mo_pubs / mo_subs;
  • the isEnumOrSetPlanType && AutoIncr branch, whose legal-schema reachability is unclear;
  • writable external-table UPDATE, whose tested contract is rejection (cannot insert/update/delete from external table), not file rewrite;
  • unsupported table expression/type and empty table-name sentinels;
  • any other propagated/unknown ErrUnsupportedDML;
  • Iceberg row-level UPDATE, which already has a named specialized planner and must stay outside the legacy bucket.

Required work

For each route, provide code-search evidence and an executable SQL/plan reproduction, then choose exactly one disposition:

  1. implement with modern MULTI_UPDATE;
  2. route to a named specialized planner; or
  3. return a stable user-facing error before locks or mutations.

Specific expectations:

  • Preserve pub/sub catalog invariants and authorization behavior.
  • Prove the legal reachability of the ENUM/SET + AutoIncr branch; if DDL rules make it unreachable, remove the dead branch and retain a negative schema test.
  • Return the existing writable-external UPDATE rejection directly, without detouring through buildTableUpdate.
  • Convert malformed/unsupported table forms to deliberate errors, not compatibility fallbacks.
  • Preserve the explicit Iceberg dispatch.

Acceptance criteria

  • Every remaining route from [Subtask]: Inventory and instrument legacy UPDATE planner fallbacks #26337 has one documented owner and disposition.
  • Every disposition has an executable plan/SQL test; code search alone is not considered proof of runtime reachability.
  • Supported cases use MULTI_UPDATE or a named specialized planner.
  • Unsupported cases fail before locks/mutations with stable errors.
  • Pub/sub behavior preserves catalog invariants and authorization rules.
  • The auto-increment/default branch is either reproduced with legal SQL and migrated or proven dead and removed.
  • Writable external UPDATE directly preserves the existing rejection contract.
  • Unsupported table forms and unknown ErrUnsupportedDML values cannot call buildTableUpdate.
  • Iceberg remains explicitly dispatched and is not counted as legacy UPDATE.
  • No catch-all fallback dependency remains for these cases.

Dependencies

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