MCPcopy Create free account
hub / github.com/apache/cloudberry / ExecForceStoreHeapTuple

Function ExecForceStoreHeapTuple

src/backend/executor/execTuples.c:1485–1522  ·  view source on GitHub ↗

* Store a HeapTuple into any kind of slot, performing conversion if * necessary. */

Source from the content-addressed store, hash-verified

1483 * necessary.
1484 */
1485void
1486ExecForceStoreHeapTuple(HeapTuple tuple,
1487 TupleTableSlot *slot,
1488 bool shouldFree)
1489{
1490 if (TTS_IS_HEAPTUPLE(slot))
1491 {
1492 ExecStoreHeapTuple(tuple, slot, shouldFree);
1493 }
1494 else if (TTS_IS_BUFFERTUPLE(slot))
1495 {
1496 MemoryContext oldContext;
1497 BufferHeapTupleTableSlot *bslot = (BufferHeapTupleTableSlot *) slot;
1498
1499 ExecClearTuple(slot);
1500 slot->tts_flags &= ~TTS_FLAG_EMPTY;
1501 oldContext = MemoryContextSwitchTo(slot->tts_mcxt);
1502 bslot->base.tuple = heap_copytuple(tuple);
1503 slot->tts_flags |= TTS_FLAG_SHOULDFREE;
1504 MemoryContextSwitchTo(oldContext);
1505
1506 if (shouldFree)
1507 pfree(tuple);
1508 }
1509 else
1510 {
1511 ExecClearTuple(slot);
1512 heap_deform_tuple(tuple, slot->tts_tupleDescriptor,
1513 slot->tts_values, slot->tts_isnull);
1514 ExecStoreVirtualTuple(slot);
1515
1516 if (shouldFree)
1517 {
1518 ExecMaterializeSlot(slot);
1519 pfree(tuple);
1520 }
1521 }
1522}
1523
1524/*
1525 * Store a MinimalTuple into any kind of slot, performing conversion if

Callers 14

store_returning_resultFunction · 0.85
ExecBRInsertTriggersFunction · 0.85
ExecIRInsertTriggersFunction · 0.85
ExecBRDeleteTriggersFunction · 0.85
ExecARDeleteTriggersFunction · 0.85
ExecIRDeleteTriggersFunction · 0.85
ExecBRUpdateTriggersFunction · 0.85
ExecARUpdateTriggersFunction · 0.85
ExecIRUpdateTriggersFunction · 0.85
IndexOnlyNextFunction · 0.85
ExecDeleteFunction · 0.85
ExecModifyTableFunction · 0.85

Calls 8

ExecStoreHeapTupleFunction · 0.85
ExecClearTupleFunction · 0.85
MemoryContextSwitchToFunction · 0.85
heap_copytupleFunction · 0.85
heap_deform_tupleFunction · 0.85
ExecStoreVirtualTupleFunction · 0.85
ExecMaterializeSlotFunction · 0.85
pfreeFunction · 0.50

Tested by

no test coverage detected