From 28bef7b7aaa2d864cc5627569fafe43f45b9135e Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Thu, 6 Sep 2018 12:46:23 +0300 Subject: [PATCH] Added test. [#CLICKHOUSE-3965] --- .../0_stateless/00712_prewhere_with_alias_bug.reference | 1 + .../queries/0_stateless/00712_prewhere_with_alias_bug.sql | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00712_prewhere_with_alias_bug.reference create mode 100644 dbms/tests/queries/0_stateless/00712_prewhere_with_alias_bug.sql diff --git a/dbms/tests/queries/0_stateless/00712_prewhere_with_alias_bug.reference b/dbms/tests/queries/0_stateless/00712_prewhere_with_alias_bug.reference new file mode 100644 index 00000000000..37e9d3d6a00 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00712_prewhere_with_alias_bug.reference @@ -0,0 +1 @@ +1 3 6 diff --git a/dbms/tests/queries/0_stateless/00712_prewhere_with_alias_bug.sql b/dbms/tests/queries/0_stateless/00712_prewhere_with_alias_bug.sql new file mode 100644 index 00000000000..57e24c691ef --- /dev/null +++ b/dbms/tests/queries/0_stateless/00712_prewhere_with_alias_bug.sql @@ -0,0 +1,5 @@ +drop table if exists test.prewhere_alias; +create table test.prewhere_alias (a Int32, b Int32, c alias a + b) engine = MergeTree order by b; +insert into test.prewhere_alias values(1, 1); +select a, c + toInt32(1), (c + toInt32(1)) * 2 from test.prewhere_alias prewhere (c + toInt32(1)) * 2 = 6; +drop table test.prewhere_alias;