summaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeMaterial.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/nodeMaterial.c')
-rw-r--r--src/backend/executor/nodeMaterial.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/backend/executor/nodeMaterial.c b/src/backend/executor/nodeMaterial.c
index 08b5849463..fe12859557 100644
--- a/src/backend/executor/nodeMaterial.c
+++ b/src/backend/executor/nodeMaterial.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/nodeMaterial.c,v 1.48 2004/12/31 21:59:45 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeMaterial.c,v 1.49 2005/03/16 21:38:07 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -127,7 +127,7 @@ ExecMaterial(MaterialState *node)
node->eof_underlying = true;
return NULL;
}
- heapTuple = outerslot->val;
+ heapTuple = ExecFetchSlotTuple(outerslot);
should_free = false;
/*
@@ -139,10 +139,13 @@ ExecMaterial(MaterialState *node)
}
/*
- * Return the obtained tuple.
+ * Return the obtained tuple, if any.
*/
slot = (TupleTableSlot *) node->ss.ps.ps_ResultTupleSlot;
- return ExecStoreTuple(heapTuple, slot, InvalidBuffer, should_free);
+ if (heapTuple)
+ return ExecStoreTuple(heapTuple, slot, InvalidBuffer, should_free);
+ else
+ return ExecClearTuple(slot);
}
/* ----------------------------------------------------------------