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

Function PLy_cursor_dealloc

src/pl/plpython/plpy_cursorobject.c:282–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282static void
283PLy_cursor_dealloc(PyObject *arg)
284{
285 PLyCursorObject *cursor;
286 Portal portal;
287
288 cursor = (PLyCursorObject *) arg;
289
290 if (!cursor->closed)
291 {
292 portal = GetPortalByName(cursor->portalname);
293
294 if (PortalIsValid(portal))
295 {
296 UnpinPortal(portal);
297 SPI_cursor_close(portal);
298 }
299 cursor->closed = true;
300 }
301 if (cursor->mcxt)
302 {
303 MemoryContextDelete(cursor->mcxt);
304 cursor->mcxt = NULL;
305 }
306 arg->ob_type->tp_free(arg);
307}
308
309static PyObject *
310PLy_cursor_iternext(PyObject *self)

Callers

nothing calls this directly

Calls 3

GetPortalByNameFunction · 0.85
UnpinPortalFunction · 0.85
SPI_cursor_closeFunction · 0.85

Tested by

no test coverage detected