Repository navigation
fix: preserve decimal prefix cast boundaries - #27440
Conversation
…e-27088-cast-main
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed exact head dda088e.
The decimal-prefix scanners bound extreme exponent work, canonicalize leading-zero inputs, preserve half-up underflow boundaries, and keep Decimal256 fallback inside the intended 65-digit input domain when the later common domain is wider. The FunctionResult reset change correctly converts a previously folded constant vector back to flat storage before reuse and refreshes the fixed-column view.
I treated this as the independently mergeable foundation split described by the PR; the planner wiring that produces the private coercion marker belongs to the subsequent split and is not required for this change to remain behavior-preserving on its own.
Validation:
- full pkg/container/vector and pkg/sql/plan/function suites; passed.
- focused decimal-prefix and folded-result reuse tests under -race, count=5; passed.
- git diff --check passed and review worktree is clean.
No blocking correctness, overflow, or reuse issue found.
Merge Queue Status
This pull request spent 3 hours 2 minutes 56 seconds in the queue, including 46 minutes 44 seconds running CI. Required conditions to merge
|
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue #27088 ## What this PR does / why we need it: This PR implements the common-type planner split after #27440: - Reuses the CAST numeric-prefix API to classify prepared string parameters only in decimal-aware common-type contexts. - Specializes isolated execution-plan copies for both COM_STMT_EXECUTE and SQL EXECUTE without mutating cached prepared plans or cached compiles. - Preserves exact decimal domains across comparisons, IN/NOT IN, BETWEEN, COALESCE, GREATEST, and LEAST, including values above 2^53. - Keeps row-dependent BETWEEN bounds row-dependent and preserves all-string behavior as a control boundary. - Introduces the MORPC v27 capability boundary for planner-generated numeric-prefix casts and rejects those plans on older remote workers. Testing: - GOWORK=off go list, go build, and go vet for all changed owning packages. - Full CGo-backed tests for defines, pb/plan, sql/plan/function, sql/plan, and frontend. - Focused CGo-backed MORPC v26/v27 remote protocol validation in sql/compile. - Embedded-engine regression through real COM_STMT and SQL PREPARE execution paths. - Changed executable statement coverage: 406/495 (82.0%). --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This is the first independently mergeable split from matrixorigin#27093. - Preserve MySQL numeric-prefix semantics without saturating oversized Decimal256 inputs to unrelated maximum values. - Canonicalize leading-zero decimal prefixes before parsing. - Keep exact Decimal256 boundaries and fall back consistently when the prefix exceeds the exact domain. - Add focused vector and cast regression tests for prefix, precision, scale, and overflow boundaries. Validation: - `.agents/skills/mo-dev/scripts/mo-cgo-test ./pkg/container/vector ./pkg/sql/plan/function -count=1` - `git diff --check` Approved by: @XuPeng-SH
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#27088 ## What this PR does / why we need it: This PR implements the common-type planner split after matrixorigin#27440: - Reuses the CAST numeric-prefix API to classify prepared string parameters only in decimal-aware common-type contexts. - Specializes isolated execution-plan copies for both COM_STMT_EXECUTE and SQL EXECUTE without mutating cached prepared plans or cached compiles. - Preserves exact decimal domains across comparisons, IN/NOT IN, BETWEEN, COALESCE, GREATEST, and LEAST, including values above 2^53. - Keeps row-dependent BETWEEN bounds row-dependent and preserves all-string behavior as a control boundary. - Introduces the MORPC v27 capability boundary for planner-generated numeric-prefix casts and rejects those plans on older remote workers. Testing: - GOWORK=off go list, go build, and go vet for all changed owning packages. - Full CGo-backed tests for defines, pb/plan, sql/plan/function, sql/plan, and frontend. - Focused CGo-backed MORPC v26/v27 remote protocol validation in sql/compile. - Embedded-engine regression through real COM_STMT and SQL PREPARE execution paths. - Changed executable statement coverage: 406/495 (82.0%). --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This is the first independently mergeable split from matrixorigin#27093. - Preserve MySQL numeric-prefix semantics without saturating oversized Decimal256 inputs to unrelated maximum values. - Canonicalize leading-zero decimal prefixes before parsing. - Keep exact Decimal256 boundaries and fall back consistently when the prefix exceeds the exact domain. - Add focused vector and cast regression tests for prefix, precision, scale, and overflow boundaries. Validation: - `.agents/skills/mo-dev/scripts/mo-cgo-test ./pkg/container/vector ./pkg/sql/plan/function -count=1` - `git diff --check` Approved by: @XuPeng-SH
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#27088 ## What this PR does / why we need it: This PR implements the common-type planner split after matrixorigin#27440: - Reuses the CAST numeric-prefix API to classify prepared string parameters only in decimal-aware common-type contexts. - Specializes isolated execution-plan copies for both COM_STMT_EXECUTE and SQL EXECUTE without mutating cached prepared plans or cached compiles. - Preserves exact decimal domains across comparisons, IN/NOT IN, BETWEEN, COALESCE, GREATEST, and LEAST, including values above 2^53. - Keeps row-dependent BETWEEN bounds row-dependent and preserves all-string behavior as a control boundary. - Introduces the MORPC v27 capability boundary for planner-generated numeric-prefix casts and rejects those plans on older remote workers. Testing: - GOWORK=off go list, go build, and go vet for all changed owning packages. - Full CGo-backed tests for defines, pb/plan, sql/plan/function, sql/plan, and frontend. - Focused CGo-backed MORPC v26/v27 remote protocol validation in sql/compile. - Embedded-engine regression through real COM_STMT and SQL PREPARE execution paths. - Changed executable statement coverage: 406/495 (82.0%). --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This is the first independently mergeable split from matrixorigin#27093. - Preserve MySQL numeric-prefix semantics without saturating oversized Decimal256 inputs to unrelated maximum values. - Canonicalize leading-zero decimal prefixes before parsing. - Keep exact Decimal256 boundaries and fall back consistently when the prefix exceeds the exact domain. - Add focused vector and cast regression tests for prefix, precision, scale, and overflow boundaries. Validation: - `.agents/skills/mo-dev/scripts/mo-cgo-test ./pkg/container/vector ./pkg/sql/plan/function -count=1` - `git diff --check` Approved by: @XuPeng-SH
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#27088 ## What this PR does / why we need it: This PR implements the common-type planner split after matrixorigin#27440: - Reuses the CAST numeric-prefix API to classify prepared string parameters only in decimal-aware common-type contexts. - Specializes isolated execution-plan copies for both COM_STMT_EXECUTE and SQL EXECUTE without mutating cached prepared plans or cached compiles. - Preserves exact decimal domains across comparisons, IN/NOT IN, BETWEEN, COALESCE, GREATEST, and LEAST, including values above 2^53. - Keeps row-dependent BETWEEN bounds row-dependent and preserves all-string behavior as a control boundary. - Introduces the MORPC v27 capability boundary for planner-generated numeric-prefix casts and rejects those plans on older remote workers. Testing: - GOWORK=off go list, go build, and go vet for all changed owning packages. - Full CGo-backed tests for defines, pb/plan, sql/plan/function, sql/plan, and frontend. - Focused CGo-backed MORPC v26/v27 remote protocol validation in sql/compile. - Embedded-engine regression through real COM_STMT and SQL PREPARE execution paths. - Changed executable statement coverage: 406/495 (82.0%). --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
issue #27088
What this PR does / why we need it:
This is the first independently mergeable split from #27093.
Validation:
.agents/skills/mo-dev/scripts/mo-cgo-test ./pkg/container/vector ./pkg/sql/plan/function -count=1git diff --check