Repository navigation
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? |
|
Tick the box to add this pull request to the merge queue (same as
|
|
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: 683131f9effabf695ec22452147629cd6ffaf39b
Assessment: request_changes
Reusing existing collation and schema owners is a coherent direction, but the new ENUM-specific MORPC 135 gates violate the established shutdown-only upgrade contract. Dependent implementation review is deferred.
Model: gpt-6.1-sol / max
Session: 01a1e395-a6d9-7ad1-bf20-81f1c6210100 · slot 2 · generation 0
- P2
pkg/defines/const.go:173: The PR introduces MORPCVersion135 solely for ENUM payload semantics and applies it to metadata authoring/reads, persisted expressions and remote execution.
Impact: The unchanged repository policy forbids new per-feature protocol gates for homogeneous clusters. This adds protocol probes, rejection/fallback paths and a durable VIEW floor without a supported mixed-version requirement. Remove the ENUM-specific bump and floor/gate wiring while retaining metadata validation, released-data compatibility and unrelated existing gates.
Evidence: .agents/skills/mo-dev/references/upgrade-compatibility.md:54-80 explicitly prohibits this mechanism; docs/guides/upgrade-4.2-to-main.md also excludes mixed-version operation. The PR changes payload fields/overloads, not RPC framing. New consumers include enum_collation_defaults.go:58, persisted_ip.go:142, expression_protocol.go:88 and remoterun.go:167/2561; build_ddl.go:457 persists the derived requirement in VIEW metadata. The design's supplemental-fence rationale does not establish an allowed exception. This is a policy/design defect, not an observed outage.
Validation:
-
Static audit passed under checks/1794874603763687345-2.json, matched to review-audit-final.log: frozen head/base, clean source, 110-file inventory, patch/blob consistency and unchanged upgrade policy.
-
Traced the new floor through metadata admission, durable VIEW metadata, worker placement, destination probing and stream/receiver checks.
-
Read the revised design, linked issue and all three discussion entries; discussion-assessment.json has complete unique coverage. Attempt 1 contains identical frozen inputs but no completed validation.
-
Acknowledged seven successful frozen CI checks, including shared build; five pending, thirteen skipped and two neutral checks were not counted as passes.
Limitations:
-
Full implementation/hunk, CRC/ENUM ALTER, populated-index backfill, recovery, consumer, test-quality and performance review is deferred at the design blocker.
-
No runtime or native checks were run. local_validation is empty; author-reported execution results were not independently certified.
683131f to
dd13819
Compare
|
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: bb490be6873d2fff5b59b07ae2fe8a1f980b9dad
Assessment: request_changes
The design coherently reuses existing metadata, assignment, index and replay owners. Earlier review concerns are resolved, but two public SQL defects remain.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
-
P2
pkg/sql/plan/make.go:1130: Assign cast_value_to_index('a,A','A',0,?) to a legacy ENUM('a','A'), supplying identity 2 through PREPARE/EXECUTE.
Impact: The binder assumes a nonliteral identity is legacy 0 and transfers ordinal 2 unchanged. The equivalent literal identity stores ordinal 1. Preserve runtime identity semantics before permitting raw ordinal transfer, and test literal/parameter equivalence.
Evidence: public-sql.jsonl and findings-evidence.txt reproduce the stored-member mismatch in TestReviewEnumHelperMetadataEquivalence; receipt checks/1794925456241800584-2.json. Lines 1131–1135 recover only literal identities, although the runtime overload supports dynamic metadata. -
P2
pkg/frontend/data_branch_pick.go:846: For an ENUM('','x') primary key, use KEYS(SELECT k FROM (SELECT CAST(e AS UNSIGNED) k,e AS label FROM lookup_t) q WHERE length(label)=0).
Impact: Scanning every plan projection rejects the unrelated label presentation although the returned key is explicitly numeric. Validate the returned key's lineage while retaining rejection of genuinely ambiguous bare ENUM output.
Evidence: public-sql.jsonl reproduces derived-query and CTE rejection. public-controls.jsonl independently proves the subquery returns ordinal 1 and a pruned-display numeric control succeeds. Receipts checks/1794925456241800584-2.json and checks/1794926074715338370-2.json.
Validation:
-
Reviewed all 157 changed paths and reconciled all 23 discussion entries. Source remains unchanged.
-
Matched 35 command/source/exit receipts to retained logs in validation-reconciliation.json; rebuilt native prerequisites from current inputs.
-
All 61 added maintained test roots passed. Public CSV/Parquet, index, ALTER, Unicode and branch ordinal-zero controls passed; exploratory tests reproduced both findings.
-
Four focused ownership tests passed 100 race repetitions each; frontend owner and real two-CN remote race checks passed with documented exclusions and recovered timeouts.
-
Formatting, vet, configured molint/golangci checks, CLI build/help and protobuf/released-format audits passed. Sampled legacy-runtime median changes were +0.1% to +2.7%, with unchanged allocations.
Limitations:
-
Broader owner runs had four unrelated read-only-filesystem failures; these and unrelated skipped tests are not passes.
-
Full mo-tester BVT, predecessor-binary upgrade/snapshot restoration and full-query performance were not independently executed. Protobuf validation did not regenerate files with protoc.
|
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: 6db3ea81174204b0ecd49ddedb9ebd7b284b839e
Assessment: request_changes
The PR reuses the existing collation, index-key, and checkpoint owners and resolves the earlier index, replay, and prepared-identity findings. Four regressions remain. Most importantly, DATA BRANCH PICK can silently update the wrong row when a sampled ENUM key loses its ordinal.
Model: gpt-6.2-sol / xhigh
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
-
P1
pkg/frontend/data_branch_pick.go:984: Run DATA BRANCH PICK with KEYS(SELECT SAMPLE(e, 100 PERCENT) FROM lookup) when the sampled ENUM is ordinal 0 and the destination ENUM admits a legal empty member.
Impact: PICK succeeds and applies the change to the legal empty member at ordinal 1. The intended row at ordinal 0 retains its old value.
Evidence: The public SQL probe recorded destination values 0=20 and 1=11. The explicit UNSIGNED control correctly updated ordinal 0 to 22. SAMPLE publishes its value through RelPos -2 at pkg/sql/plan/query_builder.go:2648, but the validator follows that slot only for AGG. Resolve SAMPLE output through its producing expression and retain the numeric control. See public-probe.log and checks/1794981538467557563-3.json. -
P2
pkg/sql/colexec/external/hive_partition_fill.go:119: Scan a Hive-partitioned Parquet external table whose directory-derived VARCHAR column uses utf8mb4_unicode_ci.
Impact: The table can be created, but scanning a non-NULL partition fails before the Parquet file opens with unknown collation identity/revision 10/0.
Evidence: The public SQL and validator probes reproduced the error. HivePartColType carries Charset without CollationVersion. The new TypeFromPlan call rejects that incomplete pair, while the baseline string partition parser accepted the value. Use the resolved column type for validation or preserve the existing non-ENUM path, including for stored Hive descriptors that lack a revision. See public-probe.log and hive-probe.log. -
P2
pkg/sql/plan/make.go:1141: Insert CAST_INDEX_VALUE_TO_INDEX('', 1) or CAST_VALUE_TO_INDEX('', '') into an ENUM('') column.
Impact: The INSERT rejects a valid literal domain as a runtime member list. Both expressions return ordinal 1 when selected on their own. Prepared assignment with the same empty domain is also rejected.
Evidence: The empty SQL literal binds as CHAR at make.go:914 and receives a VARCHAR cast for the helper overload. The new GetLit check sees the cast and rejects the expression. The baseline accepted the matching empty ENUM domain. Recognize the lossless coercion around an empty literal and cover both public INSERT forms. Nonempty literal controls and the earlier prepared-identity case passed. See helper-probe.log and checks/1794981634922427985-3.json. -
P3
pkg/frontend/data_branch_pick.go:972: Use KEYS(SELECT MAX_BY('x', e, id) FROM lookup) for a destination ENUM('','x') key, with the source ENUM used only for ordering.
Impact: PICK rejects the unambiguous key 'x' because its validator treats the ordering argument as a source of returned bytes.
Evidence: The optimizer and validator probe returned the ordinal-ambiguity error. MAX_BY returns its first argument, while the new traversal checks every argument. Follow the value-bearing arguments and keep the existing guard for actual ENUM display output. See pick-probe.log and checks/1794981401914286227-3.json.
Validation:
-
Verified the frozen head, merge base, clean checkout, and 157-path change inventory. Reconciled all 26 discussion entries and matched 13 terminal receipts to retained logs in validation-reconciliation.json.
-
Isolation preflight, native prerequisite build, and the full collation package passed. Focused planner, populated-index, ALTER, same-binary two-CN, CDC, metadata, and checkpoint checks passed.
-
Public SQL reproduced the wrong-row PICK, Hive scan, and empty literal-domain assignment failures. An optimizer probe reproduced the MAX_BY rejection. The explicit numeric PICK control and the earlier prepared-identity case passed.
Limitations:
-
Full distributed BVT and a released-binary stopped upgrade were not rerun. The supplied snapshot has the relevant shared build, unit, and static analysis jobs pending.
-
The post-#32723 unreleased 4.2 format bridge remains outside the documented supported upgrade scope.
|
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: 0344c0e818278fe6bec0656d9abac28cccf2222a
Assessment: request_changes
The PR reuses the existing collation, index-key, and checkpoint validation code. The latest commit correctly rejects ambiguous ENUM labels returned directly by correlated scalar subqueries. Public SQL still shows two ways for DATA BRANCH PICK to silently update the wrong row. Three other regressions remain.
Model: gpt-6.2-sol / xhigh
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
-
P1
pkg/frontend/data_branch_pick.go:992: Use a PICK key such asSELECT (SELECT (SELECT o.label)) FROM (SELECT e AS label FROM lookup LIMIT 1) owhenehas ordinal 0 and the destination ENUM has a legal empty member.
Impact: PICK succeeds and updates the legal empty member at ordinal 1. The intended row at ordinal 0 retains its old value.
Evidence: The optimizer probe confirmed that the query registers dependent programs and passes validation. Public SQL recorded destination values 0=20 and 1=11. The explicit UNSIGNED control updated ordinal 0 to 22. The validator follows program output slot 0 but stops atExpr_Slot. Resolve returned capture slots through the corresponding caller inputs, including forwarded captures. Seepick-capture.logandpublic-capture.log. -
P1
pkg/frontend/data_branch_pick.go:999: UseKEYS(SELECT SAMPLE(e, 100 PERCENT) FROM lookup)when the sampled ENUM has ordinal 0 and the destination ENUM has a legal empty member.
Impact: PICK succeeds and changes ordinal 1 while leaving ordinal 0 unchanged.
Evidence: Public SQL recorded destination values 0=20 and 1=11. Sampling the explicit UNSIGNED ordinal correctly updated ordinal 0 to 22.pkg/sql/plan/query_builder.go:2648publishes sampled values throughRelPos: -2, which the validator resolves only for AGG. Resolve SAMPLE slots through the expressions that produce them. Seepublic-probe.log. -
P2
pkg/sql/colexec/external/hive_partition_fill.go:119: Scan a Hive-partitioned Parquet table with a directory-derived VARCHAR column declaredCOLLATE utf8mb4_unicode_ci.
Impact: Table creation succeeds, but scanning a non-NULL partition fails before opening the Parquet file with unknown collation identity/revision 10/0.
Evidence: The frozen prior public SQL result reproduced the error, and the affected code is identical on this head. The compact Hive descriptor carriesCharsetwithoutCollationVersion, so the newTypeFromPlancall rejects metadata previously accepted by the string partition parser. Use the resolved column type or retain the existing non-ENUM validation path for stored descriptors. -
P2
pkg/sql/plan/make.go:1141: InsertCAST_INDEX_VALUE_TO_INDEX('', 1)orCAST_VALUE_TO_INDEX('', '')into anENUM('')column.
Impact: INSERT rejects a valid literal member list as a runtime value. Both helper calls return ordinal 1 when selected alone.
Evidence: The frozen prior public SQL probe reproduced both failures, and the planner code is identical on this head. The binder wraps the empty CHAR literal in a VARCHAR cast, soGetLit()returns nil and assignment rejects it. Recognize the lossless coercion around the empty literal while retaining validation for dynamic member lists. -
P3
pkg/frontend/data_branch_pick.go:972: UseKEYS(SELECT MAX_BY('x', e, id) FROM lookup)for anENUM('','x')target wheneis used only for ordering.
Impact: PICK rejects the unambiguous keyxwith an ordinal ambiguity error.
Evidence: The optimizer and public SQL probes both reproduced the rejection.MAX_BYreturns its first argument, while the validator walks every argument. The binder already identifies the value-bearing argument atpkg/sql/plan/base_binder.go:12839. Apply the same rule to PICK lineage. Seepick-probe.logandpublic-probe.log.
Validation:
-
Verified the frozen head, merge base, clean checkout, and 157 changed paths. Reconciled all 28 discussion entries.
-
Isolation preflight passed. Recovered the matching native build and full collation package pass from attempt 2. After retrying dependency downloads, the attempt 3 optimizer and public SQL probes reproduced both wrong-row writes and the MAX_BY rejection. The direct scalar rejection and explicit numeric controls passed. Commands, source fingerprints, exits, and log hashes are recorded in
validation-reconciliation.json. -
Reused the frozen prior review's SQL results for Hive and empty literal assignment after verifying that the affected source was identical.
Limitations:
- Full distributed BVT and the released-binary stopped-upgrade scenario were not rerun. The frozen CI snapshot shows a successful shared build, unit and static analysis checks still running, and upgrade checks skipped.
|
mo-bot work · Commit: Review in progress. |
|
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: ef6e8e4b834b48f23036bf5f71e0815d02dbc22f
Assessment: request_changes
The ENUM codec and collation work reuse the existing type, catalog, and index owners, and the earlier index and checkpoint identity concerns are addressed. Four source-derived regressions remain in checkpoint scripting, ALTER, and SHOW CREATE. Two required validation gaps also remain.
Model: gpt-6.1-terra / max
Session: 01a23504-137d-7f93-9b91-fd29f7f60fa2 · slot 1 · generation 42
-
P2
pkg/tools/checkpointtool/enum_replay.go:89: Run mo-tool ckp dump --load-script on an ordinary non-ENUM table from a v4.2.8 checkpoint.
Impact: The script is rejected because the released SchemaExtra has no default-charset field and decodes it as zero. In a database-wide export, one such table aborts preflight for the entire selection.
Evidence: The v4.2.8 tag resolves to 10d204b and its proto/api.proto SchemaExtra lacks this field. The new switch accepts only identities 2, 3, and 10; the base CLI rendered the recovered schema without this restriction. Preserve the released legacy-table path while retaining the ENUM identity safeguard. -
P2
pkg/tools/checkpointtool/enum_replay.go:73: Export a current ordinary table such as CREATE TABLE t (n INT NOT NULL DEFAULT 1) with --load-script.
Impact: Preflight rejects the table as having an unproved stored expression, so neither its restore script nor a selected database's script is produced.
Evidence: The new guard rejects every nonempty default, ON UPDATE, or generated expression, even without ENUM columns. The existing renderer at pkg/tools/checkpointtool/table_dump.go:699 renders a literal DEFAULT, and enum_replay_test.go:62 explicitly expects the new rejection. Preserve replay for validated ordinary expressions and cover the public script path. -
P2
pkg/sql/plan/alter_table_charset.go:105: Create a table containing both e ENUM('a') and v VARCHAR(8), then run ALTER TABLE ... CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin.
Impact: The ALTER now fails solely because an ENUM column exists, so users cannot convert the table's other character columns.
Evidence: The new loop rejects every ENUM before conversion. The base implementation processed CHAR, VARCHAR, and TEXT columns and left other types alone. Use the existing COPY and conversion machinery, rejecting only conversions that cannot preserve the required ENUM semantics. -
P2
pkg/sql/plan/build_show_util.go:199: In a legacy database without a database-defaults row, set collation_server to the supported compatibility alias utf8mb4_0900_ai_ci, create a non-ENUM external table, and run SHOW CREATE TABLE.
Impact: SHOW CREATE fails with “cannot replay split ENUM and text table defaults,” preventing schema inspection and consumers that use this renderer from reconstructing the table.
Evidence: build_ddl.go:3876-3884 records the inherited spelling as EnumUnsupportedDefault for every table, and build_show.go:202 calls this renderer. The new guard rejects every external relation carrying that marker, even when it has no ENUM. Render external schemas from their validated column metadata without discarding necessary ENUM identity. -
P2
pkg/sql/plan/function/list_builtIn.go:4566: Use the newly registered COMPRESS_V2 or UNCOMPRESS_V2 functions through SQL.
Impact: The public binding and result contract lacks the required current-head public-path proof; this is a validation gap, not a demonstrated runtime failure.
Evidence: The PR's reported SQL validation predates the final commit that adds these functions. release_v2_wire_test.go invokes the registry and executor directly, and no matching public SQL case or completed current-head result is supplied. The pinned testing contract requires public-path proof for SQL-visible changes. Run the focused Go test and add or supply a focused SQL check covering a V2 round trip and an existing encoded fixture. -
P2
pkg/container/types/types.go:370: Open or restore supported released ENUM data after the new native-type and member-encoding reader is installed.
Impact: The required released-data compatibility check remains unverified; the available evidence does not establish that reads, subsequent assignments, and restore preserve the released ordinals.
Evidence: The PR describes stopped upgrades at d1e154a, but the assignment supplies no matching commands, terminal receipts, or retained outputs, and the frozen upgrade CI checks are skipped. Reconcile the reported v4.2.8 and v4.2.9 runs against their actual artifacts, including reads, later writes, restart and applicable physical restore; rerun only the missing coverage. This is a validation gap, not an observed data-corruption claim.
Validation:
-
Isolation preflight passed: checks/1796185923686817175-3.json and preflight.log.
-
A bounded static source audit passed: checks/1796186678076925139-4.json and source-audit-final.log. It compared the frozen range, v4.2.8 SchemaExtra, checkpoint guards, ALTER guard, and external SHOW guard; it did not execute SQL.
-
discussion-assessment.json accounts for all 31 supplied discussion keys. validation-reconciliation.json matches the claimed checks to their receipts and logs.
-
The frozen CI snapshot had the shared build in progress, unit and static-analysis jobs queued, and upgrade jobs skipped.
Limitations:
-
No current-head Go or SQL tests completed. The installed Go 1.26.6 is older than the required Go 1.27.1, and automatic toolchain download timed out. These are environment failures, not product-test results.
-
No stopped upgrade or physical checkpoint restore was independently executed. The local checkout does not contain a v4.2.9 tag, so its exact release artifact was not independently verified.
|
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: 8694073909154c80e0ccb3b10260d2729eaa691d
Assessment: request_changes
The tagged ENUM encoding reuses the existing type, catalog and index owners, and the earlier checkpoint, ALTER and SHOW CREATE regressions are addressed. A new CDC delete regression remains, as does the previously identified released-data upgrade validation gap.
Model: gpt-6.1-terra / max
Session: 01a2350e-851d-7031-94fc-615272373c71 · slot 2 · generation 20
-
P2
pkg/cdc/util.go:126: A NoFull CDC task has matching, pre-populated source and target tables with an ENUM primary-key row at error ordinal 0, for example from INSERT IGNORE, and that source row is deleted.
Impact: The shared literal formatter rejects the delete key before CDC can send the DELETE, leaving the target stale and preventing the batch from completing.
Evidence: BuildDeleteSQL calls formatDeleteRow, which uses this formatter; TestCDCStatementBuilderEnumOrdinalInsertAndDelete explicitly confirms rejection of ordinal 0. The retained public SQL probe shows that, even in strict mode, DELETE WHERE e IN (0) removes the ordinal-zero row while preserving a declared empty member. Restrict the strict-assignment safeguard to value writes and allow ordinal zero in delete predicates. -
P2
pkg/container/types/types.go:370: A supported released database or physical backup containing ENUM metadata is opened by the new native-type and member-encoding reader.
Impact: Required compatibility of released ordinals, subsequent writes, restart and physical restore remains unverified; this is a validation gap, not a demonstrated corruption defect.
Evidence: The pinned upgrade policy requires a real released artifact or equivalent traceable evidence. The PR reports v4.2.8 and v4.2.9 upgrade runs at d1e154a, but the supplied evidence has no matching commands, outputs or binary provenance, and legacy label lookup and persisted function mapping changed afterward. Reconcile the existing runs and artifacts with this head, or run only the missing released-data read, write, restart and applicable restore checks.
Validation:
-
Isolation preflight and native prerequisite provenance passed; receipts are recorded in validation-reconciliation.json.
-
Focused type, checkpoint, planner, function and external-input tests passed: checks/1796201644722593847-3.json and focused-tests.log.
-
Embedded public SQL checks passed for populated index backfill, ALTER, compression and legacy CSV: checks/1796202079333065701-3.json and public-sql.log.
-
The ordinal-zero delete SQL control passed, and focused CDC builder, target verification, PICK lineage and overload tests passed: checks/1796202843824374209-3.json and checks/1796202970948765762-3.json.
-
review-plan.md and discussion-assessment.json were written and verified; the assessment covers all 33 discussion keys exactly once.
Limitations:
-
No stopped upgrade from a verified release artifact or physical restore was independently executed. The frozen release-upgrade CI checks were skipped.
-
Full BVT, race, multi-CN and real cross-cluster CDC tests were not run locally. The frozen shared build, unit and static-analysis checks were still in progress.
|
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: 083815391d5dc98945e41328088fd4f978167ab5
Assessment: request_changes
The tagged ENUM representation reuses the existing type, catalog and index owners, and the earlier CDC DELETE issue is fixed. The current change can silently store the wrong ENUM member for numeric text and rejects valid CDC inserts to non-strict targets. Released-data compatibility evidence and the linked issue’s small-write performance checks also remain unverified.
Model: gpt-6.1-terra / max
Session: 01a23642-a5da-74a3-9479-4bd000540084 · slot 0 · generation 54
-
P2
pkg/container/types/enum_collation.go:233: Insert the string '010' into a collation-aware ENUM with ten members and no matching '010' label.
Impact: The new base-0 parser treats the text as octal and stores ordinal 8 instead of decimal ordinal 10, silently selecting the wrong member. It also accepts strings such as '0x2' that the existing decimal-only contract rejects. Use the existing decimal ordinal parser for both scalar and indexed collation-aware lookup.
Evidence: The existing decimal cases in pkg/container/types/enum_test.go:220 expect '010' to produce 10 and '0x2' to truncate. The retained helper-only probe extracted the candidate functions: the legacy controls passed, while the collation-aware cases returned 8 and 2 respectively; see enum-numeric-probe-sourcereceipt.log and checks/1796221146434557403-3.json. SQL assignment reaches this path through pkg/sql/plan/make.go:1223 and pkg/sql/plan/function/func_mo.go:1263. -
P2
pkg/cdc/sinker_v2_sql_builder.go:424: A CDC snapshot or incremental insert contains a stored ENUM error ordinal 0, and the matching downstream table runs in a non-strict SQL mode.
Impact: The builder rejects the row before sending SQL, leaving the target stale and preventing the batch from completing. The previous formatter emitted numeric 0, which a non-strict target can store. Preserve ordinal-zero replication for eligible downstream sessions while retaining safe strict-mode handling.
Evidence: Both snapshot and incremental inserts call this builder through pkg/cdc/sinker_v2.go:1090 and :1252. The new guard is unconditional, while pkg/cdc/util.go:235 preserves downstream SQL modes other than NO_BACKSLASH_ESCAPES. The existing SQL fixture at test/distributed/cases/dtype/enum.sql:228 demonstrates how INSERT IGNORE creates a non-null ordinal-zero value. The earlier DELETE concern is resolved separately at sinker_v2_sql_builder.go:445. -
P2
pkg/container/types/types.go:370: A supported released database or physical backup containing ENUM metadata is opened with the changed native-type and member-encoding reader.
Impact: This is a validation gap, not a demonstrated corruption defect: preservation of released ordinals, later assignments, restart and applicable physical restore cannot be verified from the supplied evidence. Supply the matching existing release-artifact provenance and terminal results, or run only the missing cases.
Evidence: Linked issue #32886 and the pinned upgrade-compatibility policy require release-origin data and the affected read, write, restart and restore paths. The PR describes v4.2.8, v4.2.9 and 4.2-dev results at this head, but local_validation is empty and the supplied record lacks the fixture identities, commands and terminal output. The linked hotfix qualification targets 4.2-dev and explicitly does not establish main-reader acceptance. -
P2
pkg/sql/plan/function/func_mo.go:1127: Single-row prepared writes and small ENUM batches take the changed domain-decoding and collation-aware lookup paths.
Impact: The linked issue’s required representative performance comparison remains open; no slowdown is asserted. Provide equivalent baseline and candidate measurements for single-row prepared writes and a small batch, including time and allocations, and reuse the existing bulk measurements where their evidence is available.
Evidence: Issue #32886 explicitly requests single-row, small-batch and bulk measurements. The current PR report provides only 512-row cast microbenchmarks. Earlier legacy-runtime samples predate substantial changes to the decoder, collation lookup and cast implementation, so their applicability to this head is not established.
Validation:
-
Private /tmp and loopback preflight passed; receipt checks/1796221002800113621-3.json and preflight.log.
-
A focused Go probe of extracted production numeric helpers ran with passing legacy controls and failing collation-aware decimal and hexadecimal expectations; receipt checks/1796221146434557403-3.json, source hashes and full output are retained in the diagnostic directory.
-
The focused repository test did not run: the installed Go 1.26.6 is below the required 1.27.1, and automatic toolchain download timed out. Receipts checks/1796221027191286327-3.json and checks/1796221081831363353-3.json record those attempts.
-
The review plan, complete 35-key discussion assessment and receipt/log reconciliation were saved in the assigned diagnostic directory.
Limitations:
-
The helper probe is not a public SQL integration test. No current-head full package, stopped-upgrade, physical-restore or CDC integration run completed locally.
-
The v4.2.9 release artifact and the PR’s reported same-head runs were not independently verified from the supplied evidence.
|
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: 5642eb01e62870b9391ed1c07f111e1079e319c7
Assessment: request_changes
The tagged ENUM representation reuses existing type and collation owners, but three source-derived correctness defects remain in projected assignment, Data Branch compatibility, and historical DUMP binding. The reported release-origin upgrade and restore runs also need traceable execution evidence.
Model: gpt-6.1-terra / max
Session: 01a23642-a5da-74a3-9479-4bd000540084 · slot 0 · generation 54
-
P2
pkg/sql/plan/bind_insert.go:5743: Insert a projected helper result, for example: CREATE TABLE d(e ENUM('', 'a') COLLATE utf8mb4_bin); INSERT INTO d SELECT cast_value_to_index('a,b', 'a', 0, 2).
Impact: The source ordinal 1 represents 'a' and should become destination ordinal 2. The assignment path instead interprets it as the empty member and can silently store destination ordinal 1.
Evidence: appendInsertReplaceSourceCasts passes a new projection column reference to this branch while the helper expression remains in sourceExpr. The helper returns a generic ENUM with an empty payload, and funcCastForEnumType recovers its domain only when it receives the function itself. It therefore decodes the projected payload as legacy ENUM('') before castEnumToEnum resolves the target. Preserve the helper's source domain across the projection and add an INSERT SELECT regression. This conclusion is source-derived; the SQL was not executed locally. -
P2
pkg/frontend/data_branch.go:1791: Compare branch endpoints containing the same ENUM payload bytes and collation but different encoding tags, such as a 4.2-dev legacy ENUM('1#1:a') and a main framed ENUM('a').
Impact: The schema check can admit distinct domains as equivalent. Data Branch can then compare or transfer ordinal 1 as though it names the same value on both sides, potentially suppressing a difference or applying a different label. Conversely, equivalent domains encoded differently can be rejected.
Evidence: The supported 4.2-dev encoder at 232d2de writes the first declaration as legacy payload '1#1:a'; this head writes the second as framed payload '1#1:a'. Encoding is stored in plan.Type.Charset, which this comparison omits. Endpoint admission and historical mapping use this predicate, while data_branch_hashdiff.go compares stored values. Compare decoded ENUM domains with their encoding and collation, and cover both the collision and an equivalent-domain control. -
P2
pkg/sql/plan/table_dump_binding.go:1408: DUMP or LOAD verifies a historical FLOAT-to-string expression containing a string leaf whose stored implicit coercibility is absent and whose rebound counterpart has a nonzero implicit rank.
Impact: A previously accepted historical binding can be rejected as unverified, preventing DUMP or LOAD of the affected table.
Evidence: The caller now combines display-origin and historical flags into value 5, but boundExpressionNeedsHistoricalProjection only recognizes exact values 1 and 7. A leaf without other normalization consequently takes raw protobuf equality before omitHistoricalFloatCoercibility can remove the historical difference. Make the fast-path check honor composed flags and add a combined-policy regression and a DUMP/LOAD control. This is a source-derived finding. -
P2
pkg/container/types/types.go:370: Validate shutdown upgrade and cold restore of persisted ENUM definitions written by supported v4.2.8 and v4.2.9 artifacts.
Impact: The required released-data compatibility boundary is not independently traceable from the supplied evidence. This is a validation gap, not a demonstrated decoding failure.
Evidence: The PR reports current-head upgrade, write, restart and restore outcomes with specific ordinal results, but the supplied evidence contains no matching terminal output or release archive digests; local_validation is empty and the frozen release-upgrade CI checks are skipped. The pinned upgrade policy requires a real released artifact or equivalent execution evidence for changed persisted interpretation. Provide the existing matching artifact identities, commands and terminal results, or run the smallest missing release-origin upgrade and restore checks; raw logs need not be committed.
Validation:
-
The assigned private /tmp and loopback preflight passed; receipt checks/1796225446494079824-3.json matches preflight.log.
-
The supplied text patch reverse-check passed against the frozen head, excluding binary entries whose deltas are absent from the supplied patch; receipt checks/1796225870446902135-3.json matches text-patch-consistency.log.
-
Reviewed the complete indexed discussion and recorded all 37 keys in discussion-assessment.json. The review plan, source traces and receipt reconciliation are retained in the diagnostic directory.
Limitations:
-
No local Go product test completed: the installed Go 1.26.6 is older than the checkout's required 1.27.1, and automatic toolchain acquisition timed out. The failed attempts and their receipts are retained.
-
The PR's reported current-head race, integration, release-origin and benchmark results were considered as author reports, but their matching terminal logs were not available in the supplied evidence. Pending and skipped CI checks were not counted as passes.
|
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: 60271b249bb251ac9e5636d441931314f96ae013
Assessment: request_changes
The tagged ENUM representation reuses the existing type, catalog, and index owners, and the most recent projected-domain, Data Branch, and DUMP concerns have targeted fixes. Three source-derived correctness issues remain across release compatibility, UNION ALL assignment, and MySQL CDC. The required release-origin upgrade and restore evidence also remains unverified.
Model: gpt-6.1-terra / max
Session: 01a237a3-bad5-7892-956a-029e09cf4554 · slot 2 · generation 21
-
P2
pkg/container/types/enum_collation.go:207: After upgrading a v4.2.8 table with an existing ten-member ENUM, assign the numeric string '010' to that legacy column.
Impact: v4.2.8 interprets the string as ordinal 8, while the target interprets it as ordinal 10, silently storing a different member. Likewise, '0x2' was accepted by the released parser but is rejected by the target.
Evidence: The v4.2.8 source uses strconv.ParseUint(name, 0, 64); this legacy-identity branch now calls the decimal-only ParseEnumNumericText. The main merge-base already used decimal parsing, but linked issue #32886 explicitly brings preservation of released columns' lookup rules into this PR's scope. Preserve release-era lookup for legacy definitions while retaining the intended decimal behavior for new definitions, or obtain an explicit owner decision for the compatibility change. -
P2
pkg/sql/plan/enum_union_all_assignment.go:69: Insert from a same-domain ENUM UNION ALL with LIMIT or OFFSET when the source contains error ordinal 0 and the destination declares an empty member; for example, insert an invalid value with INSERT IGNORE into ENUM('', 'x'), then insert from two UNION ALL arms with LIMIT 1.
Impact: The selected source value displays as an empty string, so the destination stores the declared empty member at ordinal 1 instead of preserving ordinal 0.
Evidence: LIMIT and OFFSET make the ordinal-carrying proof return false. The set-operation projection has already exposed the ENUM as text, and castInsertSourceColumn then performs ordinary label assignment. The added unit test expects a limited branch to decline materialization but does not check the resulting stored value. Carry the ordinal through row-limiting operators when safe, or reject an ambiguous transfer before writing, and cover the public SQL case. This conclusion is source-derived. -
P2
pkg/sql/plan/build_show_util.go:1104: Start a CDC task to an empty MySQL target for a table containing an ENUM definition created before collation identity was stored, such as a table upgraded from v4.2.8.
Impact: Automatic target creation fails before the snapshot can be replicated because the generated CREATE TABLE contains MatrixOne-only collation names that MySQL cannot resolve.
Evidence: The shared formatter emits __mo_enum_legacy_main_v1 for the column and can emit __mo_table_legacy_main_v1 for the table. createMysqlSinker2 passes that CREATE statement directly to either sink type. The baseline formatter did not emit these names. Generate a MySQL-compatible target definition where its behavior can be preserved, and explicitly handle domains that cannot be represented. The failure path is source-derived; no live MySQL test was run. -
P2
pkg/container/types/types.go:370: Open or cold-restore supported v4.2.8 or v4.2.9 data using the changed native ENUM type and member-encoding reader.
Impact: The required release-origin read, subsequent-write, restart, and restore compatibility proof cannot be independently verified from the supplied evidence. This is a validation gap, not a demonstrated decoding failure.
Evidence: The PR reports release archive digests and successful results for the current head, but local_validation is empty and no matching commands, terminal logs, or artifact provenance were supplied. The pinned upgrade policy and linked issue #32886 require release-origin evidence for this changed persisted interpretation. Reconcile the existing runs with their retained artifacts and terminal results, or run only the missing release-origin cases.
Validation:
-
Private /tmp and loopback preflight passed; checks/1796230513596906202-3.json matches preflight.log.
-
The frozen-head static source audit passed; checks/1796231381705045122-4.json matches review-static-final.log. It examined the UNION fallback, CDC formatter and sink path, and v4.2.8 numeric parser; it did not execute SQL.
-
discussion-assessment.json accounts for all 39 indexed discussion keys exactly once. validation-reconciliation.json records the seven receipts and their retained logs.
Limitations:
-
No current-head Go product test completed: the installed Go 1.26.6 is below the required Go 1.27.1, and automatic toolchain acquisition timed out. The failed setup and timeout are recorded in collation-test.log and collation-test-auto.log and are not test passes.
-
No live MySQL CDC, public SQL counterexample, released-binary upgrade, or physical restore was executed in this review. The PR's reported runs could not be matched to retained logs in the supplied evidence.
-
The supplied snapshot does not independently establish whether a later applicable release or hotfix exists beyond the stated v4.2.9 baseline.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #32814. Implements the main-side upgrade contract in #32886 following the 4.2 assignment fix in #32824.
What this PR does / why we need it:
An ENUM stores a 16-bit ordinal. Its column definition owns member boundaries, member lookup and collation. Main reads the 4.2 native type, checkpoint and persisted plan encodings. New declarations use the length-delimited format. Existing columns retain their definitions on upgrade, metadata copy and unrelated ALTER.
Aanda, error ordinal 0, a declared empty member and NULL retain distinct meanings. Numeric expressions, explicit text expressions, sorting, DISTINCT and UNION ALL use the appropriate representation.Validation at 0838153 on main 6302cd4
ckeeps ordinal 3 in the v4.2.8 fixture and 2 in the v4.2.9 fixture after new writes and restart. The older trailing-space fixture retains both stored ordinals across ALTER, LIKE and restart. The 4.2-dev physical checkpoint opens with currenta,b/1and historicalc/2. A subsequent insert ofcretains ordinal 2 across another restart.A/2anda/1. The CDC builder regression fails with the previous shared formatter and passes after the repair. Live strict-mode SQL verified that the emitted predicates remove ordinal 0 and preserve a declared empty member. Public SQL also covered V2 round trip and a released V1 byte fixture.mo-tool ckp dump --load-scriptrejects the ENUM fixture before publishingrestore.sql. Ordinary raw CSV export of that checkpoint succeeds. The populated UNIQUE and synchronous/asynchronous IVFFLAT integration paths and the DUMP ENUM plus CHECK unit case passed.go vetand incremental SCA passed across 30 Go packages. CDC, checkpointtool, protobuf and focused function/frontend race runs passed.The earlier 4.2 unmodified-suite comparison at d1e154a reported 681 of 777 assertions matching verbatim, with differences in protocol metadata, diagnostics and branch-specific SQL behavior. The release checks above use typed rows, ordinal assertions, index results and stopped-data replay on the current revision.
Follow-up verification at
5642eb01e628on main6302cd4e33f0'010'as ordinal 10, strict rejection of'0x2', and both strict and non-strict execution of the CDC statement form. The snapshot and tail builders emit unquoted stored ordinals.10d204b8763f) and v4.2.9 (6c05e42f9f66). Verified the release archive SHA-256 values and clean source exits. On this head, both checksummed backups passed stopped upgrade, subsequent writes, restart, and cold restore. The same comma-bearing declaration retainedc/3from v4.2.8 andc/2from v4.2.9. Both existing padded ordinals retained their bytes through LIKE and ALTER COPY. A stopped copy from 4.2-dev232d2dec6d73also passed snapshot read and restore, new writes, and restart.Prepared INSERT plus transaction begin and rollback on a local one-CN cluster, median of three runs. Each cell shows time and Go allocations per operation.
Review follow-up at
60271b249bb2on mainf0c32a66b1ccbcad244e60fe. ID 638 stays reserved for the 4.2-dev IVF helper.COMPRESS_V2andUNCOMPRESS_V2keep 639 and 640 and their released overloads. Main uses 643 for its IVF helper and 644 for the INSERT-only_not_null_assert. The released ENUM display function remains disambiguated by its wire name and signature at ID 568.Released writer receipts
10d204b8763f7e43b689ba5365b3b9c623562dfc56a65fcfcaf75e7f4f21fd8619a6593ec08fc/3before and after writes and restart6c05e42f9f664781ee7eb01f5d601498b819a093dbeb00d7620f48ba7f34cc974a7585a94eeec/2before and after writes and restartBoth official writers checkpointed the tables and exited with code 0. Each run verified the full stopped file manifest before opening the data and before restoring an independent copy. Target
SELECT git_version()returned60271b249bb251ac9e5636d441931314f96ae013.After reopening each stopped copy, the target repeated the writes and copied
padded_memberswithLIKEandALTER ... ALGORITHM=COPY. After restart, both original and copied padded tables returned6120/1, 61/2, 6120/1, 61/2. Each cold restore applied the same assertions on an independent copy.The 4.2-dev binary at
232d2dec6d73wrote a persisted generatedCOMPRESS_V2(data)column. After opening the stopped copy, the target read(1,fixed-v2), wrote(2,after-upgrade)and read both values after restart. The offered-row NULL in anINSERT ... ON DUPLICATE KEY UPDATEreturned MySQL error 1048. The valid duplicate update succeeded.SQL and regression evidence
1#1:aversus framed labela, then accepted equal members with different encodings. The validOUTPUT ASreturned(2,61,1).DUMP TABLE old_aandLOAD TABLE recreated_areturned(1,61,1)and retained the legacy table default in SHOW CREATE.enum_collation_assignment.testpassed 211 of 211 statements with mo-tester. Public INSERT SELECT covered both ordinal helpers, derived projections, different source domains in UNION ALL, NULL, empty labels and atomic refusal of an unknown source domain. Targeted Go suites passed in planner, frontend, function and plan protobuf packages.46913796706observed an ALTER COPY admission conflict while asynchronous index initialization was concurrently changing the source. The test now uses the fixture's existing executor pause and resume around schema publication and checks the actual async index entry afterward. The corrected subtest passed four repeated runs.concat(cast(a/b as double), 'x')retains its stored result0.5xafter upgrade. Both the previous PR head and this head reject its DUMP during SQL-binding proof. That source stores a cast with declared width 65,535. The composed-permission regression covers the separate historical binding with the narrower float cast.molintpassed on the follow-up Go packages. Incrementalgolangci-lintfinished with 0 issues in frontend, planner, SQL function and plan protobuf packages. The final targeted SQL integration run also passed.