Repository navigation
fix: reject unsupported MEDIUMINT aliases - #29758
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? |
03a754f to
18b8485
Compare
aunjgr
left a comment
There was a problem hiding this comment.
APPROVE at 18b8485. Declared base is b6fa8cc; actual merge-base is dca6ffc. No blocking finding confirmed in the five-file PR range.
The change closes the unsupported-type admission boundary at the existing AST-to-type owner: MEDIUMINT/INT3 no longer fall through to INT32, and unsigned INT24 follows the same existing not-implemented path. Ordinary signed/unsigned INT mappings are unchanged. This is explicit rejection of an unsupported declaration, not partial24-bit storage or per-row range enforcement. CREATE/ALTER/CAST consumers share this owner.
Reviewed every changed hunk and surrounding default error path. Tests cover MEDIUMINT, unsigned MEDIUMINT, INT3, CREATE and CAST rejection with the specific error class, plus ordinary INT controls. The information_schema fixture now uses supported signed/unsigned SMALLINT with matching precision, while retaining its nullability/scale and neighboring metadata/FK assertions. The DATALINK result changes only the earlier inner-MEDIUMINT rejection diagnostic. No storage format, resource lifecycle or row-processing behavior is added.
Evidence reused: exact-head required CI, UT/SCA/coverage and proxy/pessimistic BVT are successful. The author reports current-head focused and complete planner tests plus the adjusted metadata integration case; these were not independently rerun locally in this pass. The documented compatibility limit remains: existing physical INT metadata is unchanged, but stored SQL definitions explicitly reparsing MEDIUMINT/INT3 can now fail. No migration or full old-binary upgrade proof is claimed.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review: APPROVE at 18b848532282d813611d04995e584ff706cba6c0, against merge-base dca6ffc2bf21036627b221b67f05943fbe458cf0. Performed directly without subagents. No blocking finding.
Reviewed all five changed files/hunks, issue #29723, review history, and the shared AST-to-type callers. This focused bug fix removes the unsupported INT24 admission at its existing owner. MEDIUMINT/INT3, including unsigned forms and nested ARRAY element validation, reach the existing NYI result; CREATE/ALTER/CAST/procedure-type consumers reuse that owner. Ordinary signed/unsigned INT stays unchanged. No row checks, state machine, storage format, execution path or cleanup owner is added. The implementation is proportional (+1/-1); tests/results are +80/-19, docs unchanged.
Tests distinguish aliases and signedness, check the specific error class, and retain INT controls. The information_schema fixture switches its two unsupported declarations to supported SMALLINT while retaining precision/nullability/scale, other metadata and FK assertions. The DATALINK expectation correctly reports the earlier inner-cast rejection. No actionable earlier comment remains.
Reused exact-head CI run 37895962649: UT/SCA and BVT passed. Downloaded artifacts confirm TestIssue25103InformationSchemaMetadata passed (3.82s), owning planner shards completed, and func_load_file_datalink.sql actually executed 82/82 checks successfully (0.304s). Author focused/complete planner results were considered separately; no duplicate local suite run was needed. Diff whitespace check passed.
Compatibility limit: pre-existing physical columns retain their INT metadata, but stored SQL explicitly reparsing MEDIUMINT/INT3 can fail after upgrade. This follows the documented unsupported-type rejection scope; this review does not claim a stored-SQL migration. No runtime TP overhead is introduced by the admission change.
Merge Queue Status
This pull request spent 8 minutes 14 seconds in the queue, with no time running CI. ReasonThe pull request can't be updated
HintYou should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. 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:
MEDIUMINTand itsINT3alias parse asMYSQL_TYPE_INT24, but the planner was mapping that type to signed or unsignedINT32, silently accepting values outside the MEDIUMINT range. This change routes INT24 through the existing not-implemented error path while keeping ordinary INT mappings unchanged. The issue-25103 information_schema regression now uses supported signed and unsigned SMALLINT columns and retains its precision, nullability, scale, other metadata, and foreign-key assertions.Validation on rebased head
18b848532282d813611d04995e584ff706cba6c0:.agents/skills/mo-dev/scripts/mo-cgo-test -run '^TestIssue25103InformationSchemaMetadata$' -count=1 ./pkg/tests/issues.agents/skills/mo-dev/scripts/mo-cgo-test -run 'TestGetTypeFromAstRejectsMediumIntAliases|TestBuildCreateTableRejectsMediumInt|TestBuildCastToMediumIntIsRejected' -count=1 ./pkg/sql/plan.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 ./pkg/sql/plangit diff --checkandgofmt -dare clean.A direct MySQL protocol smoke on the preceding planner base
23d8f6125verified INT accepts8388608, while MEDIUMINT CREATE and CAST return the not-implemented diagnostic. The fullmo-testerDATALINK case and performance benchmarks were not run.Compatibility note: this rejects new MEDIUMINT/INT3 declarations and casts; it does not add 24-bit storage or migrate existing columns, which keep their current INT metadata. Stored views that reparse explicit MEDIUMINT/INT3 casts may fail after upgrade. The change is planning-time only and adds no row-processing checks.