Repository navigation
fix(sql): round temporal integer casts and support unsigned targets - #32001
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? |
|
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: 13f3d032db68dbc8b905505ba79062bf4ddcf898
Assessment: approve
Reviewed the complete change and affected consumers. Temporal rounding, unsigned conversion, scalar ownership, alias metadata and RETURNING admission are coherent. No actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a1869d-820c-7212-9788-aecfb86a4141 · slot 0 · generation 2
Validation:
-
Reviewed all 19 changed files, linked issue requirements and both discussion entries; saved review-plan.md and discussion-assessment.json.
-
Passed 16 focused top-level tests across planner and function packages, including six diagnostic scalar-plan variants. Evidence: focused-probe-retry.log and checks/1793634419094278163-3.json.
-
Preflight passed. Verified 29 native input hashes, reconciled check receipts and confirmed unchanged source; see validation-evidence.json and validation-audit-retry.log.
-
Reused frozen-head successful build, unit-test, static-analysis and multi-CN BVT evidence.
Limitations:
-
No local end-to-end SQL or MySQL differential execution; author-reported differential results were not independently reproduced.
-
Local RETURNING checks cover binding and cast execution. The author's runtime check encountered an admission-cap limitation also present in its control.
✅ Merged into
|
…stream claimed 97 as narrow_scan in matrixorigin#32034); take upstream narrow-scan prefetch, virtual-timestamp reads, temporal integer casts, vector shuffle ownership, JSON concat and logtail append-range changes GitHub reported the PR CONFLICTING (DIRTY): upstream matrixorigin#32034 added `plan.Node.narrow_scan = 97` while this branch's unmerged additive `ScanReadRole scan_read_role` sat on field 97. Semantic resolution, both sides kept: - upstream keeps `narrow_scan = 97` (shipped on main; `plan.pb.go` regenerated from the merged proto with the repository protoc/gogofast pipeline plus both postprocessors; toolchain verified byte-identical against upstream's committed bindings before use); - this branch's additive `scan_read_role` moves 97 -> 98; nothing ever persisted 97 as scan_read_role (unmerged field), provenance comment updated in proto/plan.proto; - `merged_descriptor_test.go` (upstream's merge-collision contract guard) extended to pin Node.narrow_scan=97 / Node.scan_read_role=98 so a future regeneration cannot silently renumber or drop either; - all other overlapping files auto-merged with both sides' hunks intact (upstream: table_scan/narrow-scan scope+operator plumbing, plan binder temporal/int-arg changes, disttae datasource, query_builder/types/ deepcopy/base_binder/apply_indices). Upstream batch: matrixorigin#31268 (virtual timestamp reads), matrixorigin#32001 (temporal integer casts), matrixorigin#32020 (vector shuffle ownership), matrixorigin#32031 (logtail append ranges), matrixorigin#32038 (python JSON-string concatenation; upstream's own change, no PR-side code), matrixorigin#32034 (narrow-scan prefetch).
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #31926
What this PR does / why we need it:
Round explicit DATETIME, TIMESTAMP, and TIME integer casts in the calendar/clock domain before packing their numeric values, including fractional-second carries, negative TIME, and MySQL boundary behavior. Support DATE, DATETIME, and TIMESTAMP casts to UNSIGNED, and preserve the session time zone for TIMESTAMP.
Reuse the existing temporal integer-argument calculations without changing assignment, comparison, or DECIMAL conversion semantics. Lower integer evaluation at its value owner: stored temporal columns round; temporal CAST, COALESCE, IFNULL, LEAST, and GREATEST results honor TIME_TRUNCATE_FRACTIONAL; IF/CASE forward the selected branch's policy. Lower scalar outputs at their value owner before ordinary, outer-JOIN ON, or dependent materialization, keeping planner bindings and program output types aligned. Preserve null-extension, ordering, DISTINCT, and scalar cardinality. Rebind scalar alias graphs so ORDER BY/HAVING consumers cannot mutate the selected datetime or its output type. Carry the contract through folding, serialization, and prepared execution without duplicating conditions. Check resolved overload stability in RETURNING admission rather than rejecting every CAST by function name.
Update the existing DATE-to-UNSIGNED expectation and add focused UT/BVT coverage.
Validation: