Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve behaviour of conversion into Date for boundary value 65535 - … #46042

Merged
merged 2 commits into from
Feb 10, 2023

Conversation

jh0x
Copy link
Contributor

@jh0x jh0x commented Feb 4, 2023

#43370 describes a bit weird behaviour when dealing with column of Date type

For Date (underlying UInt16) we have:

Supported range of values: [1970-01-01, 2149-06-06].

I think the behaviour after the fix is more consistent.

Closes #43370

Previous fix (#45914) had to be reverted - as one of the tests was written in a way that broke in some of the timezones.
In that test I was converting 65536 to Date -> and this invokes timezone aware conversion (time_zone.toDayNum(std::min(time_t(from), time_t(0xFFFFFFFF))) -> which resulted in either 1970-01-01 or 1970-01-02. The test has now be rewritten to avoid the problems.
I had tested a mix of the following timezones: TZ=Australia/Brisbane, TZ=America/Chicago, TZ=Europe/London, TZ=Pacific/Tarawa.

Changelog category (leave one):

  • Improvement

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

Improve behaviour of conversion into Date for boundary value 65535 (2149-06-06)

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/

@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-improvement Pull request with some product improvements label Feb 4, 2023
@ucasfl ucasfl added the can be tested Allows running workflows for external contributors label Feb 4, 2023
@jh0x jh0x force-pushed the improve-into-date-from-uint16 branch from f43b8de to e1f345c Compare February 4, 2023 19:50
@CheSema
Copy link
Member

CheSema commented Feb 9, 2023

test_merge_tree_s3_failover/test.py::test_move_failover flaky #46230

@pufit pufit merged commit 19a2fba into ClickHouse:master Feb 10, 2023
@pufit pufit self-assigned this Feb 14, 2023
@jh0x jh0x deleted the improve-into-date-from-uint16 branch February 21, 2023 16:43
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-improvement Pull request with some product improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

toDate conversion does not match Date column conversion
5 participants