-------------------------------- * ExecFetchSlotHeapTupleDatum * Fetch the slot's tuple as a composite-type Datum. * * The result is always freshly palloc'd in the caller's memory context. * -------------------------------- */
| 1737 | * -------------------------------- |
| 1738 | */ |
| 1739 | Datum |
| 1740 | ExecFetchSlotHeapTupleDatum(TupleTableSlot *slot) |
| 1741 | { |
| 1742 | HeapTuple tup; |
| 1743 | TupleDesc tupdesc; |
| 1744 | bool shouldFree; |
| 1745 | Datum ret; |
| 1746 | |
| 1747 | /* Fetch slot's contents in regular-physical-tuple form */ |
| 1748 | tup = ExecFetchSlotHeapTuple(slot, false, &shouldFree); |
| 1749 | tupdesc = slot->tts_tupleDescriptor; |
| 1750 | |
| 1751 | /* Convert to Datum form */ |
| 1752 | ret = heap_copy_tuple_as_datum(tup, tupdesc); |
| 1753 | |
| 1754 | if (shouldFree) |
| 1755 | pfree(tup); |
| 1756 | |
| 1757 | return ret; |
| 1758 | } |
| 1759 | |
| 1760 | /* ---------------------------------------------------------------- |
| 1761 | * convenience initialization routines |
no test coverage detected