From 796c65a09ff98e93e094a5cd533bbfa0eb1c6f9e Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 16 Mar 2018 10:04:51 +0300 Subject: [PATCH] Added test [#CLICKHOUSE-2] --- .../0_stateless/00607_index_in_in.reference | 6 ++++++ .../queries/0_stateless/00607_index_in_in.sql | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00607_index_in_in.reference create mode 100644 dbms/tests/queries/0_stateless/00607_index_in_in.sql diff --git a/dbms/tests/queries/0_stateless/00607_index_in_in.reference b/dbms/tests/queries/0_stateless/00607_index_in_in.reference new file mode 100644 index 00000000000..a9e2f17562a --- /dev/null +++ b/dbms/tests/queries/0_stateless/00607_index_in_in.reference @@ -0,0 +1,6 @@ +1 +1 +1 +1 +1 +1 diff --git a/dbms/tests/queries/0_stateless/00607_index_in_in.sql b/dbms/tests/queries/0_stateless/00607_index_in_in.sql new file mode 100644 index 00000000000..a1e2efa6a71 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00607_index_in_in.sql @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS test.merge_tree; +CREATE TABLE test.merge_tree (x UInt32) ENGINE = MergeTree ORDER BY x SETTINGS index_granularity = 1; +INSERT INTO test.merge_tree VALUES (0), (1); + +SET force_primary_key = 1; +SET max_rows_to_read = 1; + +SELECT count() FROM test.merge_tree WHERE x = 0; +SELECT count() FROM test.merge_tree WHERE toUInt32(x) = 0; +SELECT count() FROM test.merge_tree WHERE toUInt64(x) = 0; + +SELECT count() FROM test.merge_tree WHERE x IN (0, 0); +SELECT count() FROM test.merge_tree WHERE toUInt32(x) IN (0, 0); +SELECT count() FROM test.merge_tree WHERE toUInt64(x) IN (0, 0); + +DROP TABLE test.merge_tree;