From f798b29111df99621f09c1599f8b569d1cae00fe Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 10 Sep 2018 07:08:43 +0300 Subject: [PATCH] Added test [#CLICKHOUSE-3888] --- .../00697_in_subquery_remote.reference | 60 +++++++++++++++++++ .../0_stateless/00697_in_subquery_remote.sql | 25 ++++++++ 2 files changed, 85 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00697_in_subquery_remote.reference create mode 100644 dbms/tests/queries/0_stateless/00697_in_subquery_remote.sql diff --git a/dbms/tests/queries/0_stateless/00697_in_subquery_remote.reference b/dbms/tests/queries/0_stateless/00697_in_subquery_remote.reference new file mode 100644 index 00000000000..ce705b56040 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00697_in_subquery_remote.reference @@ -0,0 +1,60 @@ +1 +0 +1 +0 +1 +0 +1 +1 +0 +0 +0 +1 +0 +0 +0 +0 +0 +0 +1 +0 +0 +1 +0 +0 +0 +0 +0 +0 +1 +0 +1 +1 +90 +1 +1 +0 +0 +0 +1 +0 +0 +0 +0 +0 +0 +1 +0 +0 +1 +0 +0 +0 +0 +0 +0 +1 +0 +1 +1 +90 diff --git a/dbms/tests/queries/0_stateless/00697_in_subquery_remote.sql b/dbms/tests/queries/0_stateless/00697_in_subquery_remote.sql new file mode 100644 index 00000000000..1e32a587fb3 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00697_in_subquery_remote.sql @@ -0,0 +1,25 @@ +SELECT 0 IN 0; +SELECT 0 IN 1; +SELECT 0 IN (SELECT 0); +SELECT 0 IN (SELECT 1); + +SELECT dummy IN (SELECT 0) FROM remote('127.0.0.1', system.one); +SELECT dummy IN (SELECT 1) FROM remote('127.0.0.1', system.one); + +SELECT dummy IN (SELECT 0) FROM remote('127.0.0.{1,2}', system.one); +SELECT dummy IN (SELECT 1) FROM remote('127.0.0.{1,2}', system.one); + +SELECT number IN (SELECT toUInt64(arrayJoin([1, 8]))) FROM remote('127.0.0.{1,2}', numbers(10)); + +SELECT arrayExists(x -> (x IN (SELECT 1)), [1]) FROM remote('127.0.0.{1,2}', system.one); +SELECT sumIf(number, arrayExists(x -> (x IN (SELECT 1)), [1])) FROM remote('127.0.0.{1,2}', numbers(10)); + +SET prefer_localhost_replica = 0; + +SELECT dummy IN (SELECT 0) FROM remote('127.0.0.{1,2}', system.one); +SELECT dummy IN (SELECT 1) FROM remote('127.0.0.{1,2}', system.one); + +SELECT number IN (SELECT toUInt64(arrayJoin([1, 8]))) FROM remote('127.0.0.{1,2}', numbers(10)); + +SELECT arrayExists(x -> (x IN (SELECT 1)), [1]) FROM remote('127.0.0.{1,2}', system.one); +SELECT sumIf(number, arrayExists(x -> (x IN (SELECT 1)), [1])) FROM remote('127.0.0.{1,2}', numbers(10));