From e635b47299337ba6e79d76ad17ebc58e67f1a01e Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 29 Nov 2020 10:43:34 +0300 Subject: [PATCH] Add a test for StorageJoin and UUID --- .../01594_storage_join_uuid.reference | 1 + .../0_stateless/01594_storage_join_uuid.sql | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 tests/queries/0_stateless/01594_storage_join_uuid.reference create mode 100644 tests/queries/0_stateless/01594_storage_join_uuid.sql diff --git a/tests/queries/0_stateless/01594_storage_join_uuid.reference b/tests/queries/0_stateless/01594_storage_join_uuid.reference new file mode 100644 index 00000000000..44964b11f68 --- /dev/null +++ b/tests/queries/0_stateless/01594_storage_join_uuid.reference @@ -0,0 +1 @@ +00000000-0000-0000-0000-000000000000 diff --git a/tests/queries/0_stateless/01594_storage_join_uuid.sql b/tests/queries/0_stateless/01594_storage_join_uuid.sql new file mode 100644 index 00000000000..9236e9d0cc4 --- /dev/null +++ b/tests/queries/0_stateless/01594_storage_join_uuid.sql @@ -0,0 +1,29 @@ +-- the test from simPod, https://github.com/ClickHouse/ClickHouse/issues/5608 + +DROP TABLE IF EXISTS joint; -- the table name from the original issue. +DROP TABLE IF EXISTS t; + +CREATE TABLE IF NOT EXISTS joint +( + id UUID, + value LowCardinality(String) +) +ENGINE = Join (ANY, LEFT, id); + +CREATE TABLE IF NOT EXISTS t +( + id UUID, + d DateTime +) +ENGINE = MergeTree +PARTITION BY toDate(d) +ORDER BY id; + +insert into joint VALUES ('00000000-0000-0000-0000-000000000000', 'yo'); +insert into t VALUES ('00000000-0000-0000-0000-000000000000', now()); + +SELECT id FROM t +ANY LEFT JOIN joint ON t.id = joint.id; + +DROP TABLE joint; +DROP TABLE t;