Add tests

pull/7665/head
eaydingol 2024-07-30 11:58:51 +00:00
parent 6907148561
commit 8eba822bfd
2 changed files with 22 additions and 0 deletions

View File

@ -561,6 +561,23 @@ DEBUG: push down of limit count: ALL
12000
(1 row)
-- check if we push the right limit when both offset and limit are given
SELECT l_orderkey FROM lineitem WHERE l_orderkey < 3 ORDER BY l_orderkey OFFSET 1 LIMIT 3;
DEBUG: push down of limit count: 4
l_orderkey
---------------------------------------------------------------------
1
1
1
(3 rows)
SELECT l_orderkey FROM lineitem WHERE l_orderkey < 3 ORDER BY l_orderkey OFFSET null LIMIT 1;
DEBUG: push down of limit count: 1
l_orderkey
---------------------------------------------------------------------
1
(1 row)
SET client_min_messages TO NOTICE;
-- non constants should not push down
CREATE OR REPLACE FUNCTION my_limit()

View File

@ -231,6 +231,11 @@ SELECT count(*) FROM lineitem LIMIT null;
SELECT count(*) FROM lineitem OFFSET 0 LIMIT null;
-- check if we push the right limit when both offset and limit are given
SELECT l_orderkey FROM lineitem WHERE l_orderkey < 3 ORDER BY l_orderkey OFFSET 1 LIMIT 3;
SELECT l_orderkey FROM lineitem WHERE l_orderkey < 3 ORDER BY l_orderkey OFFSET null LIMIT 1;
SET client_min_messages TO NOTICE;
-- non constants should not push down