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

Function get_stmt_mcontext

src/pl/plpgsql/src/pl_exec.c:1505–1516  ·  view source on GitHub ↗

* Create a memory context for statement-lifespan variables, if we don't * have one already. It will be a child of stmt_mcontext_parent, which is * either the function's main context or a pushed-down outer stmt_mcontext. */

Source from the content-addressed store, hash-verified

1503 * either the function's main context or a pushed-down outer stmt_mcontext.
1504 */
1505static MemoryContext
1506get_stmt_mcontext(PLpgSQL_execstate *estate)
1507{
1508 if (estate->stmt_mcontext == NULL)
1509 {
1510 estate->stmt_mcontext =
1511 AllocSetContextCreate(estate->stmt_mcontext_parent,
1512 "PLpgSQL per-statement data",
1513 ALLOCSET_DEFAULT_SIZES);
1514 }
1515 return estate->stmt_mcontext;
1516}
1517
1518/*
1519 * Push down the current stmt_mcontext so that called statements won't use it.

Callers 9

exec_stmt_blockFunction · 0.85
exec_stmt_forcFunction · 0.85
exec_stmt_foreach_aFunction · 0.85
exec_stmt_return_queryFunction · 0.85
exec_stmt_raiseFunction · 0.85
exec_stmt_dynexecuteFunction · 0.85
exec_stmt_openFunction · 0.85
exec_eval_using_paramsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected