Test cases to check that row level filter is applied before prewhere actions are executed

This commit is contained in:
Alexander Gololobov 2022-06-13 12:32:24 +02:00
parent aea5bc7527
commit b629833ef9
2 changed files with 8 additions and 0 deletions

View File

@ -6,3 +6,6 @@
195431
195431
5923
200000
200000
6061

View File

@ -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;