Cherry-pick: Respect use_client_time_zone for string datetime literals parsed on the server#2046
Cherry-pick: Respect use_client_time_zone for string datetime literals parsed on the server#2046zvonand wants to merge 3 commits into
Conversation
…se-client-time-zone-108038 Respect use_client_time_zone for string datetime literals parsed on the server
CI triageVerdict: 2 red checks — 0 are a real code problem in this port. 1 is a metadata/sign-off issue, 1 is an unrelated flaky test. The 1. DCO — ❌ metadata, PR-related but not a code issue
The cherry-picked commit message has no Fix (needs a human — I don't force-push, and this is the PR head branch, not a git checkout releasy/port/pr-109051-a7e5ac
git commit --amend --signoff --no-edit
git push --force-with-lease origin releasy/port/pr-109051-a7e5ac(If you'd rather not amend, DCO also accepts a separate empty remediation commit — see the "add remediation commit" option in the check output. Amending the single commit is cleaner here.) 2. Fast test — ❌ one flaky test, not related to this PRFailing test: The only differing column is the 12th value — Evidence it isn't this PR:
Next step: safe to re-run ("Fast test" only). If it recurs, it's a pre-existing flake in Note on validation of the port itselfThe new test that actually exercises this fix ( |
CI triageVerdict: exactly one failure is caused by this PR — the new test 1.
|
…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: