summaryrefslogtreecommitdiff
path: root/src/backend/access/heap/heapam.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2014-11-20 20:20:54 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2014-11-20 20:20:54 -0500
commitadbfab119b308a7e0e6b1305de9be222cfd5c85b (patch)
treeed4697f645d855d8d7c7ffef73eecd3d8ba05133 /src/backend/access/heap/heapam.c
parenta34fa8ee7cc757671632dc4dcae4f21e8f2e2357 (diff)
Remove dead code supporting mark/restore in SeqScan, TidScan, ValuesScan.
There seems no prospect that any of this will ever be useful, and indeed it's questionable whether some of it would work if it ever got called; it's certainly not been exercised in a very long time, if ever. So let's get rid of it, and make the comments about mark/restore in execAmi.c less wishy-washy. The mark/restore support for Result nodes is also currently dead code, but that's due to planner limitations not because it's impossible that it could be useful. So I left it in.
Diffstat (limited to 'src/backend/access/heap/heapam.c')
-rw-r--r--src/backend/access/heap/heapam.c70
1 files changed, 0 insertions, 70 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index c6e1eb79b2c..df4853bad14 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -27,8 +27,6 @@
* heap_multi_insert - insert multiple tuples into a relation
* heap_delete - delete a tuple from a relation
* heap_update - replace a tuple in a relation with another tuple
- * heap_markpos - mark scan position
- * heap_restrpos - restore position to marked location
* heap_sync - sync heap, for when no WAL has been written
*
* NOTES
@@ -280,9 +278,6 @@ initscan(HeapScanDesc scan, ScanKey key, bool is_rescan)
scan->rs_cbuf = InvalidBuffer;
scan->rs_cblock = InvalidBlockNumber;
- /* we don't have a marked position... */
- ItemPointerSetInvalid(&(scan->rs_mctid));
-
/* page-at-a-time fields are always invalid when not rs_inited */
/*
@@ -6317,71 +6312,6 @@ heap_tuple_needs_freeze(HeapTupleHeader tuple, TransactionId cutoff_xid,
return false;
}
-/* ----------------
- * heap_markpos - mark scan position
- * ----------------
- */
-void
-heap_markpos(HeapScanDesc scan)
-{
- /* Note: no locking manipulations needed */
-
- if (scan->rs_ctup.t_data != NULL)
- {
- scan->rs_mctid = scan->rs_ctup.t_self;
- if (scan->rs_pageatatime)
- scan->rs_mindex = scan->rs_cindex;
- }
- else
- ItemPointerSetInvalid(&scan->rs_mctid);
-}
-
-/* ----------------
- * heap_restrpos - restore position to marked location
- * ----------------
- */
-void
-heap_restrpos(HeapScanDesc scan)
-{
- /* XXX no amrestrpos checking that ammarkpos called */
-
- if (!ItemPointerIsValid(&scan->rs_mctid))
- {
- scan->rs_ctup.t_data = NULL;
-
- /*
- * unpin scan buffers
- */
- if (BufferIsValid(scan->rs_cbuf))
- ReleaseBuffer(scan->rs_cbuf);
- scan->rs_cbuf = InvalidBuffer;
- scan->rs_cblock = InvalidBlockNumber;
- scan->rs_inited = false;
- }
- else
- {
- /*
- * If we reached end of scan, rs_inited will now be false. We must
- * reset it to true to keep heapgettup from doing the wrong thing.
- */
- scan->rs_inited = true;
- scan->rs_ctup.t_self = scan->rs_mctid;
- if (scan->rs_pageatatime)
- {
- scan->rs_cindex = scan->rs_mindex;
- heapgettup_pagemode(scan,
- NoMovementScanDirection,
- 0, /* needn't recheck scan keys */
- NULL);
- }
- else
- heapgettup(scan,
- NoMovementScanDirection,
- 0, /* needn't recheck scan keys */
- NULL);
- }
-}
-
/*
* If 'tuple' contains any visible XID greater than latestRemovedXid,
* ratchet forwards latestRemovedXid to the greatest one found.