Repository navigation
fix(sql): accept BOOL and ENUM in statistical aggregates - #30223
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? |
9b213c2 to
d719213
Compare
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: d719213dad8be34184ab3772c56967b08b90178c
Assessment: approve
Reviewed the complete seven-file delta and affected callers. The central resolver correctly reuses existing integer casts and statistical executors, preserving NULL semantics, prepared binding and the separate SUM/AVG BOOL gate. No actionable defects found.
Model: gpt-6-astra / xhigh
Session: 01a12d8f-7dea-77c2-a565-38d45b5564e4 · slot 0 · generation 0
Validation:
-
Focused registry and planner tests passed: 17 top-level tests, including 32 runtime boundary cases covering BOOL, ENUM ordinals 0/32768/65535, NULL, DISTINCT and serialized partial-state merge.
-
The same 32 boundary cases failed at type resolution with the exact base resolver, confirming regression coverage.
-
Isolation preflight passed; verified 192 native inputs and 62 retained build artifacts. Diff check passed and source remained unchanged.
-
Commands, source fingerprints, exit receipts and logs reconciled in /home/xupeng/.local/state/mo-bot/jobs/0539424518a895bf91849e4e/attempt-1/evidence-audit.json.
-
Frozen-head CI reports successful Ubuntu unit tests and proxy/pessimistic multi-CN BVT runs.
Limitations:
-
No local SQL-server replay; CI per-case logs and author validation receipts were not supplied.
-
The linked issue's full text was unavailable; its contract was assessed from the frozen PR description.
-
Performance was assessed structurally, without benchmarks: existing inputs incur two additional resolver comparisons; newly supported inputs use ordinary cast vectors.
Merge Queue Status
This pull request spent 28 minutes 42 seconds in the queue, with no time running CI. ReasonPull request #30223 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. 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:
What this PR does / why we need it:
VAR_POP, VAR_SAMP, STDDEV_POP, STDDEV_SAMP and their aliases currently reject BOOL and ENUM operands that MySQL accepts in numeric contexts. Resolve BOOL through the existing INT8 cast (0/1) and ENUM through UINT16 (stored ordinal), then reuse the existing statistical aggregate executors. Existing NULL/cardinality semantics and the separate SUM/AVG BOOL SQL-mode gate are preserved.
Regression coverage checks function resolution and result types, ordinary/prepared/window binding, ENUM provenance across projections, and prepared-template immutability. A six-row SQL case verifies independent numeric results, aliases, DISTINCT, grouping, empty/all-NULL/singleton inputs, windows, explicit label conversion, and repeated prepared execution.
Validation on macOS arm64 with Go 1.27.1:
pkg/sql/plan/function,pkg/sql/plan) passed normal unit tests with-count=1.The added per-input integer conversion has the same cost as an explicit cast; no aggregate algorithm, state, storage, or wire format changes. CI remains pending. The issue should remain open for the reporter to verify after merge.