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

Function SPI_prepare_cursor

src/backend/executor/spi.c:893–927  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

891}
892
893SPIPlanPtr
894SPI_prepare_cursor(const char *src, int nargs, Oid *argtypes,
895 int cursorOptions)
896{
897 _SPI_plan plan;
898 SPIPlanPtr result;
899
900 if (src == NULL || nargs < 0 || (nargs > 0 && argtypes == NULL))
901 {
902 SPI_result = SPI_ERROR_ARGUMENT;
903 return NULL;
904 }
905
906 SPI_result = _SPI_begin_call(true);
907 if (SPI_result < 0)
908 return NULL;
909
910 memset(&plan, 0, sizeof(_SPI_plan));
911 plan.magic = _SPI_PLAN_MAGIC;
912 plan.parse_mode = RAW_PARSE_DEFAULT;
913 plan.cursor_options = cursorOptions;
914 plan.nargs = nargs;
915 plan.argtypes = argtypes;
916 plan.parserSetup = NULL;
917 plan.parserSetupArg = NULL;
918
919 _SPI_prepare_plan(src, &plan);
920
921 /* copy plan to procedure context */
922 result = _SPI_make_plan_non_temp(&plan);
923
924 _SPI_end_call(true);
925
926 return result;
927}
928
929SPIPlanPtr
930SPI_prepare_extended(const char *src,

Callers 1

SPI_prepareFunction · 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