-/* ----------------
- * 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);
- }
-}
-