MCPcopy Create free account
hub / github.com/apache/cloudberry / addNSItemToQuery

Function addNSItemToQuery

src/backend/parser/parse_relation.c:2870–2891  ·  view source on GitHub ↗

* Add the given nsitem/RTE as a top-level entry in the pstate's join list * and/or namespace list. (We assume caller has checked for any * namespace conflicts.) The nsitem is always marked as unconditionally * visible, that is, not LATERAL-only. */

Source from the content-addressed store, hash-verified

2868 * visible, that is, not LATERAL-only.
2869 */
2870void
2871addNSItemToQuery(ParseState *pstate, ParseNamespaceItem *nsitem,
2872 bool addToJoinList,
2873 bool addToRelNameSpace, bool addToVarNameSpace)
2874{
2875 if (addToJoinList)
2876 {
2877 RangeTblRef *rtr = makeNode(RangeTblRef);
2878
2879 rtr->rtindex = nsitem->p_rtindex;
2880 pstate->p_joinlist = lappend(pstate->p_joinlist, rtr);
2881 }
2882 if (addToRelNameSpace || addToVarNameSpace)
2883 {
2884 /* Set the new nsitem's visibility flags correctly */
2885 nsitem->p_rel_visible = addToRelNameSpace;
2886 nsitem->p_cols_visible = addToVarNameSpace;
2887 nsitem->p_lateral_only = false;
2888 nsitem->p_lateral_ok = true;
2889 pstate->p_namespace = lappend(pstate->p_namespace, nsitem);
2890 }
2891}
2892
2893/*
2894 * expandRTE -- expand the columns of a rangetable entry

Callers 15

DoCopyFunction · 0.85
CreateTriggerFiringOnFunction · 0.85
CreatePolicyFunction · 0.85
AlterPolicyFunction · 0.85
DefineRelationFunction · 0.85
transformPartitionSpecFunction · 0.85
transformIndexStmtFunction · 0.85
transformStatsStmtFunction · 0.85
transformRuleStmtFunction · 0.85
transformAlterTableStmtFunction · 0.85
transformInsertStmtFunction · 0.85

Calls 1

lappendFunction · 0.85

Tested by 2