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

Function push_stmt_mcontext

src/pl/plpgsql/src/pl_exec.c:1524–1535  ·  view source on GitHub ↗

* Push down the current stmt_mcontext so that called statements won't use it. * This is needed by statements that have statement-lifespan data and need to * preserve it across some inner statements. The caller should eventually do * pop_stmt_mcontext(). */

Source from the content-addressed store, hash-verified

1522 * pop_stmt_mcontext().
1523 */
1524static void
1525push_stmt_mcontext(PLpgSQL_execstate *estate)
1526{
1527 /* Should have done get_stmt_mcontext() first */
1528 Assert(estate->stmt_mcontext != NULL);
1529 /* Assert we've not messed up the stack linkage */
1530 Assert(MemoryContextGetParent(estate->stmt_mcontext) == estate->stmt_mcontext_parent);
1531 /* Push it down to become the parent of any nested stmt mcontext */
1532 estate->stmt_mcontext_parent = estate->stmt_mcontext;
1533 /* And make it not available for use directly */
1534 estate->stmt_mcontext = NULL;
1535}
1536
1537/*
1538 * Undo push_stmt_mcontext(). We assume this is done just before or after

Callers 1

exec_stmt_foreach_aFunction · 0.85

Calls 1

MemoryContextGetParentFunction · 0.85

Tested by

no test coverage detected