postgres.git / summary / log / commit / refs
commit 37e4c7219bbe0cdd9fa582dfbaeae1d1b44ab237
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Sun Nov 30 18:49:42 2008 +0000
First released in: 8.4.0, 8.2.12, 8.3.6
Remove inappropriate memory context switch in shutdown_MultiFuncCall().
This was a thinko introduced in a patch from last February; it results
in memory leakage if an SRF is shut down before the actual end of query,
because subsequent code will be running in a longer-lived context than
it's expecting to be.
src/backend/utils/fmgr/funcapi.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/backend/utils/fmgr/funcapi.c b/src/backend/utils/fmgr/funcapi.c
index 96995a4b2ae..83a0230ab09 100644
--- a/src/backend/utils/fmgr/funcapi.c
+++ b/src/backend/utils/fmgr/funcapi.c
@@ -7,7 +7,7 @@
* Copyright (c) 2002-2008, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/fmgr/funcapi.c,v 1.37.2.1 2008/02/29 02:49:43 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/fmgr/funcapi.c,v 1.37.2.2 2008/11/30 18:49:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -182,7 +182,6 @@ shutdown_MultiFuncCall(Datum arg)
* Delete context that holds all multi-call data, including the
* FuncCallContext itself
*/
- MemoryContextSwitchTo(flinfo->fn_mcxt);
MemoryContextDelete(funcctx->multi_call_memory_ctx);
}
[parent: b9e8986d1b7b]