From 975e8575c78892c6217792221ce67a6c37306c05 Mon Sep 17 00:00:00 2001 From: proller Date: Mon, 9 Oct 2017 20:22:15 +0300 Subject: [PATCH] Add test (failed on version 1.1.54292) (#1328) * Tests: External: rename --use_http => --no_http and fix * Add test (failed on version 1.1.54292) --- .../0_stateless/00507_nullable.reference | 2 + .../queries/0_stateless/00507_nullable.sql | 41 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00507_nullable.reference create mode 100644 dbms/tests/queries/0_stateless/00507_nullable.sql diff --git a/dbms/tests/queries/0_stateless/00507_nullable.reference b/dbms/tests/queries/0_stateless/00507_nullable.reference new file mode 100644 index 00000000000..1c42f9991e2 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00507_nullable.reference @@ -0,0 +1,2 @@ +1970-01-02 2 0 FAILED 2 +still alive diff --git a/dbms/tests/queries/0_stateless/00507_nullable.sql b/dbms/tests/queries/0_stateless/00507_nullable.sql new file mode 100644 index 00000000000..46e7aef5614 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00507_nullable.sql @@ -0,0 +1,41 @@ +CREATE DATABASE IF NOT EXISTS test; +DROP TABLE IF EXISTS test.runs; +DROP TABLE IF EXISTS test.tests; + +CREATE TABLE test.runs +( + date Date, + id UInt64, + t_id UInt64, + status Enum8('OK' = 1, 'FAILED' = 2, 'SKIPPED' = 3, 'DISCOVERED' = 4), + run_id UInt64 DEFAULT id +) ENGINE = MergeTree(date, (t_id, id), 8192); + +CREATE TABLE test.tests +( + date Date, + id UInt64, + path Nullable(String), + suite_id Nullable(String) +) ENGINE = MergeTree(date, id, 8192); + +INSERT INTO test.tests (date, id) VALUES (1,1); +INSERT INTO test.runs (date, id) VALUES (1,1); +INSERT INTO test.runs (date, id, status) VALUES (1,2, 'FAILED'); +INSERT INTO test.tests (date, id, path) VALUES (1,2 ,'rtline1'); + +SELECT * +FROM test.runs AS r +WHERE (r.status = 'FAILED') AND ( +( + SELECT path + FROM test.tests AS t + WHERE t.id = r.id + LIMIT 1 +) LIKE 'rtline%') +LIMIT 1; + +SELECT 'still alive'; + +DROP TABLE test.runs; +DROP TABLE test.tests;