From c2a32990bb26641cf833858b7b4a5b47ea1d258a Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sat, 5 Aug 2017 07:11:42 +0300 Subject: [PATCH] Added test [#CLICKHOUSE-2]. --- .../00487_if_array_fixed_string.reference | 16 ++++++++++++++++ .../0_stateless/00487_if_array_fixed_string.sql | 4 ++++ 2 files changed, 20 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00487_if_array_fixed_string.reference create mode 100644 dbms/tests/queries/0_stateless/00487_if_array_fixed_string.sql diff --git a/dbms/tests/queries/0_stateless/00487_if_array_fixed_string.reference b/dbms/tests/queries/0_stateless/00487_if_array_fixed_string.reference new file mode 100644 index 00000000000..df2f576f3b9 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00487_if_array_fixed_string.reference @@ -0,0 +1,16 @@ +['a\0\0\0\0','b\0\0\0\0','c\0\0\0\0'] +['hello','world'] +['a\0\0\0\0','b\0\0\0\0','c\0\0\0\0'] +['hello','world'] +['a\0\0\0\0','b\0\0\0\0','c\0\0\0\0'] +['hello','world'] +['a\0\0\0\0','b\0\0\0\0','c\0\0\0\0'] +['hello','world'] +['a\0\0\0\0','b\0\0\0\0','c\0\0\0\0'] +['hello','world'] +['a\0\0\0\0','b\0\0\0\0','c\0\0\0\0'] +['hello','world'] +['a\0\0\0\0','b\0\0\0\0','c\0\0\0\0'] +['hello','world'] +['a\0\0\0\0','b\0\0\0\0','c\0\0\0\0'] +['hello','world'] diff --git a/dbms/tests/queries/0_stateless/00487_if_array_fixed_string.sql b/dbms/tests/queries/0_stateless/00487_if_array_fixed_string.sql new file mode 100644 index 00000000000..743b88dac07 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00487_if_array_fixed_string.sql @@ -0,0 +1,4 @@ +SELECT number % 2 ? arrayMap(x -> toFixedString(x, 5), ['hello', 'world']) : arrayMap(x -> toFixedString(x, 5), ['a', 'b', 'c']) FROM system.numbers LIMIT 4; +SELECT number % 2 ? materialize(arrayMap(x -> toFixedString(x, 5), ['hello', 'world'])) : arrayMap(x -> toFixedString(x, 5), ['a', 'b', 'c']) FROM system.numbers LIMIT 4; +SELECT number % 2 ? arrayMap(x -> toFixedString(x, 5), ['hello', 'world']) : materialize(arrayMap(x -> toFixedString(x, 5), ['a', 'b', 'c'])) FROM system.numbers LIMIT 4; +SELECT number % 2 ? materialize(arrayMap(x -> toFixedString(x, 5), ['hello', 'world'])) : materialize(arrayMap(x -> toFixedString(x, 5), ['a', 'b', 'c'])) FROM system.numbers LIMIT 4;