Cherry-pick: Respect use_client_time_zone for string datetime literals parsed on the server#2047
Cherry-pick: Respect use_client_time_zone for string datetime literals parsed on the server#2047zvonand wants to merge 2 commits into
Conversation
…se-client-time-zone-108038 Respect use_client_time_zone for string datetime literals parsed on the server
CI triage for #2047Verdict: not green. 1 failure is PR-caused, the rest are pre-existing / infra / flaky. The one real, PR-caused failure is the new test this PR adds — 🔴 PR-caused —
|
| Check | Classification | Evidence |
|---|---|---|
| DCO | Housekeeping | The port commit b0005d3 (a re-used upstream merge commit) has no Signed-off-by: trailer. Needs a sign-off/rebase or a maintainer override; not a code issue. |
Grype Scan ×3 (keeper, server, server-alpine) + GrypeScanKeeper/GrypeScanServer jobs |
Infra / pre-existing | CVE scans of the built Docker images. A client-side C++ timezone change cannot affect image contents; these fail branch-wide independent of this PR. |
RegressionTestsRelease / S3Export (part) & Regression x86 s3_export_part (14/85 scenarios) |
Pre-existing / flaky infra | Server-side S3 export against MinIO — unrelated to client literal parsing. Note the sibling regressions passed: Regression x86 swarms (1488 ok) and s3_export_partition (7/7 ok). |
Other stateless failures besides 04401: 03321_clickhouse_local_initialization_not_too_slow_even_under_sanitizers (timing/perf), 01710_projection_additional_filters, 04299_constraint_subst_correlated_subquery_root, 04340_datalake_schema_deep_recursion, 04409/04410_explain_actions_secret_args |
Pre-existing / flaky on antalya‑25.8 | None touch client timezones; this PR only changes programs/client/Client.cpp + src/Client/ClientBase.{cpp,h} + the new test. |
| FinishCIReport, PR | Aggregate gates | Red only because of the checks above; no independent error. |
Bottom line: the port applied cleanly, but the feature it backports is not fully functional for async inserts on antalya‑25.8 — that's the only thing this PR needs to resolve before merge. The remaining red is noise you'd see on the base branch too.
🤖 Automated CI triage by @blau-ai. I can't build/run ClickHouse in-container; the async root cause above is a lead to validate on a build, not a tested conclusion.
…r-side DateTime parsing Test 04401_async_insert_use_client_time_zone (from ClickHouse#109051) requires the server to respect session_timezone when parsing DateTime text into columns without an explicit timezone. Upstream has this since PR ClickHouse#100647 (26.4, backported to 26.3/26.2) but stable-25.8 does not, so async inserts (TCP) and all inserts over HTTP were parsed in the server timezone. - DataTypeDateTime/DataTypeDateTime64: resolve the effective timezone (respects session_timezone via DateLUT::instance()) when creating the default serialization. Adapted from upstream doGetSerialization() to 25.8's doGetDefaultSerialization() API (no serialization object pool). - MutationsDateTimeLiteralVisitor: wrap DateTime string literals in mutation predicates/assignments with explicit toDateTime(..., tz) at ALTER time, since background mutation threads lack the session context. Adapted make_intrusive -> std::make_shared for 25.8 AST pointers. - Tests from the upstream PR: 02737 update, 04056, 04057. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Cherry-picked from ClickHouse#109051.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fixed
use_client_time_zonebeing ignored forDateTime/DateTime64string literals interpreted on the server (asynchronousINSERT,SELECTliterals). The client now propagates its local time zone assession_timezonewhenuse_client_time_zoneis enabled, so server-side parsing matches the synchronousINSERTpath (ClickHouse#109051 by @groeneai).CI/CD Options
Exclude tests:
Regression jobs to run: