| 1050 | } |
| 1051 | |
| 1052 | int |
| 1053 | SPI_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 | |
| 1074 | HeapTuple |
| 1075 | SPI_copytuple(HeapTuple tuple) |
no test coverage detected