mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Fix issue
This commit is contained in:
parent
671395e8c8
commit
f48bf2aaba
@ -985,9 +985,18 @@ public:
|
|||||||
if (time >= values.time_at_offset_change())
|
if (time >= values.time_at_offset_change())
|
||||||
time += values.amount_of_offset_change();
|
time += values.amount_of_offset_change();
|
||||||
|
|
||||||
res.time.second = time % 60;
|
if (unlikely(time < 0))
|
||||||
res.time.minute = time / 60 % 60;
|
{
|
||||||
res.time.hour = time / 3600;
|
res.time.second = 0;
|
||||||
|
res.time.minute = 0;
|
||||||
|
res.time.hour = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
res.time.second = time % 60;
|
||||||
|
res.time.minute = time / 60 % 60;
|
||||||
|
res.time.hour = time / 3600;
|
||||||
|
}
|
||||||
|
|
||||||
/// In case time was changed backwards at the start of next day, we will repeat the hour 23.
|
/// In case time was changed backwards at the start of next day, we will repeat the hour 23.
|
||||||
if (unlikely(res.time.hour > 23))
|
if (unlikely(res.time.hour > 23))
|
||||||
|
@ -6,4 +6,4 @@ SELECT toString(toDateTime('9922337203.6854775808', 1));
|
|||||||
SELECT toDateTime64(CAST('10000000000.1' AS Decimal64(1)), 1);
|
SELECT toDateTime64(CAST('10000000000.1' AS Decimal64(1)), 1);
|
||||||
2283-11-11 23:46:40.1
|
2283-11-11 23:46:40.1
|
||||||
SELECT toDateTime64(CAST('-10000000000.1' AS Decimal64(1)), 1);
|
SELECT toDateTime64(CAST('-10000000000.1' AS Decimal64(1)), 1);
|
||||||
1925-01-01 23:09:20.1
|
1925-01-01 00:00:00.1
|
||||||
|
Loading…
Reference in New Issue
Block a user