Repository navigation
fix(enum): resolve assignments in the destination domain on 4.2-dev - #32824
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
This pull request is merged. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: fed71ee74093cb1a65ad6d299304807b7b3f6c68
Assessment: request_changes
The persisted ENUM identity is integrated with the existing codec and planner owners, but recovery and public metadata consumers do not preserve it. The checkpoint issue raised in earlier reviews has reappeared; the earlier DUMP compatibility concern now manifests as silent schema-identity aliasing.
Model: gpt-6.1-terra / max
Session: 01a21a6a-5ce8-7ed3-a236-5a2545158ac9 · slot 2 · generation 7
-
P1
pkg/sql/plan/enum_collation.go:78: Restore a v4.2.9 DUMP whose original CREATE statement declared an ENUM with COLLATE utf8mb4_bin, or load a newly created binary ENUM dump into a legacy-identity column with the same members.
Impact: The schema compatibility check accepts columns with different assignment identities. After restoration, assigning 'a' to ENUM('A','a') can select ordinal 2 instead of ordinal 1, or vice versa, silently changing subsequent data.
Evidence: v4.2.9 accepted but ignored the ENUM collation. The DUMP fingerprint deliberately omits ColumnCharsetClause in pkg/sql/plan/build_show_util.go:198, and pkg/frontend/table_dump.go:1143 compares that fingerprint before loading. The candidate component probe enum-schemahash-probe.log confirms identical fingerprint inputs for legacy and binary identities while their lookups produce different ordinals. Preserve or safely distinguish the original identity during DUMP/LOAD, including released archives, and exercise a released backup and an incompatible fresh target through the restore path. -
P2
pkg/container/types/enum_collation.go:53: Export a checkpoint containing ENUM('A','a') COLLATE utf8mb4_bin using mo-tool ckp dump --load-script and replay the generated DDL.
Impact: The restored column has legacy identity 0 instead of binary identity 2, so subsequent assignment of 'a' selects 'A' at ordinal 1 rather than 'a' at ordinal 2.
Evidence: pkg/tools/checkpointtool/table_dump.go:3932 decodes the native type but retains only EnumEncoding; its TableColumn model, clone and renderer do not carry collation. cmd/mo-object-tool/ckp/checkpoint.go:1254 uses the reconstructed DDL. The serialized-type-to-DDL probe in enum-checkpoint-probe.log confirms that identity 2 renders without COLLATE. This is the previously reported checkpoint issue, reintroduced on the narrowed head. Carry the identity through checkpoint decoding and rendering, or reject an unfaithful replay. -
P2
pkg/sql/plan/build_show_util.go:1162: Inspect a newly created ENUM column with an explicit utf8mb4_bin or utf8mb4_general_ci collation through SHOW FULL COLUMNS or INFORMATION_SCHEMA.COLUMNS.
Impact: Both metadata interfaces report NULL for the column collation even though SHOW CREATE emits the persisted collation. Schema discovery and reconstruction tools cannot recover the column's assignment behavior from those interfaces.
Evidence: pkg/sql/plan/function/func_builtin.go:779 returns NULL for ENUM in internal_column_character_set; pkg/sql/plan/build_show.go:651 and pkg/util/sysview/predefined.go:201 use that function for their collation fields. Expose the stored ENUM identity through those metadata consumers and retain the legacy behavior for identity-zero columns.
Validation:
-
Isolation preflight and git diff --check passed.
-
Focused ENUM type lookup, vector wire admission, and planner identity tests passed. Their commands, source fingerprints, exits and logs are reconciled in validation-reconciliation.json.
-
Diagnostic overlay probes exercised the candidate schema-hash owner and checkpoint metadata-to-DDL owner; both confirmed the reported identity loss. These were component probes.
-
Verified published v4.2.9 and its resolved source commit 6c05e42. All 24 discussion keys are accounted for in discussion-assessment.json.
Limitations:
-
No live DUMP/LOAD, on-disk checkpoint replay, or end-to-end SQL metadata test was run during this review.
-
The PR reports released-binary upgrade, SQL and race checks, but local_validation contains no retained execution artifacts with which to independently reconcile those claims.
-
The first type-test attempt timed out during dependency setup and the first vector build lacked native headers; both tests passed after recovery using the assigned caches and source-matched native prerequisites.
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: d0b4102f83a3d6e0b8d019bc46f6fb316a818a7b
Assessment: request_changes
Fresh binary ENUM declarations retain trailing spaces in their members, causing assignments that should match to fail. The required released-catalog upgrade validation also remains unverified in the supplied evidence. The implementation otherwise reuses existing type, planner and upgrade owners; the latest DUMP/LOAD, checkpoint and metadata changes address the prior reported issues within the documented recovery scope.
Model: gpt-6.1-terra / max
Session: 01a21b4e-97c0-7bb3-abf0-653432a63ac1 · slot 0 · generation 21
-
P2
pkg/sql/plan/build_ddl.go:1399: Create a binary source ENUM('A','B') and a binary destination ENUM('B','A '), then insert the source value 'A' into the destination.
Impact: The assignment fails with “item A is not in enum [B A ]” instead of storing 'A' at destination ordinal 2. A numeric insert also exposes the retained trailing space in the freshly declared member.
Evidence: Linked issue #32886 requires trailing ASCII spaces to be trimmed from freshly declared labels. getCreateColumnType encodes the original labels before applying the collation, and ParseCollatedName trims only the input. Both the public MySQL overlay probe in enum-wire-overlay.log and the planner probe in enum-plan-probe.log reproduced the failure. Normalize newly authored labels before encoding, including reauthored ALTER columns, and handle resulting duplicates under the applicable collation while preserving inherited legacy padded members. -
P2
pkg/bootstrap/versions/v4_0_6/upgrade.go:37: Upgrade a released v4.2.9 catalog at 4.0.6 offset 5 to this candidate's offset 6.
Impact: The required released-data migration validation is unverified, leaving the tenant COLUMNS refresh and preservation of released ENUM data across this upgrade without reviewable execution evidence.
Evidence: The pinned upgrade-compatibility policy requires a real released artifact for a changed migration and applicable retry or recovery coverage. The PR body reports a v4.2.9 upgrade, but evidence.json.local_validation contains no matching commands, logs or exit receipts; the release image was not present locally. The passing offset-upgrade and version-owner tests use synthetic state, while the public SQL test starts a fresh catalog. Provide traceable evidence of the reported run, or perform a stopped v4.2.9-to-candidate upgrade covering an existing tenant, legacy ENUM reads and writes, the refreshed COLUMNS view, and a retried refresh.
Validation:
-
Isolation preflight passed; the diagnostic native build matched 170 frozen source inputs.
-
Focused ENUM lookup and overflow tests passed: enum-types.log, checks/1795758984525996745-2.json.
-
Selected planner, vector, checkpoint, migration-owner and restore-script tests passed: owner-checks.log, checks/1795759137099219301-2.json; offset-upgrade.log, checks/1795759288077164010-2.json.
-
The public MySQL regression test passed its existing controls and its diagnostic counterexample asserted the padded-member failure: enum-wire-overlay.log, checks/1795759165065551624-2.json. A separate planner probe reproduced the same behavior.
-
git diff --check passed. Receipt, log and discussion coverage reconciliation passed; source remained unchanged.
Limitations:
-
The author-reported released-binary upgrade and recovery checks could not be reconciled with retained execution artifacts in the supplied evidence.
-
Full CI, race testing, the 4.2-to-main upgrade bridge and typed ENUM data restoration were not independently exercised.
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 388aac15c1a10da593772f8aea11bb65c02e6f8b
Assessment: request_changes
The change reuses the existing ENUM type and planner owners, and the earlier padded-label issue is fixed. However, the newly supported binary assignment can silently corrupt data sent through CDC. Earlier approvals covered a broader implementation with CDC handling that is absent from this head.
Model: gpt-6.1-terra / max
Session: 01a21ada-c678-7423-9208-90f91e35079a · slot 1 · generation 25
- P1
pkg/sql/plan/enum_collation.go:121: Create a CDC source and matching destination with ENUM('A','a','2') COLLATE utf8mb4_bin, then insert 'a' into the source.
Impact: The source stores 'a' at ordinal 2, but the CDC sink can store '2' at ordinal 3, silently diverging from the source.
Evidence: The existing CDC serializer in pkg/cdc/util.go:394 quotes Enum.String(), so the sink builder emits REPLACE with the string literal '2'. The destination assignment path in pkg/sql/plan/bind_insert.go:3722 and pkg/container/types/enum_collation.go:101 resolves a matching member label before numeric fallback, selecting ordinal 3. The serializer predates this PR, but the new binary lookup makes this ordinary text insertion reach the unsafe value. A source-derived component probe confirmed the mapping with a legacy control; it did not run a live CDC pipeline. Serialize ordinals unambiguously, including an explicit policy for ordinal zero, or reject affected CDC transfers until they are safe, and cover numeric member labels in CDC regression tests.
Validation:
-
Isolation preflight passed. The component probe used byte-for-byte copied ENUM lookup code with lightweight stubs and a modeled CDC literal; its receipt, provenance hashes, and log are reconciled in validation-reconciliation.json.
-
The generated plan descriptor audit and git diff --check passed; the source checkout remained clean.
-
All 27 nonempty discussion entries were accounted for in discussion-assessment.json.
Limitations:
-
The full Go package test timed out while fetching dependencies, and a single-module download retry also timed out; neither is counted as a pass or a product-test failure.
-
No live CDC pipeline or released-binary upgrade was independently run. The PR reports detailed v4.2.9 upgrade, restart, and retry observations.
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: f4a0b1a7d75da6db5d76b98804772b6428c902d1
Assessment: approve
No actionable defects remain in the reviewed scope. The change extends the existing ENUM type and assignment owners to carry collation identity while preserving legacy identity-zero behavior. The additional lookup state is scoped to evaluation batches, and unsupported typed ENUM transfer paths are guarded. Earlier concerns about metadata, label normalization, recovery, and CDC have been addressed.
Model: gpt-6.1-terra / max
Session: 01a21bb5-0ae7-79b2-af8b-b67631bec29a · slot 0 · generation 22
Validation:
-
The public MySQL-entrypoint ENUM regression test passed, including assignment, metadata, ALTER COPY, dump/load guards, restart, and catalog reopen. See public-suite.log and checks/1795768696553039950-2.json.
-
Independent public-entrypoint probes passed for DISTINCT across reordered binary domains and for ordinal zero versus a declared empty member. See public-probe.log and checks/1795768455032890244-2.json.
-
Focused type, vector, and planner tests passed. The CDC guard test passed for MatrixOne and MySQL sinks. See owner-tests.log, cdc-tests.log, and their receipts.
-
The generated plan descriptor comparison and git diff --check passed. audit-review.log records the receipt, source fingerprint, and discussion-coverage checks.
Limitations:
-
The stopped upgrade from v4.2.9, restart, and retry were reported in the PR evidence and were not independently repeated during this review.
-
The design retains a release gate for validating the 4.2-to-main upgrade bridge and recovery paths before shipping a build that authors the new metadata. CDC SQL sinks and DUMP/LOAD v1 reject explicitly collated source ENUMs within their respective guarded paths.
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 0cfd6e26e855e94039cc0031424af1c0e898b755
Assessment: approve
The change preserves legacy ENUM identity while reusing the existing type, catalog and assignment paths for explicit collations. It rejects lossy v1 restore and SQL CDC operations before their external effects. The earlier padding, metadata, checkpoint and CDC concerns are resolved; explicitly reauthoring a duplicate general_ci domain now fails before rewriting rows.
Model: gpt-6.1-terra / max
Session: 01a21456-006d-7b41-b150-908a3e9d9152 · slot 3 · generation 6
Validation:
-
The isolated runtime preflight passed. The retained native-input ledger matched the frozen source.
-
An independent overlaid collation-weight test passed using the assigned test executor (checks/1795789275294134596-5.json; collation-review.log). The generated protobuf descriptor audit and diff whitespace check also passed.
-
Source review confirmed that the released v4.2.9 catalog’s offset-5 entries precede the new offset-6 view refresh. Older inspected 4.2 release and hotfix type constructors initialize the ENUM charset byte to zero.
-
The author reports a stopped v4.2.9 upgrade, restart and retry, legacy archive restore, live CDC checks, and current-head MySQL-protocol tests. The prior reviewed revision’s production paths match this head; subsequent changes are test-only.
Limitations:
-
The local ENUM type-package run timed out while downloading dependencies before tests executed (checks/1795789764184237764-5.json; enum-types.log). An earlier three-package run was interrupted during downloads. Neither is counted as a pass.
-
Affected hosted CI checks were still in progress in the supplied snapshot. The design defers validation of the stopped 4.2-to-main bridge to the release boundary.
|
mo-bot work · Commit: Final review found no material defect or frozen trigger requiring a repair. The candidate remains clean; no rebase, rerun, commit, or PR update is proposed. |
|
mo-bot review · Commit: "interrupted" |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 75bc4698f8e1484eda4f41aa9d74016dd3beb17a
Assessment: request_changes
The new explicit-collation CSV path can silently store a different ENUM member from an INSERT of the same value. Earlier checkpoint, metadata, and CDC concerns are addressed by the current identity propagation and transfer guards. Reusing the existing codec and retaining those guards is reasonable, but numeric fallback remains inconsistent across write paths.
Model: gpt-6.1-terra / max
Session: 01a22b78-8d27-7672-ac2d-c513f3728009 · slot 3 · generation 10
- P2
pkg/sql/colexec/external/external.go:2150: For an explicitly collated ENUM with ten nonnumeric members 'a' through 'j', assign the string '010 ' with a trailing ASCII space through INSERT and through LOAD DATA.
Impact: Both writes succeed, but INSERT stores 'h' at ordinal 8 while LOAD DATA stores 'j' at ordinal 10. A bulk import can therefore silently store a different value from an ordinary assignment.
Evidence: The new trimming makes the CSV path parse the padded input as decimal via ParseUint(..., 10, 16), while EnumLookup.Parse uses base 0 and interprets it as octal. The public SQL probe in enum-different-ordinals.log reproduced both stored rows; the legacy CSV control rejected the padded input. Use one numeric fallback rule for explicit-collation assignments and bulk input, preserving legacy behavior where required, and cover the two entry points with the same input.
Validation:
-
Private /tmp and loopback preflight passed; receipt checks/1796143021218260273-3.json.
-
Focused ENUM type, vector, function, planner, external-input, CDC, upgrade-view, and checkpoint tests passed across nine packages; receipt checks/1796144483564229081-3.json and enum-all-focused.log.
-
The full TestBinaryEnumAssignment32814 public SQL integration test passed, including ALTER COPY and restart; receipt checks/1796143741591294712-3.json and enum-integration.log.
-
A diagnostic SQL probe completed and recorded the differing ordinals and legacy control; its successful execution is evidence of the reproduced defect, not a correctness pass. See checks/1796144337454557547-3.json and enum-different-ordinals.log.
-
The retained native build artifacts matched 171 tracked native inputs and 44 artifact digests; receipt checks/1796144373424740277-4.json.
Limitations:
- The author-reported stopped upgrade from v4.2.9 and backup/restore checks were not independently rerun. The 4.2-to-main upgrade bridge remains a release dependency identified by the design.
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: d9d8fcbd71ce1f3c6f92fba4c97a59c70781df58
Assessment: approve
No actionable defects remain in the reviewed scope. The previous CSV numeric-fallback mismatch is fixed. The change reuses the existing ENUM codec and assignment owners, with batch-local lookup state and guards for transfer paths that cannot preserve the new identity.
Model: gpt-6.1-terra / max
Session: 01a22aff-bb68-7e31-ae71-ee4ab48ad9d0 · slot 0 · generation 45
Validation:
-
Isolation preflight passed, and the staged native libraries were verified against 171 tracked build inputs.
-
Focused ENUM type, planner, function, external-input, CDC and catalog-upgrade tests passed; vector admission and ALTER COPY tests passed separately. Receipts: checks/1796149443814050080-3.json and checks/1796150503680281729-3.json; logs: focused.log and wire-alter.log.
-
The maintained public MySQL-wire ENUM test passed all subtests, including CSV assignment, metadata, ALTER COPY, restart and catalog reopen. Receipt: checks/1796150469402795092-3.json; log: public-full.log.
-
Checkpoint DDL and restore-admission tests passed. Receipt: checks/1796150256810826356-3.json; log: checkpoint.log. The diff whitespace check also passed.
-
All 38 discussion keys and the claimed receipts and logs were reconciled in discussion-assessment.json and validation-reconciliation.json.
Limitations:
-
The v4.2.9 stopped upgrade and retry, v4.2.8 backup restoration, race tests and BVT runs are reported in the supplied PR evidence; they were not independently repeated in this review. The 4.2-to-main bridge remains a pre-release dependency.
-
Restoring a legacy v1 manifest may require recreating its effective legacy schema when its original CREATE text contains a previously ignored COLLATE. Typed ENUM data is rejected by v1 DUMP/LOAD, checkpoint LOAD scripts and SQL CDC sinks.
-
An exploratory nullable ENUM UPDATE SET e=DEFAULT probe produced the first member instead of NULL on both the candidate and a verified pinned-base source overlay. It is preexisting and is not reported as a PR finding; the initial base control failed during cluster bootstrap, and its retry completed.
Narrow matrixorigin#32824 to matrixorigin#32814. Persist supported ENUM assignment identities without interpreting legacy metadata differently. Resolve writes against the target domain, and retain typed identity through DDL, catalog reopen, and COPY. Cover literal and prepared writes, INSERT SELECT/DISTINCT, UPDATE, CSV, ALTER COPY, restart, and legacy v4.2.8/v4.2.9 stopped upgrades. DUMP/checkpoint/CDC recovery and the 4.2-to-main compatibility bridge are separate release gates. Co-authored-by: Codex <[email protected]>
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 9564d06d86e66b5c58a60b487e2fc37097d9427d
Assessment: approve
The change resolves ENUM assignments in the destination domain while preserving legacy identity and stored ordinals. It reuses the existing codec, adds batch-local lookup state, and guards transfer paths that cannot preserve the new identity. Prior CSV, checkpoint, metadata, and CDC concerns are addressed; the documented legacy archive recovery tradeoff remains accepted.
Model: gpt-6.1-terra / max
Session: 01a22b07-00b6-7e32-b0a1-3099d0b867c7 · slot 1 · generation 39
Validation:
-
Isolation preflight passed. Native libraries and headers were verified against the current tracked inputs and retained artifacts: checks/1796152913668944406-3.json, checks/1796152936850354297-4.json, and checks/1796153322389818542-4.json.
-
ENUM type tests passed in the initial aggregate run, whose overall exit was 1 because native headers were not yet staged. After staging them, the vector, planner, function, external-input, CDC, and upgrade-view tests passed: focused.log and focused-retry.log; checks/1796153282986016765-3.json and checks/1796153444177177287-3.json.
-
The public MySQL regression passed with a diagnostic overlay adding a NULL-to-NOT-NULL assignment probe; it also covered CSV, metadata, ALTER COPY, and restart: public-full.log and checks/1796153569607930017-3.json.
-
Checkpoint DDL, restore admission, and Unicode-name tests passed: checkpoint.log and checks/1796153681598635810-3.json.
-
The generated protobuf descriptor comparison, released-source compatibility inspection, and diff whitespace check passed: checks/1796153620483798348-4.json, checks/1796153843796340167-3.json, and checks/1796153888767789690-3.json.
-
All 40 discussion keys and the validation receipts were reconciled in the diagnostic directory.
Limitations:
-
The stopped v4.2.9 upgrade and v4.2.8 backup restore are detailed author reports in the supplied evidence; they were not independently rerun.
-
The stopped 4.2-to-main upgrade bridge and remaining recovery paths require validation before releasing builds that author the new identity, as documented in the design.
What type of PR is this?
Which issue(s) this PR fixes:
Addresses #32814 on
4.2-devwithin the scope in #32886. The schema-rebuild fix shipped separately in v4.2.9 (#32887).What this PR does / why we need it:
Resolve ENUM assignment using the destination column's ordered domain and effective collation. Copying binary
ENUM('A','a')intoENUM('a','A')storesAat ordinal 2 andaat ordinal 1. Numeric conversion after GROUP BY recovers ordinals with the source domain's collation.Normalize newly declared, explicitly collated ENUM labels before encoding. CREATE, ADD, MODIFY and CHANGE trim only trailing ASCII spaces and reject duplicate labels using the assignment collation. Partition children use the normalized parent type. Typed reconstruction and bare ENUM authoring preserve their existing rules.
Carry explicit assignments through planning, typed catalog reconstruction, bulk input, and ALTER COPY. SHOW FULL COLUMNS and INFORMATION_SCHEMA.COLUMNS expose the effective explicit collation. The 4.0.6 offset-6 upgrade refreshes persisted COLUMNS views for existing tenants. On retry, the migration checks the catalog’s lowercase view name and retains an already-current definition.
Keep legacy ENUM lookup and DUMP/LOAD TABLE v1 hashes. DUMP and LOAD reject typed ENUM columns at schema admission because v1 hashes do not encode their assignment identity. An old archive's
create_sqlrecords the original statement, which can contain a collation the original version ignored.Reconstruct checkpoint DDL from the persisted type. DDL-only export retains the collation. Single-table and batch LOAD DATA scripts reject typed ENUM before exporting CSV because a numeric-looking member can be confused with an ordinal.
Reject source tables with explicitly collated ENUM columns when initializing a MatrixOne or MySQL CDC SQL sink. The existing serializer quotes an ordinal, so a target ENUM can interpret it as a numeric-looking member label. Admission records a permanent diagnostic on the source table before target schema or data changes.
Verification on the rebased 4.2-dev head
Head
d9d8fcbd71is based on6afdb0cbb9. The original assignment case still storesA / 2anda / 1across reordered binary domains.h / 8via INSERT andj / 10via LOAD DATA for the same string'010 '. The new MySQL-wire regression also failed on the rebased control6e95873f54. Both writes now storeh / 8for binary and general_ci columns. Numeric-looking labels take precedence, strict imports reject invalid ordinals atomically, and legacy CSV still reads'010'as decimal 10 and accepts zero. Review findingh / 8, 10,923 ofj / 10, and 10,922 of the declared label0x2 / 1. In five paired parser microbenchmarks, a hexadecimal fallback ('0x8 ') went from two heap allocations per cell to zero. Ordinary labels and decimal input stayed at zero.b / 2.types,external,planandcdcran in full under-race -short. The ENUM wire and restart suite also passed under-raceand independently with scoped coverage instrumentation.go vetand incremental golangci-lint passed across all 21 changed Go packages, with zero incremental lint issues. The repository-pinned molint reported the same nine existingrecover()diagnostics on the clean base and the candidate. Regenerating the plan protobuf from the merged schema reproduced the committed file byte for byte.6afdb0cbb9baseline exactly. All row values matched.Earlier assignment, upgrade and benchmark results
This round verified
75bc4698f8on base167a1a9199. The conflict-update control is0e18d0e28d, the original PR rebased onto that base. The execution-plan comparison uses its subsequent revisionfbd0529ae2.INSERT, UPDATE and duplicate-key updates now use the same assignment builder. When the ordered domain and collation agree, the planner copies the ordinal. For differing domains it binds one typed conversion using the source ordinal, source members and destination lookup. Over MySQL TCP,
EXPLAIN VERBOSEwent from two references to the same source column inside a CASE to one reference in that conversion. Copying 65,536 alternating binary labels produced exactly 32,768 rows each at41 / 2and61 / 1(hex bytes / ordinal).SQL regressions check NULL, the error ordinal zero, a valid empty member, statement rollback and IGNORE when the destination cannot accept a source label. The original two-, three- and four-argument lookup expressions also execute over MySQL TCP.
Reproduced two conflict-update failures over MySQL TCP on the control. A literal
e='A'failed with error 20203. Assigninge=VALUES(incoming)copied ordinals across differently ordered binary domains, silently interchanging the labels. The final head binds the ordinary and duplicate-key assignment paths to the destination ENUM definition. Literal, prepared, incoming-column, ordered existing-column and DEFAULT assignments passed, including full-statement rollback on a bad label. This also covers the ENUM portion of [Bug]: ON DUPLICATE KEY UPDATE rejects direct ENUM/SET string assignments #33281.The types package owns scalar and indexed label resolution. DDL duplicate checks and the planner's projected-order reversibility check use the same member keys. Constant vector domains and collation tags are validated once per batch. Tests cover Unicode weights, malformed UTF-8, numeric-looking labels, legacy narrowing and invalid collation tags under IGNORE.
The official Linux/arm64 v4.2.9 binary (
6c05e42) wrote61 / 1for both differently cased source labels. A stopped upgrade using its data directory moved an existing tenant from catalog 4.0.6/5 to 4.0.6/6. Previously stored6120 / 1and61 / 2rows survived upgrade, ALTER COPY and restart. Copying the released source to a newly declared binary destination stored41 / 2and61 / 1before and after restart. A separate restored v4.2.8 cold backup retained ordinals 2, 0 and 3, including both empty-display cases, and retained the legacy lookup on a subsequent write.All 11 owning Go package suites passed with
-short -tags=matrixone_test. Targeted-racetests covered assignment, the MySQL TCP restart test, the composite index regression and CDC sink admission. The restart test also passed with scoped coverage instrumentation. The four changed BVT fixtures ran with the Compose CI runner options and passed 530 assertions with two configured skips. Five further BVT fixtures covering ENUM domain round trips, ENUM and SET index maintenance, SET and geometry passed 358 assertions. Incremental static analysis reported zero issues across the 22 changed Go packages. Plan protobuf regeneration was verified onfbd0529ae2; its schema and generated code are identical on this head.The following medians compare five alternating runs of the text lookup at
0e18d0e28dandfbd0529ae2on the same Darwin/arm64 host with Go 1.26.4 and one CPU. The workload assigns unaccented uppercase inputs to accented general_ci members. The large batch includes index construction.Additional validation on earlier revisions
Released v4.2.8 and v4.2.9 reproduced the original assignment error. Earlier stopped upgrades from both releases preserved existing ENUM rows and lookup behavior.
The stopped-upgrade validation used an actual v4.2.9 offset-5 catalog with an existing tenant. The stopped upgrade refreshed COLUMNS at offset 6, preserved legacy bytes and ordinals, and reports both explicit collations. The actual v4.2.9 full v1 archive restored into a legacy table; the explicit-collation target was rejected and remained empty.
The rebuilt checkpoint CLI read on-disk data. SHOW CREATE and DDL-only preserved the member list and collation. CSV exported the original ordinals, and both single-table and database restore scripts refused the ambiguous load before output creation.
Local race tests passed for the affected packages, including planner, partitionservice, bootstrap and the MySQL-wire regression. The latter covers partitioned assignment, padded ADD and MODIFY, failed duplicate reauthoring, grouped numeric conversion, metadata, DUMP/LOAD admission and catalog reopen. The pre-CDC head passed repository SCA.
The four BVT fixtures affected by the updated COLUMNS metadata passed locally (530 assertions, two configured skips). This covers the width and view definition mismatches in the prior Compose Pessimistic job and Compose Proxy job. Hosted CI on the new head runs separately.
Live MatrixOne CDC reproduced the source label/ordinal
a / 2arriving as2 / 3on the preceding head. On the new head, the typed tasks reported permanent table errors. An existing destination row kept its original label/ordinal and a fresh destination database was not created. The bare ENUM control still replicated. The CDC and frontend owning suites passed with-race -short -tags matrixone_test. Incremental SCA reported zero issues across the complete rebased diff.The embedded ENUM recovery test gives each cluster start its own bounded SQL context. The previous coverage failure expired the original SQL context while the cluster recycled. The test still performs a full restart and checks persisted labels, ordinals, and write lookup.
At
0cfd6e26e8, the entire MySQL-wire ENUM test passed locally under-raceand independently under-covermode=setwith scoped instrumentation. Incremental SCA was clean against4.2-devat0e568746d2. The rebase includes the separate publication-test fix in [4.2-dev] test: sync publication commits before cross-CN ALTER #33400. Hosted checks run on the new head.Released-catalog upgrade and retry evidence
Stopped v4.2.9 Linux x86-64 binary
6c05e42and started candidate388aac15c1with the same launch configuration and data directory. The release executable SHA-256 wasd76fcc947ee73bc8a6ada94c437910c40a12d52af1a67d55ad0d2708f51d79e4.The existing tenant saved
ENUM('a ','a') COLLATE utf8mb4_binwith declared members as understood by the release. Seeded ordinals through both numeric and text inserts.SELECT id, HEX(CAST(e AS CHAR)), e+0 FROM legacy ORDER BY idreturned the same rows before upgrade, after upgrade, and after restart and manual retry.CREATE TABLE inherited LIKE legacy, INSERT SELECT, unrelated ALTER COPY and additional text inserts preserved these same member mappings. A new general_ci column exposedutf8mb4_general_ciand stored'A 'as byte61at ordinal 1.After candidate restart,
UPGRADE ACCOUNT 'enum_pad_tenant' WITH RETRY 2andUPGRADE ACCOUNT 'sys' WITH RETRY 2each reached the COLUMNS upgrade entry. The executor log contained no DROP or CREATE for COLUMNS during retry. The before and after retry SQL transcripts, including SHOW CREATE and relation IDs, compared byte-for-byte.Release boundary
Validate the stopped 4.2-to-main bridge and remaining recovery/transfer paths, before releasing builds that author the new identity. Durable database/table defaults, mixed-version use and metadata downgrade, typed ENUM data restore and CDC support, and comparison/index-key changes remain separate.