From c3b7abaa8b01162822acfce1ac4f66b2e5f5ef2f Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 6 Jul 2018 22:47:08 +0300 Subject: [PATCH] Added another test #2115 --- .../00662_array_has_nullable.reference | 56 +++++++++++++++ .../0_stateless/00662_array_has_nullable.sql | 72 +++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00662_array_has_nullable.reference create mode 100644 dbms/tests/queries/0_stateless/00662_array_has_nullable.sql diff --git a/dbms/tests/queries/0_stateless/00662_array_has_nullable.reference b/dbms/tests/queries/0_stateless/00662_array_has_nullable.reference new file mode 100644 index 00000000000..4eaf464d148 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00662_array_has_nullable.reference @@ -0,0 +1,56 @@ +1 +1 +0 +0 +1 +1 +0 +1 +1 +1 +0 +0 +1 +1 +0 +1 +1 +1 +0 +1 +1 +0 +1 +1 +0 +1 +1 +0 +1 +1 +0 +0 +1 +1 +0 +1 +1 +1 +0 +0 +1 +1 +0 +1 +1 +1 +0 +1 +1 +0 +1 +1 +0 +1 +1 +0 diff --git a/dbms/tests/queries/0_stateless/00662_array_has_nullable.sql b/dbms/tests/queries/0_stateless/00662_array_has_nullable.sql new file mode 100644 index 00000000000..6011416dea0 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00662_array_has_nullable.sql @@ -0,0 +1,72 @@ +SELECT has(['a', 'b'], 'a'); +SELECT has(['a', 'b'], 'b'); +SELECT has(['a', 'b'], 'c'); +SELECT has(['a', 'b'], NULL); + +SELECT has(['a', NULL, 'b'], 'a'); +SELECT has(['a', NULL, 'b'], 'b'); +SELECT has(['a', NULL, 'b'], 'c'); +SELECT has(['a', NULL, 'b'], NULL); + +SELECT has(materialize(['a', 'b']), 'a'); +SELECT has(materialize(['a', 'b']), 'b'); +SELECT has(materialize(['a', 'b']), 'c'); +SELECT has(materialize(['a', 'b']), NULL); + +SELECT has(materialize(['a', NULL, 'b']), 'a'); +SELECT has(materialize(['a', NULL, 'b']), 'b'); +SELECT has(materialize(['a', NULL, 'b']), 'c'); +SELECT has(materialize(['a', NULL, 'b']), NULL); + +SELECT has(['a', 'b'], materialize('a')); +SELECT has(['a', 'b'], materialize('b')); +SELECT has(['a', 'b'], materialize('c')); + +SELECT has(['a', NULL, 'b'], materialize('a')); +SELECT has(['a', NULL, 'b'], materialize('b')); +SELECT has(['a', NULL, 'b'], materialize('c')); + +SELECT has(materialize(['a', 'b']), materialize('a')); +SELECT has(materialize(['a', 'b']), materialize('b')); +SELECT has(materialize(['a', 'b']), materialize('c')); + +SELECT has(materialize(['a', NULL, 'b']), materialize('a')); +SELECT has(materialize(['a', NULL, 'b']), materialize('b')); +SELECT has(materialize(['a', NULL, 'b']), materialize('c')); + + +SELECT has([111, 222], 111); +SELECT has([111, 222], 222); +SELECT has([111, 222], 333); +SELECT has([111, 222], NULL); + +SELECT has([111, NULL, 222], 111); +SELECT has([111, NULL, 222], 222); +SELECT has([111, NULL, 222], 333); +SELECT has([111, NULL, 222], NULL); + +SELECT has(materialize([111, 222]), 111); +SELECT has(materialize([111, 222]), 222); +SELECT has(materialize([111, 222]), 333); +SELECT has(materialize([111, 222]), NULL); + +SELECT has(materialize([111, NULL, 222]), 111); +SELECT has(materialize([111, NULL, 222]), 222); +SELECT has(materialize([111, NULL, 222]), 333); +SELECT has(materialize([111, NULL, 222]), NULL); + +SELECT has([111, 222], materialize(111)); +SELECT has([111, 222], materialize(222)); +SELECT has([111, 222], materialize(333)); + +SELECT has([111, NULL, 222], materialize(111)); +SELECT has([111, NULL, 222], materialize(222)); +SELECT has([111, NULL, 222], materialize(333)); + +SELECT has(materialize([111, 222]), materialize(111)); +SELECT has(materialize([111, 222]), materialize(222)); +SELECT has(materialize([111, 222]), materialize(333)); + +SELECT has(materialize([111, NULL, 222]), materialize(111)); +SELECT has(materialize([111, NULL, 222]), materialize(222)); +SELECT has(materialize([111, NULL, 222]), materialize(333));