Repository navigation
Add tests for parseDateTime64BestEffort duplicate fractional separator (takeover of #102890 / supersede #103717) - #104163
Conversation
Adds expanded coverage (3 inputs * 3 OrNull/OrZero variants) for the duplicate fractional-separator case in parseDateTime64BestEffort. The underlying bug is already fixed on master by PR ClickHouse#103773 (yariks5s, "Fix UB while parsing dateTime", merged 2026-04-30). This test PR takes over @Avogar's stalled ClickHouse#102890 / closed ClickHouse#103717 by carrying forward only the additional test cases — the .cpp fix from ClickHouse#102890 is now redundant. Test cases: '12:34:56..123' (double dot directly) '12:34:56.123.456' (extra dot after fractional) '12:34:56.123456789012345678.987654321' (long fractional + dot) Each tested against parseDateTime64BestEffort (strict), parseDateTime64BestEffortOrNull, and parseDateTime64BestEffortOrZero. Co-authored-by: avogar <[email protected]> Co-authored-by: Pavel Kruglov <[email protected]> Co-authored-by: Nihal Z. Miaji <[email protected]>
Pre-PR validation gate (per groeneai TASK.md)This PR adds tests only — no C++ source changes. Gate answers: a) Deterministic repro? Yes — without yariks5s' #103773 on master, every b) Root cause explained? The bug is in c) Fix matches root cause? N/A for this PR — the fix already landed in #103773. This PR only validates that the fix is correctly catching the documented edge cases. d) Test intent preserved? / New tests added? Yes. The 3 inputs × 3 function variants are Avogar's original test design (carried forward verbatim from #102890). The single-case test on master ( e) Demonstrated in both directions? Verified locally on master HEAD Diff against f) Fix is general, not a narrow patch? N/A for test-only PR. Note: the underlying fix (#103773) is general — it covers all Session: cron:clickhouse-ci-task-worker:20260506-001500 |
|
cc @alexey-milovidov — could you review? Test-only resubmit per your directive on #103717. Diff is 19 lines (1 SQL + 1 reference). Adds 3 inputs × 3 function variants on top of the single-case test (#103773) already on master. |
|
Workflow [PR], commit [392c844] Summary: ✅ AI ReviewSummaryThis PR adds a new stateless test pair for ClickHouse Rules
Final VerdictStatus: ✅ Approve |
alexey-milovidov
left a comment
There was a problem hiding this comment.
Thanks, good change!
Context
This is a slimmed resubmit of #103717 — itself a takeover of @Avogar's stalled #102890 — per @alexey-milovidov's directive on #103717 (
the diff is too large. Keep only the relevant changes.).While preparing this resubmit, I noticed that the actual
.cppfix from #102890 is no longer needed: the duplicate-fractional-separator bug inparseDateTimeBestEffortwas fixed on master by @yariks5s's #103773 (merged 2026-04-30 by @alexey-milovidov). Both fixes use the same approach (a booleanhas_fractional*flag that errors on the second.after the fractional part has been opened).The only remaining "relevant change" from #102890 is the expanded test coverage: 3 inputs × 3 function variants (strict / OrNull / OrZero) versus the single-case test on master (
tests/queries/0_stateless/04143_ub_parsing_datetime.sql). So this PR adds only those tests.Tests added
tests/queries/0_stateless/04101_parseDateTime64BestEffort_double_dot_fractional.{sql,reference}:'12:34:56..123'(double dot directly)'12:34:56.123.456'(extra dot after fractional)'12:34:56.123456789012345678.987654321'(long fractional + dot)Each validated against
parseDateTime64BestEffort(strict),parseDateTime64BestEffortOrNull, andparseDateTime64BestEffortOrZero. All three currently pass onmasterHEADbc39c42c123eagainst the locally-built debug binary (errors throwCANNOT_PARSE_DATETIMEon strict,\N/1970-01-01 00:00:00.000on OrNull / OrZero).Attribution
Tests originally authored by @Avogar in #102890. The takeover workflow follows @alexey-milovidov's directive on #102890 (2026-04-29). Test files imported as-is; commit carries
Co-authored-by:for @Avogar and @nihalzp (who reviewed the wording on the now-redundant.cppfix).Closes / supersedes
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
N/A (test-only)
Documentation entry for user-facing changes
cc @alexey-milovidov @Avogar @nihalzp @yariks5s
Version info
26.5.1.366