From 139f85523080a70a55cee7a328c2c40c4e5adac6 Mon Sep 17 00:00:00 2001 From: VadimPE Date: Tue, 28 Aug 2018 17:26:12 +0300 Subject: [PATCH] CLICKHOUSE-3934 add tests --- .../00701_join_default_strictness.reference | 12 ++++++++++ .../00701_join_default_strictness.sql | 22 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00701_join_default_strictness.reference create mode 100644 dbms/tests/queries/0_stateless/00701_join_default_strictness.sql diff --git a/dbms/tests/queries/0_stateless/00701_join_default_strictness.reference b/dbms/tests/queries/0_stateless/00701_join_default_strictness.reference new file mode 100644 index 00000000000..3b7d0c49964 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00701_join_default_strictness.reference @@ -0,0 +1,12 @@ +1 1 +1 2 +1 3 +1 1 +1 1 +1 1 +1 2 +1 2 +1 2 +1 3 +1 3 +1 3 \ No newline at end of file diff --git a/dbms/tests/queries/0_stateless/00701_join_default_strictness.sql b/dbms/tests/queries/0_stateless/00701_join_default_strictness.sql new file mode 100644 index 00000000000..781fc45164f --- /dev/null +++ b/dbms/tests/queries/0_stateless/00701_join_default_strictness.sql @@ -0,0 +1,22 @@ +CREATE DATABASE IF NOT EXISTS test; +DROP TABLE IF EXISTS test.a1; +DROP TABLE IF EXISTS test.a2; + +CREATE TABLE test.a1(a UInt8, b UInt8) ENGINE=Memory; +CREATE TABLE test.a2(a UInt8, b UInt8) ENGINE=Memory; + +INSERT INTO test.a1 VALUES (1, 1); +INSERT INTO test.a1 VALUES (1, 2); +INSERT INTO test.a1 VALUES (1, 3); +INSERT INTO test.a2 VALUES (1, 2); +INSERT INTO test.a2 VALUES (1, 3); +INSERT INTO test.a2 VALUES (1, 4); + +SELECT a, b FROM test.a1 LEFT JOIN (SELECT a, b FROM test.a2) USING a ORDER BY b; -- { serverError 417 } + +SELECT a, b FROM test.a1 LEFT JOIN (SELECT a, b FROM test.a2) USING a ORDER BY b SETTINGS join_default_strictness='ANY'; + +SELECT a, b FROM test.a1 LEFT JOIN (SELECT a, b FROM test.a2) USING a ORDER BY b SETTINGS join_default_strictness='ALL'; + +DROP TABLE IF EXISTS test.a1; +DROP TABLE IF EXISTS test.a2; \ No newline at end of file