diff options
Diffstat (limited to 'src/backend/executor/execTuples.c')
-rw-r--r-- | src/backend/executor/execTuples.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/backend/executor/execTuples.c b/src/backend/executor/execTuples.c index e1948670490..2a12bd56ea9 100644 --- a/src/backend/executor/execTuples.c +++ b/src/backend/executor/execTuples.c @@ -1543,6 +1543,32 @@ ExecStoreAllNullTuple(TupleTableSlot *slot) } /* + * Store a HeapTuple in datum form, into a slot. That always requires + * deforming it and storing it in virtual form. + * + * Until the slot is materialized, the contents of the slot depend on the + * datum. + */ +void +ExecStoreHeapTupleDatum(Datum data, TupleTableSlot *slot) +{ + HeapTupleData tuple = {0}; + HeapTupleHeader td; + + td = DatumGetHeapTupleHeader(data); + + tuple.t_len = HeapTupleHeaderGetDatumLength(td); + tuple.t_self = td->t_ctid; + tuple.t_data = td; + + ExecClearTuple(slot); + + heap_deform_tuple(&tuple, slot->tts_tupleDescriptor, + slot->tts_values, slot->tts_isnull); + ExecStoreVirtualTuple(slot); +} + +/* * ExecFetchSlotHeapTuple - fetch HeapTuple representing the slot's content * * The returned HeapTuple represents the slot's content as closely as |