1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-12 02:37:31 +03:00

create_unique_plan() should not discard existing output columns of the

subplan it starts with, as they may be needed at upper join levels.
See comments added to code for the non-obvious reason why.  Per bug report
from Robert Creager.
This commit is contained in:
Tom Lane
2003-08-07 19:20:24 +00:00
parent d862045dfc
commit ecbed6e1b9
5 changed files with 94 additions and 37 deletions

View File

@@ -2127,6 +2127,18 @@ on (x1 = xx1) where (xx2 is not null);
4 | 44 | 4 | | 4 | 44
(3 rows)
--
-- regression test: check for bug with propagation of implied equality
-- to outside an IN
--
select count(*) from tenk1 a where unique1 in
(select unique1 from tenk1 b join tenk1 c using (unique1)
where b.unique2 = 42);
count
-------
1
(1 row)
--
-- Clean up
--

View File

@@ -330,6 +330,14 @@ on (x1 = xx1) where (y2 is not null);
select * from (x left join y on (x1 = y1)) left join x xx(xx1,xx2)
on (x1 = xx1) where (xx2 is not null);
--
-- regression test: check for bug with propagation of implied equality
-- to outside an IN
--
select count(*) from tenk1 a where unique1 in
(select unique1 from tenk1 b join tenk1 c using (unique1)
where b.unique2 = 42);
--
-- Clean up