Repository navigation
Closed
Description
Parent issue
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
FkeysorRefChildTbls(the UPDATE resolver currently ignoresforeign_key_checksfor routing); - affected irregular-index columns or PK updates on an irregular-index table;
- PK/UNIQUE updates on
mo_pubs/mo_subs; - the
ENUM/SET + AutoIncrcompatibility 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
ErrUnsupportedDMLnot 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
ErrUnsupportedDMLthat can escapebindUpdate, 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
bindAndOptimizeUpdateQuerytobuildTableUpdateis 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 + AutoIncrbranch has a legal SQL reproduction or is recorded as unreachable/dead. - Unknown
ErrUnsupportedDMLvalues 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
- Parent: [Task]: Retire the legacy UPDATE planner and converge on MULTI_UPDATE #26336
- Blocks [Subtask]: Cut over to MULTI_UPDATE and remove the legacy UPDATE planner #26343 and supplies rollout evidence to [Subtask]: Move child-side foreign-key UPDATE validation to MULTI_UPDATE #26338–[Subtask]: Migrate remaining legacy UPDATE special cases or reject them explicitly #26342.
Related
- [Bug]: nullable index UPDATE keeps Rowid from filtered NULL row #26334 demonstrates why production reachability must be measured rather than inferred from schema rules.
Activity
refactor(plan): make UPDATE planner routing explicit (#26373)
refactor(plan): make UPDATE planner routing explicit (matrixorigin#26373
refactor(plan): make UPDATE planner routing explicit (matrixorigin#26373
refactor(plan): make UPDATE planner routing explicit (matrixorigin#26373