You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: align explicit CAST overflow behavior with MySQL - #25898
Explicit SQL CAST and CONVERT expressions previously reused the ordinary internal cast overload, whose strict overflow errors differ from MySQL's explicit-cast behavior.
This change:
routes only MySQL SIGNED, UNSIGNED, and DECIMAL cast targets through a dedicated overload, keeping MatrixOne extension integer targets and planner-inserted casts unchanged;
applies MySQL-compatible signed/unsigned overflow handling across string, integer, float, Decimal64, Decimal128, and Decimal256 sources;
clamps explicit decimal casts across Decimal64, Decimal128, and Decimal256 target precisions;
preserves errors for invalid numeric strings;
adds planner/function unit tests, column-vector coverage, extension-target regression tests, and BVT coverage for the reported cases and boundaries.
User impact: overflow cases such as large integer strings, negative-to-unsigned casts, and oversized decimals now produce MySQL-compatible values without changing existing strict semantics for implicit casts or MatrixOne extension integer targets.
Validation:
go test ./pkg/sql/plan/function ./pkg/sql/plan
go test -race ./pkg/sql/plan/function ./pkg/sql/plan
✅ Entered queue — 2026-07-21 06:06 UTC · Rule: main · triggered by rule Automatic queue on approval for main
🚫 Left the queue — 2026-07-21 06:51 UTC · at fe95b262dd5177ef4af339ffb8a49b5b87b1155f
This pull request spent 44 minutes 51 seconds in the queue, with no time running CI.
Reason
The pull request can't be updated
For security reasons, Mergify can't update this pull request. Try updating locally.
GitHub response: refusing to allow a GitHub App to create or update workflow .github/workflows/iceberg-connector.yml without workflows permission
Hint
You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.
Requeued — the merge queue status continues in this comment ↓.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind/bugSomething isn't workingsize/XLDenotes a PR that changes [1000, 1999] lines
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Which issue(s) this PR fixes:
fixes #25252
What this PR does / why we need it:
Explicit SQL
CASTandCONVERTexpressions previously reused the ordinary internal cast overload, whose strict overflow errors differ from MySQL's explicit-cast behavior.This change:
SIGNED,UNSIGNED, andDECIMALcast targets through a dedicated overload, keeping MatrixOne extension integer targets and planner-inserted casts unchanged;User impact: overflow cases such as large integer strings, negative-to-unsigned casts, and oversized decimals now produce MySQL-compatible values without changing existing strict semantics for implicit casts or MatrixOne extension integer targets.
Validation:
go test ./pkg/sql/plan/function ./pkg/sql/plango test -race ./pkg/sql/plan/function ./pkg/sql/plango vet ./pkg/sql/plan/function ./pkg/sql/planmake buildfunc_cast.testBVT: 226/226 passedboundary_comprehensive.sqlBVT: 241/241 passedgit diff --check