Repository navigation
Conversation
jiangxinmeng1
requested review from
LeftHandCold,
XuPeng-SH,
aptend and
aunjgr
as code owners
September 14, 2026 08:35
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? |
jiangxinmeng1
marked this pull request as draft
September 15, 2026 02:09
jiangxinmeng1
force-pushed
the
codex/date-compatibility-batch-20260914
branch
from
September 15, 2026 02:32
458955d to
cc59413
Compare
XuPeng-SH
approved these changes
Sep 27, 2026
This was referenced Sep 27, 2026
Closed
Closed
Closed
Closed
Closed
This was referenced Sep 28, 2026
This was referenced Sep 28, 2026
3 tasks
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Which issue(s) this PR fixes:
Related reports: #28596, #28574, #28573, #28572, #28567, #28566, #28129, #28569, #28559, #28501, #28500, #28151, #28150, #28149, #28147, #28142, #27189, #28498, #28497, #25306, #25307. These are non-closing references; shared validation does not assert independent acceptance of every historical report.
Behavior contract and rationale
This PR defines one MatrixOne temporal contract for newly bound SQL while preserving released 4.2 stored-expression ABI. The complete expected behavior, examples, diagnostic ownership, result types, COM_QUERY/COM_STMT metadata, and upgrade rules are in temporal compatibility design (C01–C42). MySQL 8 is comparative evidence, not the oracle where its behavior is internally inconsistent or conflicts with MatrixOne's released semantics.
Latest CI repair (
1a5a2a38b5)The proxy multi-CN BVT job had three deterministic value mismatches. Two exposed an inconsistency: under
NO_ZERO_DATE, rawDAYOFMONTHandQUARTERon accepted0000-00-00 12:34:56text returned NULL, although typed zero fields and the established BVT expectation were zero. The shared unary helper and new VARCHAREXTRACThad copied a check owned by explicit DATE conversion. Both checks are removed; parser validation, invalid-week behavior, and DATE/CAST mode policy remain intact. The third mismatch was an obsoleteINET_NTOA(TIME '00:00:02.654321')golden: existing numeric TIME coercion rounds to 3, matching MySQL 8.0.46 and the existing boundary test, so the expected address is0.0.0.3.NO_ZERO_DATEYEAR/MONTH/DAY/DAYOFMONTH/QUARTERon accepted zero-date text; corresponding newEXTRACTfieldsYEAR(DATE('0000-00-00'))NO_ZERO_DATE; zero when DATE construction is allowedWEEKOFYEAR('0000-00-00')INET_NTOA(TIME '00:00:02.654321')0.0.0.30.0.0.30.0.0.3; no production behavior changeThe C16/C17 contract and zero-calendar truth table above now state this distinction explicitly. The same prepared query over a VARCHAR column was executed across a mode switch: zero and partial-zero fields, invalid dates, malformed text and invalid-week controls behaved as expected. The complete
pkg/sql/plan/functionpackage, owning-packagego vet,make err-check, andgit diff --checkpass. A fresh binary built from this repair passed 630/630 targeted statements across the original three failing scripts, temporal consistency and zero-temporal compatibility BVT with metadata comparison disabled (-n). With metadata comparison enabled, four separate DATE/DATETIME width expectations differ (64 expected versus 10/19 actual); this local replay does not establish whether that discrepancy is baseline-wide, and the cited CI failure contained only the three value mismatches. Full new-head CI remains pending.Review repair at
9ccb74d984Prior head:
9ccb74d984ce31f036c4aa41dee32225b157e0ba, rebased onto MatrixOrigin main50c15c1fd461fc3cd320d047b95ff3316170d468. This update closes review 5326472073 on the original PR:errors.Newsentinel was replaced by the repository-approved error constructor;make err-checkpasses, closing the exact-head SCA failure. The earlier DATE and HashJoin/LoopJoin findings from review 5326210418 remain covered by the existing contract and tests.Verification and limits
9ccb74d984Coverage repair: the new CN system-view startup fixture now advertises MORPC98, matching the production authoring gate. The prior 97 fixture could never pass admission and timed out in both variants. The focused test and fullpkg/cnservicepackage pass under local-cover(65.9% package coverage). New-head CI is pending.pkg/sql/plan,pkg/sql/plan/function,pkg/frontend,pkg/sql/compile),make err-check, andgit diff --checkpassed on prior head9ccb74d984. Planner/frontend UTs cover final-binding proof, compile retry, projection vs predicate ownership, materialized literals, inactive CASE, aggregate wrappers, and vector-index prefilters.9ccb74d984passed the temporal BVT 370/370, with zero failed/ignored/abnormal statements. Real Connector/J 8.4ServerPreparedStatementcovers six valid JOIN shapes and valid→warning→NULL→valid reuse; the two-marker sequence returns 1/0/0/1 with warning counts 0/1/0/0.Final integration repair (
6ea989d2d2)The last failing CI cases were four obsolete BVT expectations, not a reason to change the approved temporal domain: explicit out-of-range TIME CAST clamps to ±838:59:59 with warning 1292, while raw YEAR/MONTH/EXTRACT fields of accepted zero-date text return 0 independently of NO_ZERO_DATE. The four goldens are aligned, and a valid TIME(6) fractional-division control plus the clamp warning assertion preserve both precision and conversion coverage.
Independent high-effort review found one additional correctness defect: raw TIME DATE_ADD/SUB overloads were incorrectly marked volatile. This excluded deterministic statement-constant intervals from the JOIN diagnostic owner, yielding three overflow warnings for three matching pairs but none for two nonempty, nonmatching inputs. Removing those flags reuses the existing warning-isolated constant-folding/owner mechanism; row-dependent intervals remain row-scoped. A new BVT covers matched, no-match, empty, prepared reuse, decimal DATE_SUB, literal and inactive CASE paths.
Validation on the rebased source: the four previously failing BVT files passed 384/384 before the raw-interval correction (unaffected paths); after the correction, the new BVT passed 33/33 twice (including metadata comparison), and the existing temporal consistency BVT passed 370/370 twice on the same local service with teardown verified. Complete
pkg/sql/plan/functionandpkg/sql/plansuites, targeted executor tests,make err-check, and full-diff whitespace check passed. Rebased onto main9c6fcb5b50; range-diff preserved all 50 original PR commits and added the two repair commits. Independentgpt-6-astrahigh review of the final revision reported no remaining concrete blocker. Fresh GitHub CI and a live mixed-binary rollout are not claimed.Typed DATE follow-up (2026-09-27, 2405a72)
This update closes the two P2 findings in review 5330011503. Typed DATE/DATETIME-to-DATE CAST overload 1 now requires MORPC98 by executable identity, including serialized expressions without the optional syntax bit; the existing classifier protects placement, send, receive, and persisted authoring. Legacy CAST0 and assignment paths are unchanged. DATE overloads 0/2 and the exact typed CAST1 now have conservative nullable result metadata, propagated through the common binder into CTAS without a CTAS-specific exception or per-row executor change.
Adversarial validation covers released worker protocol versions 9/10 versus 98, absent syntax provenance, legacy CAST controls, public binding and serialization, prepared mode changes, and two-row CTAS through a derived projection. The new SQL BVT passed normal comparison 20/20 twice on the same isolated instance, with schema and stored NULL/valid rows checked and teardown verified. Full pkg/pb/plan, pkg/sql/plan/function, pkg/sql/plan, and pkg/sql/compile suites, scoped go vet, lint (0 issues), and diff checks passed. Independent GPT-6 medium final review found no actionable blocker.
Rebased onto main 9dfe5c1; range-diff preserved all 56 previous PR commits patch-equivalently and added one fix commit. Fresh GitHub CI and a live mixed-binary rollout are not claimed.
Final review repair and rebase (2026-09-27,
8dcb29f0a0)This update closes the two findings in review 5330132584. Temporal arithmetic that can return NULL on overflow now has conservative nullable metadata through the common overload deduction, so CTAS/view schemas accept the result while an explicit NOT NULL destination still rejects it. A valid execution-local diagnostic proof now reaches physical JOIN selection for prepared guarded CASE/COALESCE, including the reversed orientation and retry path; invalid or active diagnostics stay conservative. The legacy stored overload identities and warning ownership are unchanged.
The PR is rebased onto main
5be6cd90b5. Compatibility is against released 4.2 protocols 9/10, not each unreleased main commit: integer arguments and temporal contracts share the integrated MORPC98 gate; main's writer-fair lock gate remains MORPC99. No MORPC100 epoch is introduced. Placement, send, receive, persisted-expression and derived-view admission agree on this boundary.On the exact pushed source, full uncached CGo suites passed in
pkg/sql/compile,pkg/sql/plan,pkg/sql/plan/function,pkg/frontend,pkg/cnservice, andpkg/lockservice; scoped JOIN race tests passed. A freshly built service on new isolated data passed all five affected SQL files 556/556 (arithmetic 12, guarded JOIN 35, typed DATE 20, raw interval 33, full temporal consistency 456). Real Connector/J ServerPreparedStatement on 2,000×2,000 rows reduced guarded CASE/COALESCE medians from 166/203 ms to 1.83/1.66 ms, near literal controls 1.19/1.13 ms. Independent read-only GPT-6 medium final review reported PASS/no confirmed blocker. Fresh CI and a live mixed-binary rollout are not claimed; CI is not awaited here.