* ExecFetchSlotHeapTuple - fetch HeapTuple representing the slot's content * * The returned HeapTuple represents the slot's content as closely as * possible. * * If materialize is true, the contents of the slots will be made independent * from the underlying storage (i.e. all buffer pins are released, memory is * allocated in the slot's context). * * If shouldFree is not-NULL it'll be set
| 1658 | * behaviour, all such modifications are in the process of being removed. |
| 1659 | */ |
| 1660 | HeapTuple |
| 1661 | ExecFetchSlotHeapTuple(TupleTableSlot *slot, bool materialize, bool *shouldFree) |
| 1662 | { |
| 1663 | /* |
| 1664 | * sanity checks |
| 1665 | */ |
| 1666 | Assert(slot != NULL); |
| 1667 | Assert(!TTS_EMPTY(slot)); |
| 1668 | |
| 1669 | /* Materialize the tuple so that the slot "owns" it, if requested. */ |
| 1670 | if (materialize) |
| 1671 | slot->tts_ops->materialize(slot); |
| 1672 | |
| 1673 | if (slot->tts_ops->get_heap_tuple == NULL) |
| 1674 | { |
| 1675 | if (shouldFree) |
| 1676 | *shouldFree = true; |
| 1677 | return slot->tts_ops->copy_heap_tuple(slot); |
| 1678 | } |
| 1679 | else |
| 1680 | { |
| 1681 | if (shouldFree) |
| 1682 | *shouldFree = false; |
| 1683 | return slot->tts_ops->get_heap_tuple(slot); |
| 1684 | } |
| 1685 | } |
| 1686 | |
| 1687 | /* -------------------------------- |
| 1688 | * ExecFetchSlotMinimalTuple |
no outgoing calls
no test coverage detected