summaryrefslogtreecommitdiff
path: root/src/backend/utils/fmgr/funcapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/fmgr/funcapi.c')
-rw-r--r--src/backend/utils/fmgr/funcapi.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/backend/utils/fmgr/funcapi.c b/src/backend/utils/fmgr/funcapi.c
index bd65c3911c7..a8d4e4fb5f5 100644
--- a/src/backend/utils/fmgr/funcapi.c
+++ b/src/backend/utils/fmgr/funcapi.c
@@ -52,7 +52,7 @@ init_MultiFuncCall(PG_FUNCTION_ARGS)
retval->call_cntr = 0;
retval->max_calls = 0;
retval->slot = NULL;
- retval->fctx = NULL;
+ retval->user_fctx = NULL;
retval->attinmeta = NULL;
retval->fmctx = fcinfo->flinfo->fn_mcxt;
@@ -76,6 +76,23 @@ init_MultiFuncCall(PG_FUNCTION_ARGS)
}
/*
+ * per_MultiFuncCall
+ *
+ * Do Multi-function per-call setup
+ */
+FuncCallContext *
+per_MultiFuncCall(PG_FUNCTION_ARGS)
+{
+ FuncCallContext *retval = (FuncCallContext *) fcinfo->flinfo->fn_extra;
+
+ /* make sure we start with a fresh slot */
+ if(retval->slot != NULL)
+ ExecClearTuple(retval->slot);
+
+ return retval;
+}
+
+/*
* end_MultiFuncCall
* Clean up after init_MultiFuncCall
*/