Repository navigation
fix: implement MySQL MEDIUMINT semantics - #29818
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? |
323283b to
669ecb6
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
REQUEST_CHANGES at head 669ecb6 (base and merge-base e5dd472).
[P1] Complete the mandatory design review for the new MEDIUMINT capability before implementation approval.
This is more than the original silent-widening bug fix: #29758 already made unsupported MEDIUMINT/INT3 fail explicitly. This PR now introduces their supported SQL domain, persists a new interpretation of INT32/UINT32 Width=24, exposes MYSQL_TYPE_INT24, changes assignment/import/auto-increment consumers, and raises the MORPC compatibility contract to v109. The issue's follow-up explicitly requests this new capability. Reusing 32-bit physical storage is a plausible direction, but it does not make the catalog and compatibility decisions mechanical.
The design-first gate applies on both scope and complexity: production changes are +556/-43 across 33 files in 11 packages (tests/results separately +1037/-53 in 21 files; docs 0), and the feature changes public type metadata, persisted semantics, distributed execution compatibility, and upgrade/restart behavior. I checked the PR body, all available issue/review comments, docs/design and docs/rfcs at this head, and repository PR/design searches. There is no linked exact revision of an independently approved design for this feature. The requirements in #29723 and the implementation/green tests do not replace that artifact.
Please link a stable versioned design and obtain a distinct design approval before the full implementation review. RFC format is optional. The design should close:
- The authoritative logical-type identity and bounds, why Width=24 is unambiguous relative to INT(24)/existing persisted columns, and which existing owners are reused instead of creating parallel validation paths.
- All assignment/metadata consumers (ordinary and prepared DML, defaults/generated expressions, ALTER, auto-increment, Arrow/Parquet/LOAD, typed arrays, MySQL metadata/dump/clone), with explicit strict/non-strict/IGNORE scope and failure behavior.
- What v109 gates on authoring, remote execution, and persisted reads; old-CN admission, upgrade/restart/downgrade/rollback safety; and how old INT schemas are treated.
- Credible representation alternatives and the cost/benefit of the selected one, plus acceptance evidence for boundaries, adjacent ordinary-INT controls, failure/reuse, compatibility, and TP/import overhead.
Policy used: .agents/skills/mo-self-review/SKILL.md, "Missing/unapproved or failed design makes the decision REQUEST_CHANGES and short-circuits full implementation polishing", together with .agents/skills/mo-dev/references/feature-design-review.md sections 1–2. I inspected implementation only far enough to establish these concrete design obligations. This is an artifact/decision blocker, not a claim that a runtime bug has already been demonstrated. Full implementation/test-quality/performance closure is deliberately pending design approval; no local runtime test results are claimed for this PR. There were no pre-existing substantive PR review threads to close.
8695032 to
9b6aa3a
Compare
|
mo-bot review · Commit: Assessment: approve Reviewed the complete 62-file delta and surrounding owners/callers. The four prior findings are addressed with targeted regressions. The implementation follows the accepted design, and no actionable unresolved defect remains. Model: Session: Validation:
Limitations:
|
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 9b6aa3add9ef9565d5880d2bf2d280700c2e050b
Assessment: approve
Reviewed the complete 62-file delta and surrounding owners/callers. The four prior findings are addressed with targeted regressions. The implementation follows the accepted design, and no actionable unresolved defect remains.
Model: gpt-6-astra / xhigh
Session: 01a12d8f-7dea-77c2-a565-38d45b5564e4 · slot 0 · generation 0
Validation:
-
Verified the frozen HEAD, unchanged source checkout, and successful git diff --check. Reviewed production, test/result, and documentation changes separately.
-
Confirmed comparison casts bypass assignment bounds; common MEDIUMINT/INT results widen independently of branch order; constant defaults receive strict validation regardless of sql_mode; Arrow dictionary NULL validity precedes payload inspection.
-
Traced ordinary/prepared assignments, generated values, typed arrays, CSV/Parquet/Arrow imports, auto-increment, metadata, schema-copy consumers, and restart behavior.
-
Verified v110 authoring, placement, destination, receive, and persisted-expression gates, including actual assignment function IDs and target-argument detection after UNION metadata widening.
-
Reused frozen-head successful build, Ubuntu UT, Linux SCA, coverage, and selected multi-CN BVT checks, plus author-reported post-rebase MEDIUMINT SQL and protocol regressions. No local runtime tests were repeated.
-
Recorded scope, comment closure, evidence, and accepted limitations in attempt-3/review-audit.json and static-audit.json.
Limitations:
-
The evidence bundle contains CI conclusions and author validation reports, not current raw test logs; no independent local runtime or MySQL comparison was performed.
-
Historical width-24 values are not migrated. Downgrade below v110 after feature use requires explicit conversion or retaining compatible executors.
-
Full non-strict/IGNORE warning parity, live mixed-binary upgrade/downgrade, complete CDC, and dedicated dump/clone/Arrow SQL end-to-end validation remain outside the accepted evidence scope.
-
No new throughput measurement was available. MEDIUMINT assignment adds a linear bounds pass; no broad performance-regression claim is made.
|
Queued — the merge queue status continues in this comment ↓. |
|
Merge Queue Status
This pull request spent 7 minutes 24 seconds in the queue, with no time running CI. ReasonPull request #29818 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Waiting for any of
All conditions
Tick the box to put this pull request back in the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes
Fixes #29723
What this PR does / why we need it:
Implements MySQL
MEDIUMINTandINT3as signed or unsigned 24-bit types while retaining MatrixOne's existing 32-bit physical storage. Writes enforce the correct range,INT(24)remains an ordinary 32-bitINT, andSHOW CREATE TABLE, information_schema, and MySQL result metadata preserve MEDIUMINT identity. Mixed-version gates prevent older CNs from executing new MEDIUMINT assignment checks.The follow-up also addresses the four reproduced review findings:
The protocol analyzer recognizes assignment cast IDs 541/554/555 and checks the cast target argument, so widened outer result metadata cannot hide a MEDIUMINT write requirement. Generic CAST ID 21 remains ungated. The MEDIUMINT feature floor is v110; main uses v109 for Unicode collation metadata.
Coverage includes signed/unsigned boundaries, defaults, generated values, regular and prepared INSERT, INSERT SELECT, UPDATE, LOAD DATA, narrowing ALTER, auto-increment, persisted catalog/restart, typed-array assignment, comparison casts, UNION/CASE widening, invalid defaults in both SQL modes, and Arrow dictionary NULL handling.
This branch is rebased on current main at
7af631bdf79e7beb4bb3588e2bfd03ba4852b6cc. That main commit corrects the pre-existing Top-N test mismatch tracked in #29968: tuple/interval remain unsupported order keys, whileT_anyis accepted for domainless NULL ordering. The fix is a test-contract correction; it changes no comparator behavior and adds no partition code to this PR.Design: MEDIUMINT review corrections records the type identity, existing responsibility owners, the four review dispositions, protocol compatibility, validation evidence, and remaining limits.
Validation
./pkg/sql/colexec/partitionand./pkg/comparepass, including the corrected Top-N test and domainless NULL comparison.TestIssue29723MediumIntSemantics,TestIssue25103InformationSchemaMetadata, andTestIssue29723MediumIntAdjacentContracts../pkg/pb/plan,./pkg/sql/plan, and./pkg/sql/compile(remote/persisted feature detection, authoring gate, placement and send)../pkg/sql/colexec/partition;gofmtandgit diff --checkare clean.pkg/sql/compilesuite has a verified clean-base failure inTestTruncateLifecycleRCWaitPolicy, tracked separately in #29971. This PR does not change that test or lifecycle behavior; focused MEDIUMINT remote-placement tests pass.CAST(... AS MEDIUMINT)remains unsupported because MySQL does not accept MEDIUMINT as a CAST target. This change enforces strict out-of-range writes; full MySQL non-strict/IGNORE clipping and warning parity is not included. The Kafka/Flink CDC pipeline and fullmo-testerDATALINK suite were not run.