Repository navigation
Conversation
|
cc @Avogar @nihalzp @alexey-milovidov — could you re-review? No code changes vs. #102890 HEAD; this is a clean rebase onto master plus your already-approved wording fix carried in commit 3. Pre-PR Validation Gate (TASK.md Phase 4 Step 9)a) Deterministic repro? ✅ — Regression test b) Root cause explained? ✅ — Pre-fix path: parser sees first c) Fix matches root cause? ✅ — The flag rejects any second d) Test intent preserved? / New tests added? ✅ — Three regression test groups cover all relevant patterns: back-to-back ( e) Demonstrated in both directions? ✅ — Originally demonstrated via UBSan findings on PR #102890's CI lanes and the chronic f) Fix is general? ✅ — Single code path ( Session: cron:clickhouse-ci-task-worker:20260429-131500 |
|
Workflow [PR], commit [3b72fd4] AI ReviewSummaryThis PR combines a real parser safety fix in PR Metadata
Findings
ClickHouse Rules
Final Verdict
|
LLVM Coverage Report
Changed lines: 100.00% (12/12) · Uncovered code |
|
@groeneai, link the PR fixing test_distributed_frozen_replica here. If there is no fix yet, submit a fix as a separate PR. Then update the branch. |
…-overflow-takeover # Conflicts: # CHANGELOG.md # ci/jobs/functional_tests.py
|
@alexey-milovidov — Session: cron:clickhouse-ci-task-worker:20260430-184500 |
|
@groeneai, the diff is too large. Keep only the relevant changes. |
| return on_error(ErrorCodes::CANNOT_PARSE_DATETIME, "Cannot read DateTime: duplicate fractional part"); | ||
| has_fractional = true; | ||
|
|
||
| if (has_fractional_separator) |
There was a problem hiding this comment.
has_fractional_separator is currently unreachable here: on a second . we already return from the preceding if (has_fractional) branch, so this new check/message never executes.
If the intent is to surface "duplicate fractional separator", the condition ordering needs to change; otherwise this extra state can be removed to keep the parser logic minimal.
| @@ -62,13 +50,6 @@ def get_additional_envs(info, check_name: str) -> List[str]: | |||
| from ci.jobs.ci_utils import is_extended_run | |||
There was a problem hiding this comment.
This change is part of a broader CI/Azure test-environment refactor and is unrelated to the stated parseDateTime64BestEffort overflow fix/changelog entry.
Please split these CI/stress changes into a separate PR (or update this PR metadata/changelog to match the real scope), otherwise review/auditability for the parser fix stays ambiguous.
|
@alexey-milovidov — slimmed resubmit opened: #104163. While replicating the commits onto a fresh branch, I noticed @yariks5s already landed an equivalent code fix for the duplicate-fractional-separator bug in #103773 (merged 2026-04-30). Both PRs add a boolean flag ( So the only "relevant changes" left from #102890 / this PR are @Avogar's expanded test cases (3 inputs × strict/OrNull/OrZero, vs the single test on master). #104163 carries those forward and nothing else — just Verified locally on master HEAD Co-authors carried forward: @Avogar (test author), @nihalzp (original wording reviewer). |
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]>
…4-double-dot-test-takeover-v2 Add tests for parseDateTime64BestEffort duplicate fractional separator (takeover of ClickHouse#102890 / supersede ClickHouse#103717)
Supersedes #102890 (per @alexey-milovidov's directive on #102890 (comment)).
@Avogar's branch had stale CI failures from infrastructure issues that have since been fixed on master. This PR replays his three commits (preserving him as
Author) onto fresh master so the CI re-runs cleanly. No code changes vs. PR #102890 HEAD — including @nihalzp's wording-suggestion commit, which was already applied there.Why this matters
Closes the chronic UBSAN bug at
src/IO/parseDateTimeBestEffort.cpp:79–82(signed integer overflow inreadDecimalNumberon inputs like'12:34:56.123456789012345678.987654321'). Thefunction_prop_fuzzerlane has been hitting this on ~30+ unrelated PRs over the past ~14 days. Once this lands, that whole class of failures clears across affected PRs.What the fix does
Adds an explicit
has_fractional_separatorflag tracked independently from digit count. The previous check (fractional->digits == 0) missed the boundary case where the first.had zero digits before it (e.g.12:34:56..123). The new flag rejects any second.unconditionally with a clearer error message ("Cannot read DateTime: duplicate fractional separator").Regression test added at
tests/queries/0_stateless/04101_parseDateTime64BestEffort_double_dot_fractional.sqlcovering:12:34:56..123(back-to-back separators)12:34:56.123.456(separator-digits-separator-digits)12:34:56.123456789012345678.987654321(the long-overflow trigger)All three forms tested for the strict,
OrNull, andOrZerovariants.Reviews carried over
505ca788) and his inline wording suggestion is included in commit 3 here.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix possible signed integer overflow in
parseDateTime64BestEffortand itsOrNull/OrZerovariants when the input contains duplicate fractional separators (e.g.'12:34:56..123'or'12:34:56.123456789012345678.987654321'). Such inputs are now rejected with a clear error message instead of triggering undefined behavior.Documentation entry for user-facing changes
Co-authored-by: avogar [email protected]
Co-authored-by: Pavel Kruglov [email protected]
Co-authored-by: Nihal Z. Miaji [email protected]