Added test [#CLICKHOUSE-2789].

This commit is contained in:
Alexey Milovidov 2017-03-09 23:40:36 +03:00
parent abe0fca1a4
commit 75f1d7b820
2 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,46 @@
\N \N \N 1 1 1 1
0 Nullable(UInt64)
\N Nullable(UInt64)
2 Nullable(UInt64)
3 Nullable(UInt64)
4 Nullable(UInt64)
5 Nullable(UInt64)
6 Nullable(UInt64)
\N Nullable(UInt64)
8 Nullable(UInt64)
9 Nullable(UInt64)
10 Nullable(UInt64)
\N Nullable(UInt64)
12 Nullable(UInt64)
\N Nullable(UInt64)
14 Nullable(UInt64)
0 UInt64
1 UInt64
2 UInt64
3 UInt64
4 UInt64
5 UInt64
6 UInt64
7 UInt64
8 UInt64
9 UInt64
10 UInt64
11 UInt64
12 UInt64
13 UInt64
14 UInt64
0 UInt64
100 UInt64
2 UInt64
3 UInt64
4 UInt64
100 UInt64
6 UInt64
100 UInt64
8 UInt64
9 UInt64
10 UInt64
100 UInt64
12 UInt64
100 UInt64
14 UInt64

View File

@ -0,0 +1,6 @@
SELECT coalesce(), coalesce(NULL), coalesce(NULL, NULL),
coalesce(1), coalesce(1, NULL), coalesce(NULL, 1), coalesce(NULL, 1, NULL);
SELECT coalesce(number % 2 = 0 ? number : NULL, number % 3 = 0 ? number : NULL, number % 5 = 0 ? number : NULL) AS res, toTypeName(res) FROM system.numbers LIMIT 15;
SELECT coalesce(number % 2 = 0 ? number : NULL, number % 3 = 0 ? number : NULL, number) AS res, toTypeName(res) FROM system.numbers LIMIT 15;
SELECT coalesce(number % 2 = 0 ? number : NULL, number % 3 = 0 ? number : NULL, 100) AS res, toTypeName(res) FROM system.numbers LIMIT 15;