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

Function plpgsql_ns_additem

src/pl/plpgsql/src/pl_funcs.c:91–106  ·  view source on GitHub ↗

---------- * plpgsql_ns_additem Add an item to the current namespace chain * ---------- */

Source from the content-addressed store, hash-verified

89 * ----------
90 */
91void
92plpgsql_ns_additem(PLpgSQL_nsitem_type itemtype, int itemno, const char *name)
93{
94 PLpgSQL_nsitem *nse;
95
96 Assert(name != NULL);
97 /* first item added must be a label */
98 Assert(ns_top != NULL || itemtype == PLPGSQL_NSTYPE_LABEL);
99
100 nse = palloc(offsetof(PLpgSQL_nsitem, name) + strlen(name) + 1);
101 nse->itemtype = itemtype;
102 nse->itemno = itemno;
103 nse->prev = ns_top;
104 strcpy(nse->name, name);
105 ns_top = nse;
106}
107
108
109/* ----------

Callers 4

plpgsql_ns_pushFunction · 0.85
add_parameter_nameFunction · 0.85
plpgsql_build_variableFunction · 0.85
plpgsql_build_recordFunction · 0.85

Calls 1

pallocFunction · 0.50

Tested by

no test coverage detected