diff options
Diffstat (limited to 'src/include/parser')
-rw-r--r-- | src/include/parser/parse_node.h | 8 | ||||
-rw-r--r-- | src/include/parser/parse_relation.h | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/include/parser/parse_node.h b/src/include/parser/parse_node.h index 1a3792236a1..f589112d5e5 100644 --- a/src/include/parser/parse_node.h +++ b/src/include/parser/parse_node.h @@ -118,6 +118,13 @@ typedef Node *(*CoerceParamHook) (ParseState *pstate, Param *param, * This is one-for-one with p_rtable, but contains NULLs for non-join * RTEs, and may be shorter than p_rtable if the last RTE(s) aren't joins. * + * p_nullingrels: list of Bitmapsets associated with p_rtable entries, each + * containing the set of outer-join RTE indexes that can null that relation + * at the current point in the parse tree. This is one-for-one with p_rtable, + * but may be shorter than p_rtable, in which case the missing entries are + * implicitly empty (NULL). That rule allows us to save work when the query + * contains no outer joins. + * * p_joinlist: list of join items (RangeTblRef and JoinExpr nodes) that * will become the fromlist of the query's top-level FromExpr node. * @@ -187,6 +194,7 @@ struct ParseState List *p_rteperminfos; /* list of RTEPermissionInfo nodes for each * RTE_RELATION entry in rtable */ List *p_joinexprs; /* JoinExprs for RTE_JOIN p_rtable entries */ + List *p_nullingrels; /* Bitmapsets showing nulling outer joins */ List *p_joinlist; /* join items so far (will become FromExpr * node's fromlist) */ List *p_namespace; /* currently-referenceable RTEs (List of diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h index dfa584b6ace..67d9b1e412c 100644 --- a/src/include/parser/parse_relation.h +++ b/src/include/parser/parse_relation.h @@ -41,6 +41,7 @@ extern Node *scanNSItemForColumn(ParseState *pstate, ParseNamespaceItem *nsitem, int location); extern Node *colNameToVar(ParseState *pstate, const char *colname, bool localonly, int location); +extern void markNullableIfNeeded(ParseState *pstate, Var *var); extern void markVarForSelectPriv(ParseState *pstate, Var *var); extern Relation parserOpenTable(ParseState *pstate, const RangeVar *relation, int lockmode); @@ -113,7 +114,7 @@ extern void errorMissingColumn(ParseState *pstate, extern void expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up, int location, bool include_dropped, List **colnames, List **colvars); -extern List *expandNSItemVars(ParseNamespaceItem *nsitem, +extern List *expandNSItemVars(ParseState *pstate, ParseNamespaceItem *nsitem, int sublevels_up, int location, List **colnames); extern List *expandNSItemAttrs(ParseState *pstate, ParseNamespaceItem *nsitem, |