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

Function SPI_execute

src/backend/executor/spi.c:623–654  ·  view source on GitHub ↗

Parse, plan, and execute a query string */

Source from the content-addressed store, hash-verified

621
622/* Parse, plan, and execute a query string */
623int
624SPI_execute(const char *src, bool read_only, long tcount)
625{
626 _SPI_plan plan;
627 SPIExecuteOptions options;
628 int res;
629
630 if (src == NULL || tcount < 0)
631 return SPI_ERROR_ARGUMENT;
632
633 res = _SPI_begin_call(true);
634 if (res < 0)
635 return res;
636
637 memset(&plan, 0, sizeof(_SPI_plan));
638 plan.magic = _SPI_PLAN_MAGIC;
639 plan.parse_mode = RAW_PARSE_DEFAULT;
640 plan.cursor_options = CURSOR_OPT_PARALLEL_OK;
641
642 _SPI_prepare_oneshot_plan(src, &plan);
643
644 memset(&options, 0, sizeof(options));
645 options.read_only = read_only;
646 options.tcount = tcount;
647
648 res = _SPI_execute_plan(&plan, &options,
649 InvalidSnapshot, InvalidSnapshot,
650 true);
651
652 _SPI_end_call(true);
653 return res;
654}
655
656/* Obsolete version of SPI_execute */
657int

Callers 15

crosstabFunction · 0.85
load_categories_hashFunction · 0.85
get_crosstab_tuplestoreFunction · 0.85
pltcl_SPI_executeFunction · 0.85
plperl_spi_execFunction · 0.85
PLy_spi_execute_queryFunction · 0.85
buildWaitGraphFunction · 0.85
query_to_oid_listFunction · 0.85
query_to_xml_internalFunction · 0.85
acquire_hll_by_queryFunction · 0.85
refresh_by_match_mergeFunction · 0.85

Calls 4

_SPI_begin_callFunction · 0.85
_SPI_execute_planFunction · 0.85
_SPI_end_callFunction · 0.85

Tested by 3

initialize_worker_spiFunction · 0.68
worker_spi_mainFunction · 0.68