aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execUtils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/execUtils.c')
-rw-r--r--src/backend/executor/execUtils.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c
index 2de056e1df4..cb11f4fc367 100644
--- a/src/backend/executor/execUtils.c
+++ b/src/backend/executor/execUtils.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.107 2003/11/29 19:51:48 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.108 2003/12/18 20:21:37 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -18,6 +18,7 @@
* FreeExecutorState
* CreateExprContext
* FreeExprContext
+ * ReScanExprContext
*
* ExecAssignExprContext Common code for plan node init routines.
* ExecAssignResultType
@@ -353,6 +354,24 @@ FreeExprContext(ExprContext *econtext)
}
/*
+ * ReScanExprContext
+ *
+ * Reset an expression context in preparation for a rescan of its
+ * plan node. This requires calling any registered shutdown callbacks,
+ * since any partially complete set-returning-functions must be canceled.
+ *
+ * Note we make no assumption about the caller's memory context.
+ */
+void
+ReScanExprContext(ExprContext *econtext)
+{
+ /* Call any registered callbacks */
+ ShutdownExprContext(econtext);
+ /* And clean up the memory used */
+ MemoryContextReset(econtext->ecxt_per_tuple_memory);
+}
+
+/*
* Build a per-output-tuple ExprContext for an EState.
*
* This is normally invoked via GetPerTupleExprContext() macro,