mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Added tests [#CLICKHOUSE-2789].
This commit is contained in:
parent
ee0f0a8818
commit
3107156fd9
30
dbms/tests/queries/0_stateless/00433_ifnull.reference
Normal file
30
dbms/tests/queries/0_stateless/00433_ifnull.reference
Normal file
@ -0,0 +1,30 @@
|
||||
x String
|
||||
x String
|
||||
x String
|
||||
x String
|
||||
x String
|
||||
x String
|
||||
x Nullable(String)
|
||||
0 String
|
||||
1 String
|
||||
2 String
|
||||
3 String
|
||||
4 String
|
||||
0 String
|
||||
-1 String
|
||||
2 String
|
||||
3 String
|
||||
4 String
|
||||
0 String
|
||||
1 String
|
||||
2 String
|
||||
3 String
|
||||
4 String
|
||||
0 Nullable(String)
|
||||
-1 Nullable(String)
|
||||
2 Nullable(String)
|
||||
3 Nullable(String)
|
||||
4 Nullable(String)
|
||||
1 UInt8
|
||||
1 UInt8
|
||||
\N Null
|
19
dbms/tests/queries/0_stateless/00433_ifnull.sql
Normal file
19
dbms/tests/queries/0_stateless/00433_ifnull.sql
Normal file
@ -0,0 +1,19 @@
|
||||
SELECT ifNull('x', 'y') AS res, toTypeName(res);
|
||||
SELECT ifNull(materialize('x'), materialize('y')) AS res, toTypeName(res);
|
||||
|
||||
SELECT ifNull(toNullable('x'), 'y') AS res, toTypeName(res);
|
||||
SELECT ifNull(toNullable('x'), materialize('y')) AS res, toTypeName(res);
|
||||
|
||||
SELECT ifNull('x', toNullable('y')) AS res, toTypeName(res);
|
||||
SELECT ifNull(materialize('x'), toNullable('y')) AS res, toTypeName(res);
|
||||
|
||||
SELECT ifNull(toNullable('x'), toNullable('y')) AS res, toTypeName(res);
|
||||
|
||||
SELECT ifNull(toString(number), toString(-number)) AS res, toTypeName(res) FROM system.numbers LIMIT 5;
|
||||
SELECT ifNull(nullIf(toString(number), '1'), toString(-number)) AS res, toTypeName(res) FROM system.numbers LIMIT 5;
|
||||
SELECT ifNull(toString(number), nullIf(toString(-number), '-3')) AS res, toTypeName(res) FROM system.numbers LIMIT 5;
|
||||
SELECT ifNull(nullIf(toString(number), '1'), nullIf(toString(-number), '-3')) AS res, toTypeName(res) FROM system.numbers LIMIT 5;
|
||||
|
||||
SELECT ifNull(NULL, 1) AS res, toTypeName(res);
|
||||
SELECT ifNull(1, NULL) AS res, toTypeName(res);
|
||||
SELECT ifNull(NULL, NULL) AS res, toTypeName(res);
|
Loading…
Reference in New Issue
Block a user