File tree 2 files changed +22
-0
lines changed
2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -830,6 +830,19 @@ explain (verbose, costs off)
830
830
One-Time Filter: ("*VALUES*".column1 = "*VALUES*".column1)
831
831
(8 rows)
832
832
833
+ --
834
+ -- Check we don't misoptimize a NOT IN where the subquery returns no rows.
835
+ --
836
+ create temp table notinouter (a int);
837
+ create temp table notininner (b int not null);
838
+ insert into notinouter values (null), (1);
839
+ select * from notinouter where a not in (select b from notininner);
840
+ a
841
+ ---
842
+
843
+ 1
844
+ (2 rows)
845
+
833
846
--
834
847
-- Check we behave sanely in corner case of empty SELECT list (bug #8648)
835
848
--
Original file line number Diff line number Diff line change @@ -466,6 +466,15 @@ explain (verbose, costs off)
466
466
select x, x from
467
467
(select (select random() where y= y) as x from (values (1 ),(2 )) v(y)) ss;
468
468
469
+ --
470
+ -- Check we don't misoptimize a NOT IN where the subquery returns no rows.
471
+ --
472
+ create temp table notinouter (a int );
473
+ create temp table notininner (b int not null );
474
+ insert into notinouter values (null ), (1 );
475
+
476
+ select * from notinouter where a not in (select b from notininner);
477
+
469
478
--
470
479
-- Check we behave sanely in corner case of empty SELECT list (bug #8648)
471
480
--
You can’t perform that action at this time.
0 commit comments