Skip to content

Add regression test for session_timezone on LowCardinality(DateTime) - #106614

Merged
PedroTadim merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/test-106474-session-timezone-low-cardinality-datetime
Jun 10, 2026
Merged

PedroTadim merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/test-106474-session-timezone-low-cardinality-datetime

Conversation

@groeneai

@groeneai groeneai commented Jun 5, 2026 •

Copy link
Copy Markdown
Collaborator

Issue #106474 reported session_timezone ignored on a LowCardinality(DateTime) column (regression since v26.4). ClickGap could not reproduce on master or any release branch (26.5/26.4/26.3/25.8). A fresh local repro on master HEAD also passes — both DateTime and LowCardinality(DateTime) render with Asia/Tokyo when session_timezone is set. The bug appears to have been silently fixed in master without a closing PR.

This adds a regression test so any future break in the dictionary serialization path is caught immediately. The test covers three serialization paths:

  • the original constant-column shape from the report
  • a materialize-wrapped variant exercising the dictionary serializer directly
  • a Memory table round-trip exercising the full insert/read path

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Follow-up to issue ClickHouse#106474. The reporter saw `session_timezone` ignored on a
`LowCardinality(DateTime)` column on the public Fiddle (regression since v26.4).
ClickGap could not reproduce on master or any release branch (26.5/26.4/26.3/25.8),
and a fresh local repro on master HEAD also passes — both `DateTime` and
`LowCardinality(DateTime)` render with `Asia/Tokyo` when `session_timezone`
is set. The path was apparently fixed in master without a closing PR.

Add a regression test to lock in the current correct behavior so any future
regression in the dictionary serialization path is caught immediately. The test
covers three call sites that exercise different serialization paths:
- the original constant-column shape from the report
- a `materialize`-wrapped variant exercising the dictionary serializer directly
- a `Memory` table round-trip exercising the full insert/read serialization path

Closes: ClickHouse#106474

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@groeneai

groeneai commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator Author

Pre-PR validation gate

# Question Answer
a Deterministic repro? N/A — could not reproduce the original bug on master HEAD or any release branch (matches ClickGap's earlier note on the issue). The new test is a forward-looking regression check, not a repro of a live bug.
b Root cause explained? N/A — no code change. The original report ("regression since v26.4") appears to have been silently fixed in master between v26.4 and HEAD. Both DateTime and LowCardinality(DateTime) now render with Asia/Tokyo when session_timezone is set, on every format tested (TSV, CSV, JSONEachRow, Pretty, Vertical) and on the full Memory table round-trip.
c Fix matches root cause? N/A — no code change. Per @ Algunenano's "no speculative defensive code changes" directive, defaulting to a regression-test-only PR rather than blind C++ plumbing.
d Test intent preserved / new tests added? Yes. New stateless test 04322_106474_session_timezone_lowcardinality_datetime exercises three serialization shapes: constant-column (the original report's shape), materialize-wrapped (dictionary serializer), and a Memory table round-trip (full insert/read path). Any future regression in the dictionary path will be caught immediately.
e Both directions demonstrated? Forward direction only — passes on master HEAD 26.6.1.1. There is no "without fix" direction because there is no code change. The point is to lock in current correct behavior.
f Fix is general, not a narrow patch? N/A — no code change. The test itself is intentionally broader than the report's single shape so any future regression in any of the three serialization paths is caught, not just the constant-column path.

Session id: cron:clickhouse-ci-task-worker:20260605-215600

@groeneai

groeneai commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator Author

cc @yariks5s — could you review this? Test-only PR adding a regression test for issue #106474 (session_timezone on LowCardinality(DateTime)). The original report's bug does not reproduce on master HEAD or any release branch (per ClickGap and a fresh local repro), so this just locks in the current correct behavior across three serialization paths.

@yariks5s yariks5s self-assigned this Jun 5, 2026
@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Jun 6, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jun 6, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [e79a0f9]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_tsan, s3 storage, parallel, 2/2) ERROR IGNORED

AI Review

Summary

This PR adds stateless regression coverage for session_timezone on LowCardinality(DateTime), matching the linked issue's constant-column reproducer and adding materialized and Memory table shapes. I found no correctness, reliability, or PR metadata issues that need inline comments.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jun 6, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.40% 84.40% +0.00%
Functions 92.30% 92.30% +0.00%
Branches 77.00% 77.00% +0.00%

Changed lines: No C/C++ source files changed — skipping uncovered code analysis.

Newly covered by added/modified tests: 346 line(s), 2 function(s) across 124 file(s) · Details

Top files
  • src/Databases/PostgreSQL/fetchPostgreSQLTableStructure.cpp: 23 line(s)
  • src/Storages/StorageReplicatedMergeTree.cpp: 19 line(s)
  • src/Disks/IO/CachedOnDiskWriteBufferFromFile.cpp: 15 line(s)
  • src/Storages/MergeTree/ReplicatedMergeTreeRestartingThread.cpp: 12 line(s)
  • src/Functions/TimeSeries/TimeSeriesTagsFunctionHelpers.cpp: 11 line(s)

Full report

@groeneai

groeneai commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator Author

CI finished on e79a0f9a37a1. One red check: Stateless tests (amd_tsan, s3 storage, parallel, 2/2). Job-level error during the Collect logs post-test phase: Error waiting for container: Canceled: grpc: the client connection is closing: context canceled. Runner-side docker cancellation during system-tables scraping, not a test failure: zero per-test FAIL or ERROR rows in CIDB for this run, and the only files changed in this PR are 2 stateless test files (tests/queries/0_stateless/04322_106474_session_timezone_lowcardinality_datetime.{sql,reference}).

Cross-PR check: 9 hits across 8 distinct PRs in 30 days for this exact Error waiting for container: Canceled pattern on Stateless tests (amd_tsan, s3 storage, parallel, 2/2). Chronic post-test infra noise, unrelated to this regression-test-only PR.

Mergeable Check and PR aggregators are FAILURE because the underlying job errored; same root cause.

Session: cron:our-pr-ci-monitor:20260606-060000

@PedroTadim

Copy link
Copy Markdown
Member

@groeneai I updated the issue with the reproducible, check.

@PedroTadim
PedroTadim added this pull request to the merge queue Jun 10, 2026
Merged via the queue into ClickHouse:master with commit 30aabdb Jun 10, 2026
164 of 166 checks passed
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants