From b629833ef9aa71d091892d0284f7c773d6ea88e1 Mon Sep 17 00:00:00 2001 From: Alexander Gololobov <440544+davenger@users.noreply.github.com> Date: Mon, 13 Jun 2022 12:32:24 +0200 Subject: [PATCH] Test cases to check that row level filter is applied before prewhere actions are executed --- .../02319_no_columns_in_row_level_filter.reference | 3 +++ .../0_stateless/02319_no_columns_in_row_level_filter.sql | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/tests/queries/0_stateless/02319_no_columns_in_row_level_filter.reference b/tests/queries/0_stateless/02319_no_columns_in_row_level_filter.reference index 55d013f68b4..c0911ffc598 100644 --- a/tests/queries/0_stateless/02319_no_columns_in_row_level_filter.reference +++ b/tests/queries/0_stateless/02319_no_columns_in_row_level_filter.reference @@ -6,3 +6,6 @@ 195431 195431 5923 +200000 +200000 +6061 diff --git a/tests/queries/0_stateless/02319_no_columns_in_row_level_filter.sql b/tests/queries/0_stateless/02319_no_columns_in_row_level_filter.sql index 4aa62ec8b8d..e6bc475b081 100644 --- a/tests/queries/0_stateless/02319_no_columns_in_row_level_filter.sql +++ b/tests/queries/0_stateless/02319_no_columns_in_row_level_filter.sql @@ -26,6 +26,11 @@ SELECT count(1) FROM test_table PREWHERE (n % 8192) < 4000; SELECT count(1) FROM test_table WHERE (n % 8192) < 4000; SELECT count(1) FROM test_table PREWHERE (n % 8192) < 4000 WHERE (n % 33) == 0; +-- Run queries that have division by zero if row level filter isn't applied before prewhere +SELECT count(1) FROM test_table PREWHERE 7 / (n % 5) > 2; +SELECT count(1) FROM test_table WHERE 7 / (n % 5) > 2; +SELECT count(1) FROM test_table PREWHERE 7 / (n % 5) > 2 WHERE (n % 33) == 0; + DROP TABLE test_table; DROP ROW POLICY test_filter_policy ON test_table; DROP ROW POLICY test_filter_policy_2 ON test_table;