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

Function PLy_global_args_push

src/pl/plpython/plpy_exec.c:616–636  ·  view source on GitHub ↗

* Save away any existing arguments for the given procedure, so that we can * install new values for a recursive call. This should be invoked before * doing PLy_function_build_args() or PLy_trigger_build_args(). * * NB: callers must ensure that PLy_global_args_pop gets invoked once, and * only once, per successful completion of PLy_global_args_push. Otherwise * we'll end up out-of-sync betw

Source from the content-addressed store, hash-verified

614 * of proc->argstack.
615 */
616static void
617PLy_global_args_push(PLyProcedure *proc)
618{
619 /* We only need to push if we are already inside some active call */
620 if (proc->calldepth > 0)
621 {
622 PLySavedArgs *node;
623
624 /* Build a struct containing current argument values */
625 node = PLy_function_save_args(proc);
626
627 /*
628 * Push the saved argument values into the procedure's stack. Once we
629 * modify either proc->argstack or proc->calldepth, we had better
630 * return without the possibility of error.
631 */
632 node->next = proc->argstack;
633 proc->argstack = node;
634 }
635 proc->calldepth++;
636}
637
638/*
639 * Pop old arguments when exiting a recursive call.

Callers 2

PLy_exec_functionFunction · 0.85
PLy_exec_triggerFunction · 0.85

Calls 1

PLy_function_save_argsFunction · 0.85

Tested by

no test coverage detected