summaryrefslogtreecommitdiff
path: root/src/backend/executor/execTuples.c
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2018-04-01 08:16:18 +0930
committerAndrew Dunstan <andrew@dunslane.net>2018-04-01 08:16:18 +0930
commited69864350a59c51c8570900601ebd335956b638 (patch)
tree17117e23296f6a471aa584830dfcc0363b10a4c8 /src/backend/executor/execTuples.c
parent94173d3eeb445ae49020c5e2d9e166856d923eaf (diff)
Small cleanups in fast default code.
Problems identified by Andres Freund and Haribabu Kommi
Diffstat (limited to 'src/backend/executor/execTuples.c')
-rw-r--r--src/backend/executor/execTuples.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/backend/executor/execTuples.c b/src/backend/executor/execTuples.c
index 78cfcadea03..ea06aeedb21 100644
--- a/src/backend/executor/execTuples.c
+++ b/src/backend/executor/execTuples.c
@@ -626,8 +626,7 @@ ExecCopySlotMinimalTuple(TupleTableSlot *slot)
return heap_copy_minimal_tuple(slot->tts_mintuple);
if (slot->tts_tuple)
{
- if (TTS_HAS_PHYSICAL_TUPLE(slot) &&
- HeapTupleHeaderGetNatts(slot->tts_tuple->t_data)
+ if (HeapTupleHeaderGetNatts(slot->tts_tuple->t_data)
< slot->tts_tupleDescriptor->natts)
return minimal_expand_tuple(slot->tts_tuple,
slot->tts_tupleDescriptor);
@@ -675,18 +674,15 @@ ExecFetchSlotTuple(TupleTableSlot *slot)
if (HeapTupleHeaderGetNatts(slot->tts_tuple->t_data) <
slot->tts_tupleDescriptor->natts)
{
+ HeapTuple tuple;
MemoryContext oldContext = MemoryContextSwitchTo(slot->tts_mcxt);
- slot->tts_tuple = heap_expand_tuple(slot->tts_tuple,
- slot->tts_tupleDescriptor);
- slot->tts_shouldFree = true;
+ tuple = heap_expand_tuple(slot->tts_tuple,
+ slot->tts_tupleDescriptor);
MemoryContextSwitchTo(oldContext);
- return slot->tts_tuple;
- }
- else
- {
- return slot->tts_tuple;
+ slot = ExecStoreTuple(tuple, slot, InvalidBuffer, true);
}
+ return slot->tts_tuple;
}
/*