73 for (levelsup = var->
varlevelsup; levelsup > 0; levelsup--)
77 foreach(ppl,
root->plan_params)
91 pvar->vartype == var->vartype &&
92 pvar->vartypmod == var->vartypmod &&
93 pvar->varcollid == var->varcollid &&
94 bms_equal(pvar->varnullingrels, var->varnullingrels))
134 retval->paramtypmod = var->vartypmod;
135 retval->paramcollid = var->varcollid;
156 for (levelsup = phv->
phlevelsup; levelsup > 0; levelsup--)
160 foreach(ppl,
root->plan_params)
230 Assert(agg->agglevelsup > 0 && agg->agglevelsup <
root->query_level);
233 for (levelsup = agg->agglevelsup; levelsup > 0; levelsup--)
242 Assert(agg->agglevelsup == 0);
256 retval->paramtypmod = -1;
257 retval->paramcollid = agg->aggcollid;
280 for (levelsup = grp->
agglevelsup; levelsup > 0; levelsup--)
303 retval->paramtypmod = -1;
333 elog(
ERROR,
"MergeSupportFunc found outside MERGE");
354 retval->paramtypmod = -1;
374 foreach(lc,
root->curOuterParams)
384 param->paramtypmod = var->vartypmod;
385 param->paramcollid = var->varcollid;
423 foreach(lc,
root->curOuterParams)
484 foreach(lc, subplan_params)
496 elog(
ERROR,
"non-LATERAL parameter required by subquery");
499 foreach(lc2,
root->curOuterParams)
502 if (nlp->paramno == pitem->
paramId)
527 elog(
ERROR,
"non-LATERAL parameter required by subquery");
530 foreach(lc2,
root->curOuterParams)
533 if (nlp->paramno == pitem->
paramId)
550 elog(
ERROR,
"unexpected type of subquery parameter");
588 foreach(cell,
root->curOuterParams)
648 retval->paramtypmod = paramtypmod;
649 retval->paramcollid = paramcollation;
bool bms_equal(const Bitmapset *a, const Bitmapset *b)
bool bms_is_subset(const Bitmapset *a, const Bitmapset *b)
bool bms_is_member(int x, const Bitmapset *a)
Bitmapset * bms_intersect(const Bitmapset *a, const Bitmapset *b)
#define Assert(condition)
bool equal(const void *a, const void *b)
if(TABLE==NULL||TABLE_index==NULL)
List * lappend(List *list, void *datum)
List * lappend_oid(List *list, Oid datum)
Oid exprType(const Node *expr)
int32 exprTypmod(const Node *expr)
Oid exprCollation(const Node *expr)
#define IsA(nodeptr, _type_)
static int assign_param_for_var(PlannerInfo *root, Var *var)
static int assign_param_for_placeholdervar(PlannerInfo *root, PlaceHolderVar *phv)
Param * generate_new_exec_param(PlannerInfo *root, Oid paramtype, int32 paramtypmod, Oid paramcollation)
Param * replace_outer_var(PlannerInfo *root, Var *var)
void process_subquery_nestloop_params(PlannerInfo *root, List *subplan_params)
Param * replace_outer_grouping(PlannerInfo *root, GroupingFunc *grp)
Param * replace_nestloop_param_var(PlannerInfo *root, Var *var)
List * identify_current_nestloop_params(PlannerInfo *root, Relids leftrelids)
Param * replace_outer_placeholdervar(PlannerInfo *root, PlaceHolderVar *phv)
Param * replace_outer_merge_support(PlannerInfo *root, MergeSupportFunc *msf)
Param * replace_outer_agg(PlannerInfo *root, Aggref *agg)
Param * replace_nestloop_param_placeholdervar(PlannerInfo *root, PlaceHolderVar *phv)
int assign_special_exec_param(PlannerInfo *root)
#define lfirst_node(type, lc)
static int list_length(const List *l)
#define foreach_delete_current(lst, var_or_cell)
PlaceHolderInfo * find_placeholder_info(PlannerInfo *root, PlaceHolderVar *phv)
void IncrementVarSublevelsUp(Node *node, int delta_sublevels_up, int min_sublevels_up)