diff options
Diffstat (limited to 'src/backend/executor')
-rw-r--r-- | src/backend/executor/execMain.c | 13 | ||||
-rw-r--r-- | src/backend/executor/nodeModifyTable.c | 22 | ||||
-rw-r--r-- | src/backend/executor/nodeTidscan.c | 16 |
3 files changed, 9 insertions, 42 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index 018e9912e94..426686b6ef6 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -2649,17 +2649,10 @@ EvalPlanQualFetchRowMarks(EPQState *epqstate) else { /* ordinary table, fetch the tuple */ - HeapTupleData tuple; - Buffer buffer; - - tuple.t_self = *((ItemPointer) DatumGetPointer(datum)); - if (!heap_fetch(erm->relation, SnapshotAny, &tuple, &buffer, - NULL)) + if (!table_fetch_row_version(erm->relation, + (ItemPointer) DatumGetPointer(datum), + SnapshotAny, slot)) elog(ERROR, "failed to fetch tuple for EvalPlanQual recheck"); - - /* successful, store tuple */ - ExecStorePinnedBufferHeapTuple(&tuple, slot, buffer); - ExecMaterializeSlot(slot); } } else diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c index 1374b751767..7be0e7745af 100644 --- a/src/backend/executor/nodeModifyTable.c +++ b/src/backend/executor/nodeModifyTable.c @@ -229,17 +229,13 @@ ExecCheckTIDVisible(EState *estate, TupleTableSlot *tempSlot) { Relation rel = relinfo->ri_RelationDesc; - Buffer buffer; - HeapTupleData tuple; /* Redundantly check isolation level */ if (!IsolationUsesXactSnapshot()) return; - tuple.t_self = *tid; - if (!heap_fetch(rel, SnapshotAny, &tuple, &buffer, NULL)) + if (!table_fetch_row_version(rel, tid, SnapshotAny, tempSlot)) elog(ERROR, "failed to fetch conflicting tuple for ON CONFLICT"); - ExecStorePinnedBufferHeapTuple(&tuple, tempSlot, buffer); ExecCheckTupleVisible(estate, rel, tempSlot); ExecClearTuple(tempSlot); } @@ -874,21 +870,9 @@ ldelete:; } else { - BufferHeapTupleTableSlot *bslot; - HeapTuple deltuple; - Buffer buffer; - - Assert(TTS_IS_BUFFERTUPLE(slot)); - ExecClearTuple(slot); - bslot = (BufferHeapTupleTableSlot *) slot; - deltuple = &bslot->base.tupdata; - - deltuple->t_self = *tupleid; - if (!heap_fetch(resultRelationDesc, SnapshotAny, - deltuple, &buffer, NULL)) + if (!table_fetch_row_version(resultRelationDesc, tupleid, + SnapshotAny, slot)) elog(ERROR, "failed to fetch deleted tuple for DELETE RETURNING"); - - ExecStorePinnedBufferHeapTuple(deltuple, slot, buffer); } } diff --git a/src/backend/executor/nodeTidscan.c b/src/backend/executor/nodeTidscan.c index 0e6a0748c8c..d8f9eb35570 100644 --- a/src/backend/executor/nodeTidscan.c +++ b/src/backend/executor/nodeTidscan.c @@ -310,7 +310,6 @@ TidNext(TidScanState *node) Relation heapRelation; HeapTuple tuple; TupleTableSlot *slot; - Buffer buffer = InvalidBuffer; ItemPointerData *tidList; int numTids; bool bBackward; @@ -376,19 +375,10 @@ TidNext(TidScanState *node) if (node->tss_isCurrentOf) heap_get_latest_tid(heapRelation, snapshot, &tuple->t_self); - if (heap_fetch(heapRelation, snapshot, tuple, &buffer, NULL)) - { - /* - * Store the scanned tuple in the scan tuple slot of the scan - * state, transferring the pin to the slot. - */ - ExecStorePinnedBufferHeapTuple(tuple, /* tuple to store */ - slot, /* slot to store in */ - buffer); /* buffer associated with - * tuple */ - + if (table_fetch_row_version(heapRelation, &tuple->t_self, snapshot, + slot)) return slot; - } + /* Bad TID or failed snapshot qual; try next */ if (bBackward) node->tss_TidPtr--; |