Fixed parsing DateTime64 value from string.

The time offset undeflowed on positive values.
This commit is contained in:
Vasily Nemkov 2021-08-11 18:19:55 +03:00
parent 3f7b96e15b
commit bdc4d9fe75
3 changed files with 3 additions and 1 deletions

View File

@ -955,7 +955,7 @@ public:
inline Time makeDateTime(Int16 year, UInt8 month, UInt8 day_of_month, UInt8 hour, UInt8 minute, UInt8 second) const
{
size_t index = makeLUTIndex(year, month, day_of_month);
UInt32 time_offset = hour * 3600 + minute * 60 + second;
Time time_offset = hour * 3600 + minute * 60 + second;
if (time_offset >= lut[index].time_at_offset_change())
time_offset -= lut[index].amount_of_offset_change();

View File

@ -0,0 +1 @@
2021-03-21 23:00:00.000

View File

@ -0,0 +1 @@
SELECT toDateTime64('2021-03-22', 3, 'Asia/Tehran');