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

Function SPI_freeplan

src/backend/executor/spi.c:1052–1072  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1050}
1051
1052int
1053SPI_freeplan(SPIPlanPtr plan)
1054{
1055 ListCell *lc;
1056
1057 if (plan == NULL || plan->magic != _SPI_PLAN_MAGIC)
1058 return SPI_ERROR_ARGUMENT;
1059
1060 /* Release the plancache entries */
1061 foreach(lc, plan->plancache_list)
1062 {
1063 CachedPlanSource *plansource = (CachedPlanSource *) lfirst(lc);
1064
1065 DropCachedPlan(plansource);
1066 }
1067
1068 /* Now get rid of the _SPI_plan and subsidiary data in its plancxt */
1069 MemoryContextDelete(plan->plancxt);
1070
1071 return 0;
1072}
1073
1074HeapTuple
1075SPI_copytuple(HeapTuple tuple)

Callers 12

free_exprFunction · 0.85
plperl_spi_queryFunction · 0.85
plperl_spi_prepareFunction · 0.85
plperl_spi_freeplanFunction · 0.85
PLy_cursor_queryFunction · 0.85
PLy_plan_deallocFunction · 0.85
tsquery_rewrite_queryFunction · 0.85
ri_FetchPreparedPlanFunction · 0.85
ts_stat_sqlFunction · 0.85
close_cursorFunction · 0.85
get_hints_from_tableFunction · 0.85

Calls 2

DropCachedPlanFunction · 0.85
foreachFunction · 0.50

Tested by

no test coverage detected