Repository navigation
fix: normalize binary prepared DECIMAL materialization - #28827
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.
GPT-6 medium deep review of exact head f29421dc4acdb99b9a628fe4c48e60b5a4d23c07: no blocker found.
The canonical DECIMAL lexeme is now emitted from the normalized coefficient/scale, while the visible result type remains separately preserved. This keeps repeated trailing zeroes from producing a coefficient too wide for the bounded wire value and still parses to the same exact value in both domains. I traced the frontend materialization and plan specialization paths; the new cases cover zero with a huge exponent, both DECIMAL protocol type codes, trailing zeroes, and execution through a DECIMAL256 expression. The added fixtures are small and deterministic; no mechanism for a major racing-UT slowdown is apparent.
Exact-head CI run 34781448516 passed UT, SCA, coverage, shared build, and the required BVTs. This is a self-authored PR, so this is a COMMENT review rather than an approval.
XuPeng-SH
left a comment
There was a problem hiding this comment.
GPT-6 medium deep review of exact head dfcb9a4c6a3046818154be226992d080fab6daac: no blocker found. The three changed files are byte-identical to the previously reviewed head; the rebase adds Decimal256/float coercion rules elsewhere, but they do not invalidate DECIMAL normalization, visible-scale preservation, or prepared-parameter materialization. Exact-head Ubuntu UT, SCA, build, Connector/J E2E, and required BVTs pass. I found no credible major racing-UT slowdown mechanism. This is a self-authored PR, so this is COMMENT only.
…28827) ## Summary - Normalize the canonical DECIMAL coefficient and exponent before typed parameter materialization. - Preserve the visible DECIMAL scale through the existing runtime/direct-result domains. - Add normalized/visible/canonical, binary protocol, full-package, and Connector/J server-prepared regression coverage. Fixes matrixorigin#28771 ## Validation - `make -j8 cgo` - `make -j8 build` - `mo-cgo-test` focused and full `pkg/sql/plan` / `pkg/frontend` tests - `go vet` and incremental `golangci-lint`: 0 issues - Connector/J 8.0.15 with `useServerPrepStmts=true`: issue value succeeds in arithmetic and direct `SELECT ?` retains `DECIMAL(31,30)` metadata.
…28827) ## Summary - Normalize the canonical DECIMAL coefficient and exponent before typed parameter materialization. - Preserve the visible DECIMAL scale through the existing runtime/direct-result domains. - Add normalized/visible/canonical, binary protocol, full-package, and Connector/J server-prepared regression coverage. Fixes matrixorigin#28771 ## Validation - `make -j8 cgo` - `make -j8 build` - `mo-cgo-test` focused and full `pkg/sql/plan` / `pkg/frontend` tests - `go vet` and incremental `golangci-lint`: 0 issues - Connector/J 8.0.15 with `useServerPrepStmts=true`: issue value succeeds in arithmetic and direct `SELECT ?` retains `DECIMAL(31,30)` metadata.
…28827) ## Summary - Normalize the canonical DECIMAL coefficient and exponent before typed parameter materialization. - Preserve the visible DECIMAL scale through the existing runtime/direct-result domains. - Add normalized/visible/canonical, binary protocol, full-package, and Connector/J server-prepared regression coverage. Fixes matrixorigin#28771 ## Validation - `make -j8 cgo` - `make -j8 build` - `mo-cgo-test` focused and full `pkg/sql/plan` / `pkg/frontend` tests - `go vet` and incremental `golangci-lint`: 0 issues - Connector/J 8.0.15 with `useServerPrepStmts=true`: issue value succeeds in arithmetic and direct `SELECT ?` retains `DECIMAL(31,30)` metadata.
Summary
Fixes #28771
Validation
make -j8 cgomake -j8 buildmo-cgo-testfocused and fullpkg/sql/plan/pkg/frontendtestsgo vetand incrementalgolangci-lint: 0 issuesuseServerPrepStmts=true: issue value succeeds in arithmetic and directSELECT ?retainsDECIMAL(31,30)metadata.