Skip to content

[Subtask]: Inventory and instrument legacy UPDATE planner fallbacks #26337

Closed

Description

@XuPeng-SH

Parent issue

#26336

Problem

bindAndOptimizeUpdateQuery currently treats almost every ErrUnsupportedDML returned by bindUpdate as permission to call buildTableUpdate; only the Iceberg message is dispatched separately. Free-form errors from deeper binder calls can therefore expand the legacy surface accidentally.

Directly verified route sources on current main include:

  • more than one updated target table;
  • any target with Fkeys or RefChildTbls (the UPDATE resolver currently ignores foreign_key_checks for routing);
  • affected irregular-index columns or PK updates on an irregular-index table;
  • PK/UNIQUE updates on mo_pubs / mo_subs;
  • the ENUM/SET + AutoIncr compatibility branch, whose legal-schema reachability must be proven;
  • writable external-table, unsupported-table-form, and empty-table-name sentinels, which are not necessarily supported legacy workloads;
  • any propagated ErrUnsupportedDML not declared at the UPDATE entry point.

Before migration, planner selection must become an explicit, measurable decision rather than an error-text side effect.

Required work

  • Build a call-graph-backed inventory of every ErrUnsupportedDML that can escape bindUpdate, including errors propagated by shared bind helpers.
  • Give every intended temporary legacy route a stable machine-readable reason.
  • Classify non-legacy outcomes separately: named specialized planner, deliberate rejection, and unexpected binder error.
  • During migration, allow legacy routing only for an explicit allowlist of classified reasons; an unknown reason must not silently call buildTableUpdate.
  • Emit counters and structured log fields for selected planner and route reason without SQL text, literals, or sensitive values.
  • Add executable plan fixtures for every classified outcome.
  • Define the regression/soak window and evidence required by [Subtask]: Cut over to MULTI_UPDATE and remove the legacy UPDATE planner #26343.

Acceptance criteria

  • Every call from bindAndOptimizeUpdateQuery to buildTableUpdate is selected by a typed/structured reason, never by matching arbitrary error text.
  • Iceberg remains a named specialized route rather than a legacy-fallback reason.
  • Writable external UPDATE and invalid table forms are classified as rejection/error routes unless a test proves intentional supported behavior.
  • The ENUM/SET + AutoIncr branch has a legal SQL reproduction or is recorded as unreachable/dead.
  • Unknown ErrUnsupportedDML values are visible and cannot expand the legacy allowlist.
  • Metrics/logs identify the route without exposing SQL or values.
  • Unit/plan tests assert every known classification and the unknown-reason guard.
  • Known supported legacy behavior is unchanged by this instrumentation step.
  • A documented query/dashboard or equivalent procedure can demonstrate zero legacy UPDATE use.

Dependencies

Related

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions