Commit 0ddede58 authored by Tom Lane's avatar Tom Lane

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.
parent 0a2cdbcd
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Copyright (c) 2002-2008, PostgreSQL Global Development Group * Copyright (c) 2002-2008, PostgreSQL Global Development Group
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/fmgr/funcapi.c,v 1.42 2008/08/25 22:42:34 tgl Exp $ * $PostgreSQL: pgsql/src/backend/utils/fmgr/funcapi.c,v 1.43 2008/11/30 18:49:36 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -182,7 +182,6 @@ shutdown_MultiFuncCall(Datum arg) ...@@ -182,7 +182,6 @@ shutdown_MultiFuncCall(Datum arg)
* Delete context that holds all multi-call data, including the * Delete context that holds all multi-call data, including the
* FuncCallContext itself * FuncCallContext itself
*/ */
MemoryContextSwitchTo(flinfo->fn_mcxt);
MemoryContextDelete(funcctx->multi_call_memory_ctx); MemoryContextDelete(funcctx->multi_call_memory_ctx);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment