Skip to content

Date time timezone fix#24129

Merged
kitaisreal merged 5 commits intoClickHouse:masterfrom
kitaisreal:date-time-timezone-fix
Jun 29, 2021
Merged

Date time timezone fix#24129
kitaisreal merged 5 commits intoClickHouse:masterfrom
kitaisreal:date-time-timezone-fix

Conversation

@kitaisreal
Copy link
Copy Markdown
Contributor

@kitaisreal kitaisreal commented May 14, 2021

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Bug Fix

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
CAST from Date to DateTime (or DateTime64) was not using the timezone of the DateTime type. It can also affect the comparison between Date and DateTime. Inference of the common type for Date and DateTime also was not using the corresponding timezone. It affected the results of function if and array construction. Closes #24128.

@robot-clickhouse robot-clickhouse added the pr-bugfix Pull request with bugfix, not backported by default label May 14, 2021
@kitaisreal kitaisreal force-pushed the date-time-timezone-fix branch from 87b1700 to f3755c9 Compare May 14, 2021 20:07
@alexey-milovidov alexey-milovidov self-assigned this May 14, 2021
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can simply return t, no need to construct a new object.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then we can avoid typeid_cast :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@alexey-milovidov
Copy link
Copy Markdown
Member

Only a few changes required...

@kitaisreal kitaisreal force-pushed the date-time-timezone-fix branch from a3f0741 to 61b1163 Compare June 27, 2021 17:53
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add if and CAST.

@kitaisreal kitaisreal force-pushed the date-time-timezone-fix branch from d4c1047 to bd7bc6b Compare June 28, 2021 14:57
@kitaisreal kitaisreal force-pushed the date-time-timezone-fix branch from bd7bc6b to 764380f Compare June 28, 2021 16:56
robot-clickhouse pushed a commit that referenced this pull request Jun 30, 2021
robot-clickhouse pushed a commit that referenced this pull request Jun 30, 2021
kitaisreal added a commit that referenced this pull request Jul 1, 2021
Backport #24129 to 21.3: Date time timezone fix
kitaisreal added a commit that referenced this pull request Jul 1, 2021
Backport #24129 to 21.6: Date time timezone fix
kitaisreal added a commit that referenced this pull request Jul 1, 2021
Backport #24129 to 21.5: Date time timezone fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TimeZone is ignored in function if with Date and DateTime

3 participants