From a29c3b1c063fe8fe1d1fa70fb6dd29a795456ef3 Mon Sep 17 00:00:00 2001 From: Denis Zhuravlev Date: Fri, 16 Oct 2020 18:43:23 -0300 Subject: [PATCH] test for the bug #8425 --- ...filtering_aliased_materialized_column.reference | 2 ++ ...01518_filtering_aliased_materialized_column.sql | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 tests/queries/0_stateless/01518_filtering_aliased_materialized_column.reference create mode 100644 tests/queries/0_stateless/01518_filtering_aliased_materialized_column.sql diff --git a/tests/queries/0_stateless/01518_filtering_aliased_materialized_column.reference b/tests/queries/0_stateless/01518_filtering_aliased_materialized_column.reference new file mode 100644 index 00000000000..0d66ea1aee9 --- /dev/null +++ b/tests/queries/0_stateless/01518_filtering_aliased_materialized_column.reference @@ -0,0 +1,2 @@ +0 +1 diff --git a/tests/queries/0_stateless/01518_filtering_aliased_materialized_column.sql b/tests/queries/0_stateless/01518_filtering_aliased_materialized_column.sql new file mode 100644 index 00000000000..eab5e66aaad --- /dev/null +++ b/tests/queries/0_stateless/01518_filtering_aliased_materialized_column.sql @@ -0,0 +1,14 @@ +DROP TABLE IF EXISTS logs; + +CREATE TABLE logs( + date_visited DateTime, + date Date MATERIALIZED toDate(date_visited) +) ENGINE = MergeTree() ORDER BY tuple(); + +SELECT count() FROM logs AS plogs WHERE plogs.date = '2019-11-20'; + +INSERT INTO logs VALUES('2019-11-20 00:00:00'); + +SELECT count() FROM logs AS plogs WHERE plogs.date = '2019-11-20'; + +DROP TABLE logs;