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

Improve handling of CustomPath/CustomPlan(State) children.

Allow CustomPath to have a list of paths, CustomPlan a list of plans,
and CustomPlanState a list of planstates known to the core system, so
that custom path/plan providers can more reasonably use this
infrastructure for nodes with multiple children.

KaiGai Kohei, per a design suggestion from Tom Lane, with some
further kibitzing by me.
This commit is contained in:
Robert Haas
2015-06-26 09:40:47 -04:00
parent 4b8e24b9ad
commit 5ca611841b
8 changed files with 77 additions and 7 deletions

View File

@ -2373,10 +2373,27 @@ finalize_plan(PlannerInfo *root, Plan *plan, Bitmapset *valid_params,
break;
case T_CustomScan:
finalize_primnode((Node *) ((CustomScan *) plan)->custom_exprs,
&context);
/* We assume custom_scan_tlist cannot contain Params */
context.paramids = bms_add_members(context.paramids, scan_params);
{
CustomScan *cscan = (CustomScan *) plan;
ListCell *lc;
finalize_primnode((Node *) cscan->custom_exprs,
&context);
/* We assume custom_scan_tlist cannot contain Params */
context.paramids =
bms_add_members(context.paramids, scan_params);
/* child nodes if any */
foreach (lc, cscan->custom_plans)
{
context.paramids =
bms_add_members(context.paramids,
finalize_plan(root,
(Plan *) lfirst(lc),
valid_params,
scan_params));
}
}
break;
case T_ModifyTable: