* Release all sources assigned to cursor */
| 265 | * Release all sources assigned to cursor |
| 266 | */ |
| 267 | static void |
| 268 | close_cursor(CursorData *c) |
| 269 | { |
| 270 | if (c->executed && c->portal) |
| 271 | SPI_cursor_close(c->portal); |
| 272 | |
| 273 | /* release all assigned memory */ |
| 274 | if (c->cursor_cxt) |
| 275 | MemoryContextDelete(c->cursor_cxt); |
| 276 | |
| 277 | if (c->cursor_xact_cxt) |
| 278 | MemoryContextDelete(c->cursor_xact_cxt); |
| 279 | |
| 280 | if (c->plan) |
| 281 | SPI_freeplan(c->plan); |
| 282 | |
| 283 | memset(c, 0, sizeof(CursorData)); |
| 284 | } |
| 285 | |
| 286 | /* |
| 287 | * PROCEDURE dbms_sql.close_cursor(c int) |
no test coverage detected