|
7 | 7 | * Portions Copyright (c) 1994, Regents of the University of California
|
8 | 8 | *
|
9 | 9 | * 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 $ |
11 | 11 | *
|
12 | 12 | *-------------------------------------------------------------------------
|
13 | 13 | */
|
@@ -613,8 +613,15 @@ SS_finalize_plan(Plan *plan)
|
613 | 613 | break;
|
614 | 614 |
|
615 | 615 | caseT_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 | + */ |
616 | 623 | results.paramids=set_unioni(results.paramids,
|
617 |
| -SS_finalize_plan(((SubqueryScan*)plan)->subplan)); |
| 624 | +((SubqueryScan*)plan)->subplan->extParam); |
618 | 625 | break;
|
619 | 626 |
|
620 | 627 | caseT_IndexScan:
|
|