mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
Added test for DateTime vs DateTime64 comparison
This commit is contained in:
parent
edc21aacbc
commit
5556c48298
@ -0,0 +1,3 @@
|
|||||||
|
-1 DateTime64(1, \'UTC\') < 1 1 1 <= 1 1 1 = 0 0 0 >= 0 0 0 > 0 0 0 != 1 1 1
|
||||||
|
0 DateTime64(1, \'UTC\') < 0 0 0 <= 1 1 1 = 1 1 1 >= 1 1 1 > 0 0 0 != 0 0 0
|
||||||
|
1 DateTime64(1, \'UTC\') < 0 0 0 <= 0 0 0 = 0 0 0 >= 1 1 1 > 1 1 1 != 1 1 1
|
@ -0,0 +1,42 @@
|
|||||||
|
SELECT
|
||||||
|
n,
|
||||||
|
toTypeName(dt64) AS dt64_typename,
|
||||||
|
|
||||||
|
'<',
|
||||||
|
dt64 < dt,
|
||||||
|
toDateTime(dt64) < dt,
|
||||||
|
dt64 < toDateTime64(dt, 1, 'UTC'),
|
||||||
|
|
||||||
|
'<=',
|
||||||
|
dt64 <= dt,
|
||||||
|
toDateTime(dt64) <= dt,
|
||||||
|
dt64 <= toDateTime64(dt, 1, 'UTC'),
|
||||||
|
|
||||||
|
'=',
|
||||||
|
dt64 = dt,
|
||||||
|
toDateTime(dt64) = dt,
|
||||||
|
dt64 = toDateTime64(dt, 1, 'UTC'),
|
||||||
|
|
||||||
|
'>=',
|
||||||
|
dt64 >= dt,
|
||||||
|
toDateTime(dt64) >= dt,
|
||||||
|
dt64 >= toDateTime64(dt, 1, 'UTC'),
|
||||||
|
|
||||||
|
'>',
|
||||||
|
dt64 > dt,
|
||||||
|
toDateTime(dt64) > dt,
|
||||||
|
dt64 > toDateTime64(dt, 1, 'UTC'),
|
||||||
|
|
||||||
|
'!=',
|
||||||
|
dt64 != dt,
|
||||||
|
toDateTime(dt64) != dt,
|
||||||
|
dt64 != toDateTime64(dt, 1, 'UTC')
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
number - 1 as n,
|
||||||
|
toDateTime64(toStartOfInterval(now(), toIntervalSecond(1), 'UTC'), 1, 'UTC') + n AS dt64,
|
||||||
|
toStartOfInterval(now(), toIntervalSecond(1), 'UTC') AS dt
|
||||||
|
FROM system.numbers
|
||||||
|
LIMIT 3
|
||||||
|
)
|
Loading…
Reference in New Issue
Block a user