Skip to content

Commit 4505095

Browse files
committed
add bool operator pushdown test cases
1 parent 5ec517b commit 4505095

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

test-3.9/expected/multicorn_regression_test.out

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,66 @@ NOTICE: ['test1', 'test2', 'test3']
473473
-------+-------+-------
474474
(0 rows)
475475

476+
-- Test boolean operation pushdown
477+
ALTER FOREIGN TABLE testmulticorn alter test1 type bool;
478+
select * from testmulticorn where test1;
479+
NOTICE: [('option1', 'option1'), ('test_type', 'iter_none'), ('usermapping', 'test')]
480+
NOTICE: [('test1', 'boolean'), ('test2', 'bytea'), ('test3', 'money')]
481+
NOTICE: [test1 = t]
482+
NOTICE: ['test1', 'test2', 'test3']
483+
test1 | test2 | test3
484+
-------+-------+-------
485+
(0 rows)
486+
487+
select * from testmulticorn where NOT test1;
488+
NOTICE: [test1 <> t]
489+
NOTICE: ['test1', 'test2', 'test3']
490+
test1 | test2 | test3
491+
-------+-------+-------
492+
(0 rows)
493+
494+
select * from testmulticorn where test1 = TRUE;
495+
NOTICE: [test1 = t]
496+
NOTICE: ['test1', 'test2', 'test3']
497+
test1 | test2 | test3
498+
-------+-------+-------
499+
(0 rows)
500+
501+
select * from testmulticorn where test1 = FALSE;
502+
NOTICE: [test1 <> t]
503+
NOTICE: ['test1', 'test2', 'test3']
504+
test1 | test2 | test3
505+
-------+-------+-------
506+
(0 rows)
507+
508+
select * from testmulticorn where test1 IS TRUE;
509+
NOTICE: [test1 IS t]
510+
NOTICE: ['test1', 'test2', 'test3']
511+
test1 | test2 | test3
512+
-------+-------+-------
513+
(0 rows)
514+
515+
select * from testmulticorn where test1 IS FALSE;
516+
NOTICE: [test1 IS f]
517+
NOTICE: ['test1', 'test2', 'test3']
518+
test1 | test2 | test3
519+
-------+-------+-------
520+
(0 rows)
521+
522+
select * from testmulticorn where test1 IS UNKNOWN;
523+
NOTICE: [test1 IS None]
524+
NOTICE: ['test1', 'test2', 'test3']
525+
test1 | test2 | test3
526+
-------+-------+-------
527+
(0 rows)
528+
529+
select * from testmulticorn where test1 IS NOT UNKNOWN;
530+
NOTICE: [test1 IS NOT None]
531+
NOTICE: ['test1', 'test2', 'test3']
532+
test1 | test2 | test3
533+
-------+-------+-------
534+
(0 rows)
535+
476536
DROP USER MAPPING FOR current_user SERVER multicorn_srv;
477537
DROP EXTENSION multicorn cascade;
478538
NOTICE: drop cascades to 3 other objects

test-3.9/sql/multicorn_regression_test.sql

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,16 @@ ALTER FOREIGN TABLE testmulticorn add test3 money;
107107
SELECT * from testmulticorn where test3 = 12::money;
108108
SELECT * from testmulticorn where test1 = '12 €';
109109

110+
-- Test boolean operation pushdown
111+
ALTER FOREIGN TABLE testmulticorn alter test1 type bool;
112+
select * from testmulticorn where test1;
113+
select * from testmulticorn where NOT test1;
114+
select * from testmulticorn where test1 = TRUE;
115+
select * from testmulticorn where test1 = FALSE;
116+
select * from testmulticorn where test1 IS TRUE;
117+
select * from testmulticorn where test1 IS FALSE;
118+
select * from testmulticorn where test1 IS UNKNOWN;
119+
select * from testmulticorn where test1 IS NOT UNKNOWN;
120+
110121
DROP USER MAPPING FOR current_user SERVER multicorn_srv;
111122
DROP EXTENSION multicorn cascade;

0 commit comments

Comments
 (0)