Repository navigation
fix(function): preserve exact FIELD numeric comparisons - #28429
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? |
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? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed the complete diff at 9903875 against base/merge-base 8934da6. No confirmed blocking findings.
Coverage: FIELD overload resolution and registration; preservation of operand scales through implicit casts; DECIMAL128/256 equality including overflow-as-inequality; signed/unsigned 64-bit representations; BIT dispatch; constant/vector NULL handling, first-match and no-match behavior; all added unit and frontend integration tests. This is an R2 public numeric-correctness fix, exempt from the feature-design-document gate. Integer comparison agrees with MySQL Item_func_field::val_int (https://github.com/mysql/mysql-server/blob/8.0/sql/item_func.cc).
Unhappy-path closure: temporary getter/parameter/result-index slices are invocation-scoped and GC-owned, bounded by argument count and batch length; no new wait, goroutine, shared state or persistent resource. Output ownership stays with the existing vector result wrapper. Existing overload IDs remain unchanged and new implementations are appended; no disk/catalog format, authorization or build-platform changes. Runtime remains O(rows × arguments), with exact scale alignment only in decimal comparisons.
Evidence reused: successful exact-head MatrixOne ALL CI run 34238320433, including Linux UT, shared build and public BVT checks. Its UT log explicitly records TestIssue28397FieldKeepsExactNumericComparison and all seven named subtests passing (0.86s), and the issues owning package passing. The PR also records focused FIELD and owning function-package test commands. The frontend regression reuses the existing base-cluster fixture and covers real MySQL-protocol literal and table-column execution. No code changes made.
Merge Queue Status
This pull request spent 1 minute 13 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #28429 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. Tick the box to put this pull request back in the merge queue (same as
|
…#28429) ## What type of PR is this? - [x] BUG ## Which issue(s) this PR fixes: issue matrixorigin#28397 ## What this PR does / why we need it: `FIELD()` now preserves exact numeric comparison semantics for DECIMAL operands and mixed signed/unsigned integer operands. DECIMAL values use scale-aware DECIMAL128/DECIMAL256 comparison instead of being coerced through `DOUBLE`, while mixed integers compare their 64-bit representations as MySQL does. The regression coverage includes values around the 2^53 boundary, DECIMAL(38,0), high scale DECIMAL values, table columns, and mixed signed/unsigned integers. ## Tests - `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=120s -run '^TestField(DecimalExact)?$' ./pkg/sql/plan/function` - `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s ./pkg/sql/plan/function` - `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s -run '^TestIssue28397FieldKeepsExactNumericComparison$' ./pkg/tests/issues` --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…#28429) ## What type of PR is this? - [x] BUG ## Which issue(s) this PR fixes: issue matrixorigin#28397 ## What this PR does / why we need it: `FIELD()` now preserves exact numeric comparison semantics for DECIMAL operands and mixed signed/unsigned integer operands. DECIMAL values use scale-aware DECIMAL128/DECIMAL256 comparison instead of being coerced through `DOUBLE`, while mixed integers compare their 64-bit representations as MySQL does. The regression coverage includes values around the 2^53 boundary, DECIMAL(38,0), high scale DECIMAL values, table columns, and mixed signed/unsigned integers. ## Tests - `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=120s -run '^TestField(DecimalExact)?$' ./pkg/sql/plan/function` - `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s ./pkg/sql/plan/function` - `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s -run '^TestIssue28397FieldKeepsExactNumericComparison$' ./pkg/tests/issues` --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…#28429) ## What type of PR is this? - [x] BUG ## Which issue(s) this PR fixes: issue matrixorigin#28397 ## What this PR does / why we need it: `FIELD()` now preserves exact numeric comparison semantics for DECIMAL operands and mixed signed/unsigned integer operands. DECIMAL values use scale-aware DECIMAL128/DECIMAL256 comparison instead of being coerced through `DOUBLE`, while mixed integers compare their 64-bit representations as MySQL does. The regression coverage includes values around the 2^53 boundary, DECIMAL(38,0), high scale DECIMAL values, table columns, and mixed signed/unsigned integers. ## Tests - `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=120s -run '^TestField(DecimalExact)?$' ./pkg/sql/plan/function` - `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s ./pkg/sql/plan/function` - `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s -run '^TestIssue28397FieldKeepsExactNumericComparison$' ./pkg/tests/issues` --------- 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 #28397
What this PR does / why we need it:
FIELD()now preserves exact numeric comparison semantics for DECIMAL operands and mixed signed/unsigned integer operands. DECIMAL values use scale-aware DECIMAL128/DECIMAL256 comparison instead of being coerced throughDOUBLE, while mixed integers compare their 64-bit representations as MySQL does.The regression coverage includes values around the 2^53 boundary, DECIMAL(38,0), high scale DECIMAL values, table columns, and mixed signed/unsigned integers.
Tests
.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=120s -run '^TestField(DecimalExact)?$' ./pkg/sql/plan/function.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s ./pkg/sql/plan/function.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s -run '^TestIssue28397FieldKeepsExactNumericComparison$' ./pkg/tests/issues