Commit 570be1f7 authored by Tom Lane's avatar Tom Lane

Re-export a few of createplan.c's make_xxx() functions.

CitusDB is using these and don't wish to redesign their code right now.
I am not on board with this being a good idea, or a good precedent,
but I lack the energy to fight about it.
parent 7087166a
...@@ -242,16 +242,10 @@ static EquivalenceMember *find_ec_member_for_tle(EquivalenceClass *ec, ...@@ -242,16 +242,10 @@ static EquivalenceMember *find_ec_member_for_tle(EquivalenceClass *ec,
TargetEntry *tle, TargetEntry *tle,
Relids relids); Relids relids);
static Sort *make_sort_from_pathkeys(Plan *lefttree, List *pathkeys); static Sort *make_sort_from_pathkeys(Plan *lefttree, List *pathkeys);
static Sort *make_sort_from_sortclauses(List *sortcls, Plan *lefttree);
static Sort *make_sort_from_groupcols(List *groupcls, static Sort *make_sort_from_groupcols(List *groupcls,
AttrNumber *grpColIdx, AttrNumber *grpColIdx,
Plan *lefttree); Plan *lefttree);
static Material *make_material(Plan *lefttree); static Material *make_material(Plan *lefttree);
static Agg *make_agg(List *tlist, List *qual, AggStrategy aggstrategy,
bool combineStates, bool finalizeAggs,
int numGroupCols, AttrNumber *grpColIdx, Oid *grpOperators,
List *groupingSets, List *chain,
double dNumGroups, Plan *lefttree);
static WindowAgg *make_windowagg(List *tlist, Index winref, static WindowAgg *make_windowagg(List *tlist, Index winref,
int partNumCols, AttrNumber *partColIdx, Oid *partOperators, int partNumCols, AttrNumber *partColIdx, Oid *partOperators,
int ordNumCols, AttrNumber *ordColIdx, Oid *ordOperators, int ordNumCols, AttrNumber *ordColIdx, Oid *ordOperators,
...@@ -269,7 +263,6 @@ static SetOp *make_setop(SetOpCmd cmd, SetOpStrategy strategy, Plan *lefttree, ...@@ -269,7 +263,6 @@ static SetOp *make_setop(SetOpCmd cmd, SetOpStrategy strategy, Plan *lefttree,
List *distinctList, AttrNumber flagColIdx, int firstFlag, List *distinctList, AttrNumber flagColIdx, int firstFlag,
long numGroups); long numGroups);
static LockRows *make_lockrows(Plan *lefttree, List *rowMarks, int epqParam); static LockRows *make_lockrows(Plan *lefttree, List *rowMarks, int epqParam);
static Limit *make_limit(Plan *lefttree, Node *limitOffset, Node *limitCount);
static Result *make_result(List *tlist, Node *resconstantqual, Plan *subplan); static Result *make_result(List *tlist, Node *resconstantqual, Plan *subplan);
static ModifyTable *make_modifytable(PlannerInfo *root, static ModifyTable *make_modifytable(PlannerInfo *root,
CmdType operation, bool canSetTag, CmdType operation, bool canSetTag,
...@@ -5500,7 +5493,7 @@ make_sort_from_pathkeys(Plan *lefttree, List *pathkeys) ...@@ -5500,7 +5493,7 @@ make_sort_from_pathkeys(Plan *lefttree, List *pathkeys)
* 'sortcls' is a list of SortGroupClauses * 'sortcls' is a list of SortGroupClauses
* 'lefttree' is the node which yields input tuples * 'lefttree' is the node which yields input tuples
*/ */
static Sort * Sort *
make_sort_from_sortclauses(List *sortcls, Plan *lefttree) make_sort_from_sortclauses(List *sortcls, Plan *lefttree)
{ {
List *sub_tlist = lefttree->targetlist; List *sub_tlist = lefttree->targetlist;
...@@ -5635,7 +5628,7 @@ materialize_finished_plan(Plan *subplan) ...@@ -5635,7 +5628,7 @@ materialize_finished_plan(Plan *subplan)
return matplan; return matplan;
} }
static Agg * Agg *
make_agg(List *tlist, List *qual, make_agg(List *tlist, List *qual,
AggStrategy aggstrategy, AggStrategy aggstrategy,
bool combineStates, bool finalizeAggs, bool combineStates, bool finalizeAggs,
...@@ -5973,7 +5966,7 @@ make_lockrows(Plan *lefttree, List *rowMarks, int epqParam) ...@@ -5973,7 +5966,7 @@ make_lockrows(Plan *lefttree, List *rowMarks, int epqParam)
* make_limit * make_limit
* Build a Limit plan node * Build a Limit plan node
*/ */
static Limit * Limit *
make_limit(Plan *lefttree, Node *limitOffset, Node *limitCount) make_limit(Plan *lefttree, Node *limitOffset, Node *limitCount)
{ {
Limit *node = makeNode(Limit); Limit *node = makeNode(Limit);
......
...@@ -55,6 +55,14 @@ extern ForeignScan *make_foreignscan(List *qptlist, List *qpqual, ...@@ -55,6 +55,14 @@ extern ForeignScan *make_foreignscan(List *qptlist, List *qpqual,
extern Plan *materialize_finished_plan(Plan *subplan); extern Plan *materialize_finished_plan(Plan *subplan);
extern bool is_projection_capable_path(Path *path); extern bool is_projection_capable_path(Path *path);
extern bool is_projection_capable_plan(Plan *plan); extern bool is_projection_capable_plan(Plan *plan);
/* External use of these functions is deprecated: */
extern Sort *make_sort_from_sortclauses(List *sortcls, Plan *lefttree);
extern Agg *make_agg(List *tlist, List *qual, AggStrategy aggstrategy,
bool combineStates, bool finalizeAggs,
int numGroupCols, AttrNumber *grpColIdx, Oid *grpOperators,
List *groupingSets, List *chain,
double dNumGroups, Plan *lefttree);
extern Limit *make_limit(Plan *lefttree, Node *limitOffset, Node *limitCount);
/* /*
* prototypes for plan/initsplan.c * prototypes for plan/initsplan.c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment