From 73b5df4de5f174b30c805541a0dbf95179a0f14a Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 27 Apr 2020 01:19:20 +0300 Subject: [PATCH] Added a test from @reqq #5155 --- .../01266_default_prewhere_reqq.reference | 1 + .../0_stateless/01266_default_prewhere_reqq.sql | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 tests/queries/0_stateless/01266_default_prewhere_reqq.reference create mode 100644 tests/queries/0_stateless/01266_default_prewhere_reqq.sql diff --git a/tests/queries/0_stateless/01266_default_prewhere_reqq.reference b/tests/queries/0_stateless/01266_default_prewhere_reqq.reference new file mode 100644 index 00000000000..c51afdb6658 --- /dev/null +++ b/tests/queries/0_stateless/01266_default_prewhere_reqq.reference @@ -0,0 +1 @@ +0 bbb_aaa diff --git a/tests/queries/0_stateless/01266_default_prewhere_reqq.sql b/tests/queries/0_stateless/01266_default_prewhere_reqq.sql new file mode 100644 index 00000000000..a192a7e785d --- /dev/null +++ b/tests/queries/0_stateless/01266_default_prewhere_reqq.sql @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; + +CREATE TABLE t1 +( + date Date, + s1 String, + s2 String +) ENGINE = MergeTree() PARTITION BY toYYYYMMDD(date) ORDER BY (date, s1) +SETTINGS index_granularity = 8192; + +insert into t1 (date, s1,s2) values(today()-1,'aaa','bbb'); +alter table t1 add column s3 String DEFAULT concat(s2,'_',s1); +insert into t1 (date, s1,s2) values(today(),'aaa2','bbb2'); +select ignore(date), s3 from t1 where s2='bbb'; + +DROP TABLE t1;