Make Date larger then 2106-02-07 overflow as 0(1970-01-01)#18565
Merged
CurtizJ merged 2 commits intoClickHouse:masterfrom Dec 30, 2020
Merged
Make Date larger then 2106-02-07 overflow as 0(1970-01-01)#18565CurtizJ merged 2 commits intoClickHouse:masterfrom
CurtizJ merged 2 commits intoClickHouse:masterfrom
Conversation
CurtizJ
requested changes
Dec 29, 2020
base/common/DateLUTImpl.h
Outdated
| return DayNum(0); // TODO (nemkov, DateTime64 phase 2): implement creating real date for year outside of LUT range. | ||
|
|
||
| // The day after 2106-02-07 will not stored fully as struct Values, so just overflow it as 0 | ||
| if (unlikely(year == DATE_LUT_MAX_YEAR && (month > 2 || day_of_month > 7))) |
Member
There was a problem hiding this comment.
But this condition is not correct. It will overflow also all dates in [2106-01-08; 2106-01-31].
Contributor
Author
There was a problem hiding this comment.
O, yes, it's wrong, I will fix this
CurtizJ
approved these changes
Dec 30, 2020
This was referenced Dec 30, 2020
Closed
Closed
Closed
This was referenced Feb 17, 2021
Merged
CurtizJ
added a commit
that referenced
this pull request
Feb 19, 2021
Backport #18565 to 20.8: Make Date larger then 2106-02-07 overflow as 0(1970-01-01)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix previous bug when date overflow with different values.
Strict Date value limit to "2106-02-07", cast date > "2106-02-07" to value 0.
Detailed description / Documentation draft:
Previous bug: