Skip to content

Commit 3030189

Browse files
committed
Fix erroneous handling of parameters at SubqueryScan plan nodes,
per bug report from Don Baccus.
1 parent 712af72 commit 3030189

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/backend/optimizer/plan/subselect.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/subselect.c,v 1.45 2000/11/16 22:30:25 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/subselect.c,v 1.46 2000/11/21 00:17:59 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -613,8 +613,15 @@ SS_finalize_plan(Plan *plan)
613613
break;
614614

615615
case T_SubqueryScan:
616+
/*
617+
* In a SubqueryScan, SS_finalize_plan has already been run
618+
* on the subplan by the inner invocation of subquery_planner,
619+
* so there's no need to do it again. Instead, just pull out
620+
* the subplan's extParams list, which represents the params
621+
* it needs from my level and higher levels.
622+
*/
616623
results.paramids = set_unioni(results.paramids,
617-
SS_finalize_plan(((SubqueryScan *) plan)->subplan));
624+
((SubqueryScan *) plan)->subplan->extParam);
618625
break;
619626

620627
case T_IndexScan:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy