Repository navigation
fix: align prepared temporal result types with MySQL - #31141
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: 0e7da712f44cea55431b42d2686d39035e6917c3
Assessment: request_changes
Reviewed the complete delta, callers, cache/retry lifecycle, tests, and frozen discussion. The bounded immutable temporal history fits the existing prepared-statement owners, and targeted metadata, CTAS, writer, and lifecycle tests pass. One regression remains: supposedly observational classification emits server error reports for successful NULL arithmetic.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
- P2
pkg/container/types/datetime.go:220: Execute prepared SELECT DATE_ADD(?, INTERVAL ? DAY) with a malformed string such as 'review-canary-invalid-date' and a NULL interval count.
Impact: The statement correctly returns NULL, but result-type inference now emits an error report before arithmetic can skip conversion. With the production reporter installed, this creates spurious error-level logs and potentially error_info records, plus error formatting and stack-allocation work on each execution. Make classification avoid reportable error construction, including nested parser calls, and add a diagnostic-side-effect regression test.
Evidence: The new ClassifyTemporalString discards parseDatetime's error, but moerr construction already invokes errutil's reporter. TestReviewTemporalObservation recorded one report during binding at this head and none at the merge base; both executions returned NULL successfully. Direct classifier probes also recorded two reports for '2024-00-28'. See temporal-probes.log and base-probes.log, backed by receipts 1792965996134949386-3.json and 1792966058286456178-3.json.
Validation:
-
Artifacts are retained under /home/xupeng/.local/state/mo-bot/jobs/154a378a80236e1f8493b008/attempt-1. Preflight passed; exact native inputs were exported and built through top-level make cgo, receipt 1792965881485559985-6.json.
-
Focused planner, function, and frontend tests passed: temporal result contracts, writer consumers, SELECT history, interval-count markers, NULL intervals, string formatting, history publication/cache, and retry declaration generations. Receipt 1792966118382311270-4.json; focused-contracts.log.
-
Candidate diagnostic probes failed as described; the NULL-interval probe passed with verified merge-base source overlays. A separate TIMESTAMP clock-loss probe failed at both revisions and was excluded as preexisting. Both probe commands exited 1; the base command was not an overall pass.
-
Evidence audit passed: source remained unchanged, native input/artifact hashes matched, and baseline overlays matched Git objects. Receipt 1792966122723977476-3.json; evidence-audit.log and review-artifact-index.json.
-
Frozen exact-head CI reports successful unit, coverage, static-analysis, PROXY BVT, and PESSIMISTIC BVT jobs.
Limitations:
-
No fresh service-level MySQL differential or BVT run was performed; raw author differential artifacts and linked issue bodies were not supplied.
-
Local tests used normal mode and an instrumented error reporter. Production logging consequences were traced through the existing ReportError implementation; no throughput benchmark was run.
|
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: 7aed527ddcb93b81df0b3f38c400f4b4d8f3c4f5
Assessment: approve
Reviewed the complete delta and affected consumers. The parser-reporting and typed TIMESTAMP findings are resolved. Prepared history, cache/retry handling, CTAS inference and writer destinations remain coherent. No actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
Validation:
-
Reviewed all 18 changed files, linked issue context and all 11 discussion items; saved review-plan.md, review-notes.md and discussion-assessment.json.
-
Reused frozen successful current-head build, UT, SCA and proxy/multi-CN BVT outcomes.
-
Reviewed regression coverage for metadata, fractional values, parser diagnostics, fresh typed-source handles, history publication, retries and CTAS.
-
Static audit passed: source identity and cleanliness, diff whitespace, patch scope and discussion coverage. Receipt: checks/1793206463535667610-4.json; logs: audit-v2.stdout.log and audit-v2.stderr.log.
Limitations:
-
No local Go tests, service execution, benchmarks or MySQL differential were run during this review.
-
Raw CI logs were not supplied. Author-reported focused tests and 208/208 SQL runs remain attributed reports, not independently reproduced executions.
7aed527 to
ddb817e
Compare
aunjgr
left a comment
There was a problem hiding this comment.
Approved after re-review. The previously reported TIMESTAMP clock-loss issue is fixed, with fresh-handle SQL and binary-protocol DATE/DATETIME/TIMESTAMP controls and a CTAS case. I also checked the interval-operator integration and reused the unchanged portions of my earlier review, passing product CI and the documented validation. I did not run a separate local service test.
|
@Mergifyio refresh |
✅ Pull request refreshed |
✅ Merged into
|
…0fd3c52abafc6323e8ac172adb91f424a1eab0e
What type of PR is this?
Which issue(s) this PR fixes:
Please leave both issues open for reporter verification after merge.
What this PR does / why we need it:
Direct prepared FROM_UNIXTIME parameters now expose DATETIME(6), including integer and decimal3 inputs, while ordinary inputs and explicit casts retain their existing precision. Prepared DATE_ADD/DATE_SUB calendar intervals infer DATE or DATETIME(6) from the bound calendar source and preserve its clock and fractions. SELECT retains its widened type for the prepared handle; CTAS infers each execution independently.
This follows up on #30224: that PR fixed the HOUR/TEXT case but selected DATE for calendar-only intervals without considering datetime inputs. It made no FROM_UNIXTIME kernel change because the original precision-0 expectation already passed. The corrected MySQL 8.0.46 baseline requires prepared precision 6; the DATE_ADD retest identifies the remaining DAY/MONTH loss.
Reuse the existing parser for observation-only classification, rebuild generated CTAS result casts, and bind typed sources before lossy conversions. Bounded immutable SELECT history participates in cache identity, generation reset, publication and retry checks. Internal CTAS population can rebind temporal consumers while preserving actual writer destinations. Compact fractional/ISO clocks survive string-result formatting, including parser-accepted surrounding whitespace.
Observational classification shares the DATE/DATETIME/fraction grammar without emitting discarded error reports. Context-aware conversion retains the caller's reporting policy and existing diagnostics. Existing incomplete/zero/malformed calendar behavior from #30311 is preserved; this is not a general date-grammar compatibility change. No new execution ABI or protocol epoch.
Rebased onto official main
bbfe55669a1440424914d45a283a1d0e36f722fa. The conflict resolution preserves main's rejection of public calls to plan-internal unsigned DECIMAL functions, then applies this PR's context-aware calendar inference. Upstream temporal warning folding and conversion policies remain intact. No new execution ABI or protocol epoch.Validation for
ef81e86644edcf47ea2e5be0ad5e8aeae3b17a11(Go 1.27.1, Darwin/arm64), newly executed:pkg/sql/planandpkg/sql/plan/functiontests (mo-cgo-test -count=1 -timeout=240s) pass: 66.667s / 10.034s. This includes the internal DECIMAL call guard, temporal warning folding, prepared SELECT/CTAS and writer-destination contracts.-n -g -o) twice:prepared_temporal_results.sql208/208 andinterval_operator_string_operand.sql31/31. Database teardown verified after every run; the owned service exited cleanly. An initial runner path-lookup failure executed no SQL and is excluded from these results.Reused prior unchanged parser/diagnostic and real binary TIMESTAMP boundary evidence. No new MySQL differential, race or multi-CN result is claimed. The starting head
ddb817e91a4b52c9e475fbacf3c06b3438df71a0has successful required CI, attempt 2 and review approval. CI for this rebased delivery is pending.