aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeTee.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/nodeTee.c')
-rw-r--r--src/backend/executor/nodeTee.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/backend/executor/nodeTee.c b/src/backend/executor/nodeTee.c
index 623a43b9e0c..7b0f7f1755e 100644
--- a/src/backend/executor/nodeTee.c
+++ b/src/backend/executor/nodeTee.c
@@ -15,7 +15,7 @@
* ExecEndTee
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.24 1998/10/08 18:29:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.25 1998/11/27 19:52:03 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@@ -342,11 +342,20 @@ ExecTee(Tee *node, Plan *parent)
slot = ExecProcNode(childNode, (Plan *) node);
if (!TupIsNull(slot))
{
- heapTuple = slot->val;
+ /*
+ * heap_insert changes something...
+ */
+ if (slot->ttc_buffer != InvalidBuffer)
+ heapTuple = heap_copytuple(slot->val);
+ else
+ heapTuple = slot->val;
/* insert into temporary relation */
heap_insert(bufferRel, heapTuple);
+ if (slot->ttc_buffer != InvalidBuffer)
+ pfree(heapTuple);
+
/*
* once there is data in the temporary relation, ensure that
* the left and right scandescs are initialized