Repair recalculation failure for nested sub-SELECTs, per bug report from
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 11 May 2004 02:21:55 +0000 (02:21 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 11 May 2004 02:21:55 +0000 (02:21 +0000)
Didier Moens.  Bug is new in 7.4, and was caused by not updating everyplace
I should've when replacing locParam markers by allParam.

src/backend/optimizer/plan/planner.c

index 991e7bd94879b13870b4b52feddbebc0ea068d80..cc886f35d399e4ebd0ce7d03756fcde4dcee2f60 100644 (file)
@@ -343,6 +343,9 @@ subquery_planner(Query *parse, double tuple_fraction)
 
                        plan->extParam = bms_add_members(plan->extParam,
                                                                                         initplan->plan->extParam);
+                       /* allParam must include all members of extParam */
+                       plan->allParam = bms_add_members(plan->allParam,
+                                                                                        plan->extParam);
                        initplan_cost += initplan->plan->total_cost;
                }