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

Function SPI_prepare_extended

src/backend/executor/spi.c:929–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

927}
928
929SPIPlanPtr
930SPI_prepare_extended(const char *src,
931 const SPIPrepareOptions *options)
932{
933 _SPI_plan plan;
934 SPIPlanPtr result;
935
936 if (src == NULL || options == NULL)
937 {
938 SPI_result = SPI_ERROR_ARGUMENT;
939 return NULL;
940 }
941
942 SPI_result = _SPI_begin_call(true);
943 if (SPI_result < 0)
944 return NULL;
945
946 memset(&plan, 0, sizeof(_SPI_plan));
947 plan.magic = _SPI_PLAN_MAGIC;
948 plan.parse_mode = options->parseMode;
949 plan.cursor_options = options->cursorOptions;
950 plan.nargs = 0;
951 plan.argtypes = NULL;
952 plan.parserSetup = options->parserSetup;
953 plan.parserSetupArg = options->parserSetupArg;
954
955 _SPI_prepare_plan(src, &plan);
956
957 /* copy plan to procedure context */
958 result = _SPI_make_plan_non_temp(&plan);
959
960 _SPI_end_call(true);
961
962 return result;
963}
964
965SPIPlanPtr
966SPI_prepare_params(const char *src,

Callers 1

exec_prepare_planFunction · 0.85

Calls 4

_SPI_begin_callFunction · 0.85
_SPI_prepare_planFunction · 0.85
_SPI_make_plan_non_tempFunction · 0.85
_SPI_end_callFunction · 0.85

Tested by

no test coverage detected