Repository navigation
fix: preserve NULL VARCHAR values in FLOOR - #28510
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? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review of exact head c0b5664 against cd04bb4. No confirmed blocker.
Reviewed all four changed files and traced FloorStr through the exact-head unary template, result-vector preparation, selection mask and VARCHAR overload. The fix skips NULL payloads before parsing and preserves one result per input row, including constant/all-NULL and mixed vectors. Unmasked malformed/empty strings still return the existing ParseFloat error; finite values, signed boundaries and NaN/Inf retain the same scalar parser/floor implementation. Overload selection, DOUBLE result type and numeric overloads are unchanged. Constant inputs now avoid repeated parsing; no new shared state, wait or resource owner is introduced. This is an ordinary focused bug fix, not a feature requiring a separate design phase.
The focused UT checks result type, length, NULL bitmap, row correspondence, constants, masks and invalid decimal-place arguments. The public BVT checks typed NULL, mixed vectors, CASE, all-NULL input, PREPARE and CTAS with database teardown. Reused the author's recorded focused/owning-package coverage and two consecutive native BVT passes, plus successful exact-head CI run 34324693477 (UT, SCA, coverage and multi-CN BVT); no additional local native run is claimed. The broader character-to-number compatibility issue #28487 is intentionally unchanged.
|
Tick the box to add this pull request to the merge queue (same as
|
## Summary Closes matrixorigin#28486. FloorStr appended a NULL result but then continued to parse that row empty VARCHAR payload. Reuse the existing unary string-to-fixed template so input NULLs and CASE selection masks are propagated before parsing; non-NULL parsing and error behavior stay unchanged. ## Compatibility and boundaries - Typed NULL constants, mixed vectors with first/middle/last NULLs, all-NULL vectors, and masked rows preserve length and row correspondence. - Invalid unmasked strings still return the original parse error. - Constant decimal places remain supported; non-constant or wrongly typed decimal places remain rejected. - The BVT covers typed NULL, CASE, SQL PREPARE, and CTAS. This does not change matrixorigin#28487 broader character-to-number compatibility behavior. ## Tests - mo-cgo-test focused FloorStr tests: pass. - mo-cgo-test owning package with coverage: pass; FloorStr is 100% covered. - go vet for pkg/sql/plan/function with repository CGo environment: pass. - Native mo-tester BVT: two consecutive passes, 16/16 statements each. - git diff --check origin/main...HEAD: pass. --------- Co-authored-by: XuPeng-SH <[email protected]>
## Summary Closes matrixorigin#28486. FloorStr appended a NULL result but then continued to parse that row empty VARCHAR payload. Reuse the existing unary string-to-fixed template so input NULLs and CASE selection masks are propagated before parsing; non-NULL parsing and error behavior stay unchanged. ## Compatibility and boundaries - Typed NULL constants, mixed vectors with first/middle/last NULLs, all-NULL vectors, and masked rows preserve length and row correspondence. - Invalid unmasked strings still return the original parse error. - Constant decimal places remain supported; non-constant or wrongly typed decimal places remain rejected. - The BVT covers typed NULL, CASE, SQL PREPARE, and CTAS. This does not change matrixorigin#28487 broader character-to-number compatibility behavior. ## Tests - mo-cgo-test focused FloorStr tests: pass. - mo-cgo-test owning package with coverage: pass; FloorStr is 100% covered. - go vet for pkg/sql/plan/function with repository CGo environment: pass. - Native mo-tester BVT: two consecutive passes, 16/16 statements each. - git diff --check origin/main...HEAD: pass. --------- Co-authored-by: XuPeng-SH <[email protected]>
## Summary Closes matrixorigin#28486. FloorStr appended a NULL result but then continued to parse that row empty VARCHAR payload. Reuse the existing unary string-to-fixed template so input NULLs and CASE selection masks are propagated before parsing; non-NULL parsing and error behavior stay unchanged. ## Compatibility and boundaries - Typed NULL constants, mixed vectors with first/middle/last NULLs, all-NULL vectors, and masked rows preserve length and row correspondence. - Invalid unmasked strings still return the original parse error. - Constant decimal places remain supported; non-constant or wrongly typed decimal places remain rejected. - The BVT covers typed NULL, CASE, SQL PREPARE, and CTAS. This does not change matrixorigin#28487 broader character-to-number compatibility behavior. ## Tests - mo-cgo-test focused FloorStr tests: pass. - mo-cgo-test owning package with coverage: pass; FloorStr is 100% covered. - go vet for pkg/sql/plan/function with repository CGo environment: pass. - Native mo-tester BVT: two consecutive passes, 16/16 statements each. - git diff --check origin/main...HEAD: pass. --------- Co-authored-by: XuPeng-SH <[email protected]>
What this PR does / why we need it:
Closes #28486.
FloorStr appended a NULL result but then continued to parse that row empty VARCHAR payload. Reuse the existing unary string-to-fixed template so input NULLs and CASE selection masks are propagated before parsing; non-NULL parsing and error behavior stay unchanged.
Compatibility and boundaries
Tests