fix(expr): date_trunc
and +/-
on timestamptz
during DST jump-back
#13201
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
For context,
2023-11-05 01:59:59-07:00
is followed by2023-11-05 01:00:00-08:00
inUS/Pacific
.There are two
2023-11-05 01:40:00
in local time, corresponding to UTC time2023-11-05T08:40:00Z
(1699173600s since the unix epoch) and2023-11-05T09:40:00Z
(1699177200s since the unix epoch).And also two
2023-11-05 01:00:00
in local time, corresponding to UTC time2023-11-05T08:00:00Z
(1699171200s since the unix epoch) and2023-11-05T09:00:00Z
(1699174800s since the unix epoch).Fixes #12072
In short:
date_trunc
tohour
of2023-11-05 01:40:00
in Pacific Daylight Time (-07:00
) shall return2023-11-05 01:00:00
in Pacific Daylight Time, rather than Pacific Standard Time (-08:00
).date_trunc
tomicroseconds
of2023-11-05 08:40:00Z
and2023-11-05 09:35:00Z
underUS/Pacific
shall return them unchanged, rather than2023-11-05 09:40:00Z
and2023-11-05 09:35:00Z
(non-monotonic).set timezone = 'US/Pacific'
,'2023-11-05 01:40:00-07:00'::timestamptz + interval '5' minute
shall return2023-11-05 01:45:00-07:00
rather than2023-11-05 01:45:00-08:00
(which is 65 minutes later).Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.