diff --git a/dbms/tests/queries/0_stateless/00435_coalesce.reference b/dbms/tests/queries/0_stateless/00435_coalesce.reference new file mode 100644 index 00000000000..20b8288b09c --- /dev/null +++ b/dbms/tests/queries/0_stateless/00435_coalesce.reference @@ -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 diff --git a/dbms/tests/queries/0_stateless/00435_coalesce.sql b/dbms/tests/queries/0_stateless/00435_coalesce.sql new file mode 100644 index 00000000000..7c1c519bcb2 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00435_coalesce.sql @@ -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;