From 5aba92a6bf17f8cdf4f77d58e3048910c6156b4d Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Tue, 13 Oct 2020 18:19:35 +0300 Subject: [PATCH] Added test. --- .../01521_global_in_prewhere_15792.reference | 1 + .../0_stateless/01521_global_in_prewhere_15792.sql | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 tests/queries/0_stateless/01521_global_in_prewhere_15792.reference create mode 100644 tests/queries/0_stateless/01521_global_in_prewhere_15792.sql diff --git a/tests/queries/0_stateless/01521_global_in_prewhere_15792.reference b/tests/queries/0_stateless/01521_global_in_prewhere_15792.reference new file mode 100644 index 00000000000..f7393e847d3 --- /dev/null +++ b/tests/queries/0_stateless/01521_global_in_prewhere_15792.reference @@ -0,0 +1 @@ +100000 diff --git a/tests/queries/0_stateless/01521_global_in_prewhere_15792.sql b/tests/queries/0_stateless/01521_global_in_prewhere_15792.sql new file mode 100644 index 00000000000..adb7bccd0df --- /dev/null +++ b/tests/queries/0_stateless/01521_global_in_prewhere_15792.sql @@ -0,0 +1,12 @@ +drop table if exists xp; +drop table if exists xp_d; + +create table xp(A Date, B Int64, S String) Engine=MergeTree partition by toYYYYMM(A) order by B; +insert into xp select '2020-01-01', number , '' from numbers(100000); + +create table xp_d as xp Engine=Distributed(test_shard_localhost, currentDatabase(), xp); + +select count() from xp_d prewhere toYYYYMM(A) global in (select toYYYYMM(min(A)) from xp_d) where B > -1; + +drop table if exists xp; +drop table if exists xp_d;