Repository navigation
fix: enforce recursive CTE decimal precision - #29280
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 High deep review — APPROVE at exact head 9b264a1.
Reviewed the complete change against the current main merge-base (d7d940e); the PR API's base SHA was stale, and the actual outstanding diff is the 15 decimal-related files. Decimal narrowing/scale growth enforces target precision and preserves source metadata; scale reduction rounds exact coefficients once; cross-width operations retain sign/capacity; equality, null-safe equality, in_range, and Decimal256 executor consumers align on the common decimal domain. Recursive CTE castback and SQL failure/rollback paths have focused planner and BVT coverage. Exact-head CI, SCA, race-enabled planner/function UTs, and relevant multi-CN BVTs are green. No blocking findings.
Merge Queue Status
This pull request spent 1 hour 26 minutes 32 seconds in the queue, with no time running CI. ReasonHintYou 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. Waiting for any of
All conditions
Tick the box to put this pull request back in the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #29137
What this PR does / why we need it:
Recursive CTE members are cast back to the anchor column type, but same-scale DECIMAL casts incorrectly used a direct-copy fast path when the target precision was narrower. This relabeled values without validating the target range, allowing values such as
1000.00to be stored inDECIMAL(5,2)columns.This change:
+/-10^p) consistently;Validation:
go test -mod=readonly -count=1 -timeout=120s ./pkg/container/types.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s ./pkg/sql/plan/function ./pkg/sql/plango vet -mod=readonly ./pkg/container/types ./pkg/sql/plan/function ./pkg/sql/plangolangci-lint run -c .golangci.yml --new-from-rev "$(git merge-base HEAD mo/main)" ./pkg/container/types ./pkg/sql/plan/function ./pkg/sql/planmo-testernormal comparison mode twice forrecursive_cte_decimal_precision.sql(20/20 passed each run)