167 var->varnullingrels);
192 context->
root != NULL)
215 if (phv->
phid < context->
root->placeholder_array_size)
216 phinfo = context->
root->placeholder_array[phv->
phid];
244 newevalat =
bms_join(newevalat, delta);
267 (
void *) context, 0);
268 context->sublevels_up--;
296 context.
varno = varno;
383 (
void *) context, 0);
384 context->sublevels_up--;
415 if (((
Var *) node)->varlevelsup == 0)
443 int sublevels_up = levelsup;
447 (
void *) &sublevels_up,
458 if (((
Var *) node)->varlevelsup == *sublevels_up)
464 if (*sublevels_up == 0)
482 (
void *) sublevels_up,
489 (
void *) sublevels_up);
558 context->sublevels_up--;
620 context.
flags = flags;
633 if (((
Var *) node)->varlevelsup != 0)
634 elog(
ERROR,
"Upper-level Var found where not expected");
640 if (((
Aggref *) node)->agglevelsup != 0)
641 elog(
ERROR,
"Upper-level Aggref found where not expected");
653 elog(
ERROR,
"Aggref found where not expected");
658 elog(
ERROR,
"Upper-level GROUPING found where not expected");
670 elog(
ERROR,
"GROUPING found where not expected");
686 elog(
ERROR,
"WindowFunc found where not expected");
691 elog(
ERROR,
"Upper-level PlaceHolderVar found where not expected");
703 elog(
ERROR,
"PlaceHolderVar found where not expected");
756 context.
query = query;
814 fields =
lappend(fields, newvar);
819 rowexpr->
args = fields;
820 rowexpr->row_typeid = var->vartype;
823 rowexpr->colnames = colnames;
880 bool save_inserted_sublink;
889 newnode->hasSubLinks |= context->inserted_sublink;
890 context->inserted_sublink = save_inserted_sublink;
891 context->sublevels_up--;
892 return (
Node *) newnode;
912 if (oldvar->varnullingrels == NULL)
933 elog(
ERROR,
"unsupported join alias expression");
943 newnode = (
Node *) newphv;
948 elog(
ERROR,
"unsupported join alias expression");
1020 foreach(lc, cexpr->
args)
1041 Var *newvar = (
Var *) newnode;
1044 oldvar->varnullingrels);
1052 oldvar->varnullingrels);
1084 foreach(lc, cexpr->
args)
#define InvalidAttrNumber
Bitmapset * bms_join(Bitmapset *a, Bitmapset *b)
bool bms_equal(const Bitmapset *a, const Bitmapset *b)
int bms_next_member(const Bitmapset *a, int prevbit)
Bitmapset * bms_add_member(Bitmapset *a, int x)
Bitmapset * bms_difference(const Bitmapset *a, const Bitmapset *b)
Bitmapset * bms_add_members(Bitmapset *a, const Bitmapset *b)
Bitmapset * bms_del_member(Bitmapset *a, int x)
Bitmapset * bms_copy(const Bitmapset *a)
elog(ERROR, "%s: %s", p2, msg)
Assert(fmt[strlen(fmt) - 1] !='\n')
List * lappend(List *list, void *datum)
#define expression_tree_mutator(n, m, c)
#define query_tree_walker(q, w, c, f)
#define query_or_expression_tree_walker(n, w, c, f)
#define expression_tree_walker(n, w, c)
#define query_tree_mutator(q, m, c, f)
#define QTW_IGNORE_JOINALIASES
#define IsA(nodeptr, _type_)
#define PVC_RECURSE_AGGREGATES
#define PVC_RECURSE_PLACEHOLDERS
#define PVC_RECURSE_WINDOWFUNCS
#define PVC_INCLUDE_WINDOWFUNCS
#define PVC_INCLUDE_PLACEHOLDERS
#define PVC_INCLUDE_AGGREGATES
#define rt_fetch(rangetable_index, rangetable)
static int list_length(const List *l)
#define forboth(cell1, list1, cell2, list2)
static void * list_nth(const List *list, int n)
PlaceHolderVar * make_placeholder_expr(PlannerInfo *root, Expr *expr, Relids phrels)
Relids get_relids_for_join(Query *query, int joinrelid)
bool checkExprHasSubLink(Node *node)
void IncrementVarSublevelsUp(Node *node, int delta_sublevels_up, int min_sublevels_up)
#define FirstLowInvalidHeapAttributeNumber
static bool pull_varattnos_walker(Node *node, pull_varattnos_context *context)
List * pull_vars_of_level(Node *node, int levelsup)
static Node * add_nullingrels_if_needed(PlannerInfo *root, Node *newnode, Var *oldvar)
bool contain_vars_of_level(Node *node, int levelsup)
List * pull_var_clause(Node *node, int flags)
static Node * flatten_join_alias_vars_mutator(Node *node, flatten_join_alias_vars_context *context)
bool contain_var_clause(Node *node)
Relids pull_varnos_of_level(PlannerInfo *root, Node *node, int levelsup)
Relids pull_varnos(PlannerInfo *root, Node *node)
static bool pull_varnos_walker(Node *node, pull_varnos_context *context)
static bool pull_var_clause_walker(Node *node, pull_var_clause_context *context)
static Relids alias_relid_set(Query *query, Relids relids)
static bool contain_vars_of_level_walker(Node *node, int *sublevels_up)
static bool is_standard_join_alias_expression(Node *newnode, Var *oldvar)
Node * flatten_join_alias_vars(PlannerInfo *root, Query *query, Node *node)
void pull_varattnos(Node *node, Index varno, Bitmapset **varattnos)
static void adjust_standard_join_alias_expression(Node *newnode, Var *oldvar)
static bool locate_var_of_level_walker(Node *node, locate_var_of_level_context *context)
int locate_var_of_level(Node *node, int levelsup)
static bool contain_var_clause_walker(Node *node, void *context)
static bool pull_vars_walker(Node *node, pull_vars_context *context)