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

Function SPI_execute_plan

src/backend/executor/spi.c:699–728  ·  view source on GitHub ↗

Execute a previously prepared plan */

Source from the content-addressed store, hash-verified

697
698/* Execute a previously prepared plan */
699int
700SPI_execute_plan(SPIPlanPtr plan, Datum *Values, const char *Nulls,
701 bool read_only, long tcount)
702{
703 SPIExecuteOptions options;
704 int res;
705
706 if (plan == NULL || plan->magic != _SPI_PLAN_MAGIC || tcount < 0)
707 return SPI_ERROR_ARGUMENT;
708
709 if (plan->nargs > 0 && Values == NULL)
710 return SPI_ERROR_PARAM;
711
712 res = _SPI_begin_call(true);
713 if (res < 0)
714 return res;
715
716 memset(&options, 0, sizeof(options));
717 options.params = _SPI_convert_params(plan->nargs, plan->argtypes,
718 Values, Nulls);
719 options.read_only = read_only;
720 options.tcount = tcount;
721
722 res = _SPI_execute_plan(plan, &options,
723 InvalidSnapshot, InvalidSnapshot,
724 true);
725
726 _SPI_end_call(true);
727 return res;
728}
729
730/* Obsolete version of SPI_execute_plan */
731int

Callers 11

pltcl_SPI_execute_planFunction · 0.85
plperl_spi_exec_preparedFunction · 0.85
PLy_spi_execute_planFunction · 0.85
pg_get_ruledef_workerFunction · 0.85
pg_get_viewdef_workerFunction · 0.85
SPI_execpFunction · 0.85
test_predtestFunction · 0.85
check_secure_localityFunction · 0.85
safe_named_locationFunction · 0.85
executeFunction · 0.85
get_hints_from_tableFunction · 0.85

Calls 4

_SPI_begin_callFunction · 0.85
_SPI_convert_paramsFunction · 0.85
_SPI_execute_planFunction · 0.85
_SPI_end_callFunction · 0.85

Tested by 1

test_predtestFunction · 0.68