mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
added test
This commit is contained in:
parent
8e28ba2583
commit
a2b768ec10
@ -0,0 +1,4 @@
|
||||
1 1 1 1
|
||||
1 1 1 1
|
||||
1 1 1 1
|
||||
1 1 1 1
|
39
tests/queries/0_stateless/02313_negative_datetime64.sql
Normal file
39
tests/queries/0_stateless/02313_negative_datetime64.sql
Normal file
@ -0,0 +1,39 @@
|
||||
-- Before UNIX epoch
|
||||
WITH
|
||||
toDateTime64('1959-09-16 19:20:12.999999998', 9, 'UTC') AS dt1,
|
||||
toDateTime64('1959-09-16 19:20:12.999999999', 9, 'UTC') AS dt2
|
||||
SELECT
|
||||
dt1 < dt2,
|
||||
(dt1 + INTERVAL 1 NANOSECOND) = dt2,
|
||||
(dt1 + INTERVAL 2 NANOSECOND) > dt2,
|
||||
(dt1 + INTERVAL 3 NANOSECOND) > dt2;
|
||||
|
||||
-- At UNIX epoch border
|
||||
WITH
|
||||
toDateTime64('1969-12-31 23:59:59.999999998', 9, 'UTC') AS dt1,
|
||||
toDateTime64('1969-12-31 23:59:59.999999999', 9, 'UTC') AS dt2
|
||||
SELECT
|
||||
dt1 < dt2,
|
||||
(dt1 + INTERVAL 1 NANOSECOND) = dt2,
|
||||
(dt1 + INTERVAL 2 NANOSECOND) > dt2,
|
||||
(dt1 + INTERVAL 3 NANOSECOND) > dt2;
|
||||
|
||||
-- After UNIX epoch
|
||||
WITH
|
||||
toDateTime64('2001-12-31 23:59:59.999999998', 9, 'UTC') AS dt1,
|
||||
toDateTime64('2001-12-31 23:59:59.999999999', 9, 'UTC') AS dt2
|
||||
SELECT
|
||||
dt1 < dt2,
|
||||
(dt1 + INTERVAL 1 NANOSECOND) = dt2,
|
||||
(dt1 + INTERVAL 2 NANOSECOND) > dt2,
|
||||
(dt1 + INTERVAL 3 NANOSECOND) > dt2;
|
||||
|
||||
-- At upper DT64 bound (DT64 precision is lower here by design)
|
||||
WITH
|
||||
toDateTime64('2282-12-31 23:59:59.999998', 6, 'UTC') AS dt1,
|
||||
toDateTime64('2282-12-31 23:59:59.999999', 6, 'UTC') AS dt2
|
||||
SELECT
|
||||
dt1 < dt2,
|
||||
(dt1 + INTERVAL 1 MICROSECOND) = dt2,
|
||||
(dt1 + INTERVAL 2 MICROSECOND) > dt2,
|
||||
(dt1 + INTERVAL 3 MICROSECOND) > dt2;
|
Loading…
Reference in New Issue
Block a user