@@ -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+
476536DROP USER MAPPING FOR current_user SERVER multicorn_srv;
477537DROP EXTENSION multicorn cascade;
478538NOTICE: drop cascades to 3 other objects
0 commit comments