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

toTimeZone function throw an error when no constant string is provided #48471

Merged
merged 5 commits into from
Apr 13, 2023

Conversation

jrdi
Copy link
Contributor

@jrdi jrdi commented Apr 6, 2023

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

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

toTimeZone function throw a ILLEGAL_TYPE_OF_ARGUMENT error when no constant string is provided

Closes #16414

@jrdi jrdi marked this pull request as ready for review April 6, 2023 11:42
@tavplubix tavplubix added the can be tested Allows running workflows for external contributors label Apr 6, 2023
@tavplubix tavplubix self-assigned this Apr 6, 2023
@robot-ch-test-poll robot-ch-test-poll added the pr-bugfix Pull request with bugfix, not backported by default label Apr 12, 2023
@tavplubix
Copy link
Member

Tests were OK on 69790b7
Upgrade check - #48732

Let's wait for Fast test and merge

@tavplubix tavplubix merged commit 0fbc958 into ClickHouse:master Apr 13, 2023
119 of 136 checks passed
@jrdi jrdi deleted the 16414-totimezone-throw branch April 13, 2023 15:09
rschu1ze added a commit to rschu1ze/ClickHouse that referenced this pull request Jun 10, 2023
SQL function toTimezone() converts a Date or DateTime into another
timezone. The problem is that the timezone is part of the Date /
DateTime type but not part of the internal representation (value). This
led to the fact that toTimeZone() wqith non-const timezones produced
wrong and misleading results until ClickHouse#48471 (shipped with v23.4) enforced
a const timezone.

Unfortunately, this PR also broke existing table definitions with
non-const timezones, e.g. in ALIAS expressions. So while ClickHouse#48471
addressed the issue appropriately, it is really backwards-incompatible.

This PR adds a setting to toggle the behavior and makes it also part of
the compatibility profile.
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-bugfix Pull request with bugfix, not backported by default
Projects
None yet
Development

Successfully merging this pull request may close these issues.

toTimeZone does not throw an error about non-constant timezone
4 participants