Refactor and improve DATE parsing and SQL_MODE handling - #3723
Conversation
8f3e5ab to
2392f69
Compare
DATE parsing and SQL_MODE handling
|
SummaryCoverage spans temporal parsing, arithmetic, date functions, time-zone conversion, NULL handling, boundary and malformed inputs, persistence, and JSON serialization. It exercises both normal product behavior and adversarial edge cases, with most established behavior remaining healthy but gaps at unusual date and malformed-key boundaries. Merge with caution — this PR introduces medium-severity data-integrity risks in uncommon temporal and JSON edge cases, including silently altered dates and corrupted objects instead of clean failures. The issues are directly attributable to the change and should be addressed before treating the merge as fully safe. Tests run by ItoTip Reply with @itoqa to send us feedback on this test run. |
# Conflicts: # sql/expression/function/time.go
# Conflicts: # enginetest/memory_engine_test.go
# Conflicts: # sql/types/datetime.go
Commit: SummaryThe run covers core date/time and arithmetic behavior across normal operations, invalid inputs, boundary values, warnings, SQL-mode enforcement, and state after errors, with additional checks of assertion behavior. Most application behavior appears healthy, but coverage exposed a data-integrity gap in strict date handling and a validation-path inconsistency. Not safe to merge yet — a high-severity PR-attributable defect allows invalid zero dates to be stored even when strict mode is enabled, risking corrupted user data; a separate medium-severity harness defect also leaves prepared assertions unreliable. These are merge-blocking findings rather than flag-for-later observations. Tests run by ItoTip Reply with @itoqa to send us feedback on this test run. |
|
Diff SummaryThe run broadly exercises SQL date/time behavior across valid reads and writes, arithmetic, boundary values, malformed inputs, warning handling, retries, and assertion/harness flows. Coverage includes both normal application behavior and adversarial edge cases, with healthy results for valid temporal operations but a problem in invalid-input handling. Merge with caution — the PR introduces a medium-severity regression where malformed temporal input fails queries instead of returning the expected recoverable NULL and warning, which can disrupt applications that rely on that behavior. A separate similar finding is not attributable to this PR and is a flag for later rather than a merge driver. Tests run by ItoAdditional Findings DetailsThese findings are unrelated to the current changes but were observed during testing. 🟡 Malformed hour input returns a hard error
Evidence PackageTip Reply with @itoqa to send us feedback on this test run. |
|
Diff SummaryCoverage spans core date/time behavior, including conversion and formatting, time-zone normalization, grouping and indexing consistency, hour extraction, execution-path agreement, and invalid-input warnings. It includes normal business-logic flows plus boundary and malformed-input cases, with one unrelated edge-case inconsistency identified for follow-up. Safe to merge — the only failure is a medium-severity additional finding explicitly not attributable to this PR, with no regressions, new failures, or previously flagged failures remaining. It is a flag for later rather than a merge blocker. Tests run by ItoAdditional Findings DetailsThese findings are unrelated to the current changes but were observed during testing. 🟡 Offset dates cross the wrong day
Evidence PackageTip Reply with @itoqa to send us feedback on this test run. |
|
Diff SummaryCoverage spans normal date, time, and timestamp conversion; time extraction and query behavior; timezone handling; zero and malformed values; warning generation; and atomic multi-row writes. It includes happy paths, boundary and invalid-input cases, persistence and grouping behavior, and adversarial checks of error handling and diagnostics. Safe to merge — the run shows no PR-attributable regressions or unresolved failures, and the exercised conversion, query, warning, timezone, and write behaviors remain healthy. The only finding is an unrelated, minor diagnostic-formatting defect that affects warning clarity but not query results or warning codes and is suitable for later follow-up. Tests run by ItoAdditional Findings DetailsThese findings are unrelated to the current changes but were observed during testing. ⚪ Temporal warnings show broken error text
Evidence PackageTip Reply with @itoqa to send us feedback on this test run. |



This PR improves support for parsing various strings into DATETIME.
There are a few improvements to converting DATETIME types to other types, but just enough to get exist tests to pass. Improvements to that area will come in future PRs.
Warnings have also been improved to match MySQL, but we are currently ignoring the delimiter ones.
Dolt bump: dolthub/dolt#11584
Changes:
SQL_MODEmatches MySQL.time.Timepackage does not fully supportZERO_IN_DATE, so that SQL_MODE isn't supported for now.datetimeType.Convert()Fixes:
NULLdolt#11414Possibly a breaking change, because of SQL_MODE changes.