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.
* Copyright (c) 2002-2006, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/fmgr/funcapi.c,v 1.31.2.1 2008/02/29 02:49:47 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/fmgr/funcapi.c,v 1.31.2.2 2008/11/30 18:49:48 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* Delete context that holds all multi-call data, including the
* FuncCallContext itself
*/
- MemoryContextSwitchTo(flinfo->fn_mcxt);
MemoryContextDelete(funcctx->multi_call_memory_ctx);
}