diff options
Diffstat (limited to 'src/backend/executor/spi.c')
-rw-r--r-- | src/backend/executor/spi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c index 4d9b51b947b..995f67d2662 100644 --- a/src/backend/executor/spi.c +++ b/src/backend/executor/spi.c @@ -1183,7 +1183,7 @@ SPI_cursor_open_internal(const char *name, SPIPlanPtr plan, } /* Copy the plan's query string into the portal */ - query_string = MemoryContextStrdup(PortalGetHeapMemory(portal), + query_string = MemoryContextStrdup(portal->portalContext, plansource->query_string); /* @@ -1213,7 +1213,7 @@ SPI_cursor_open_internal(const char *name, SPIPlanPtr plan, * will result in leaking our refcount on the plan, but it doesn't * matter because the plan is unsaved and hence transient anyway. */ - oldcontext = MemoryContextSwitchTo(PortalGetHeapMemory(portal)); + oldcontext = MemoryContextSwitchTo(portal->portalContext); stmt_list = copyObject(stmt_list); MemoryContextSwitchTo(oldcontext); ReleaseCachedPlan(cplan, false); @@ -1311,7 +1311,7 @@ SPI_cursor_open_internal(const char *name, SPIPlanPtr plan, */ if (paramLI) { - oldcontext = MemoryContextSwitchTo(PortalGetHeapMemory(portal)); + oldcontext = MemoryContextSwitchTo(portal->portalContext); paramLI = copyParamList(paramLI); MemoryContextSwitchTo(oldcontext); } |