/* ---------------------------------------------------------------- * ExecSeqRestrPos * * Restores scan position. * ---------------------------------------------------------------- */ void ExecSeqRestrPos(SeqScanState *node) { HeapScanDesc scan = node->ss_currentScanDesc; /* * Clear any reference to the previously returned tuple. This is needed * because the slot is simply pointing at scan->rs_cbuf, which * heap_restrpos will change; we'd have an internally inconsistent slot if * we didn't do this. */ ExecClearTuple(node->ss_ScanTupleSlot); heap_restrpos(scan); }
/* ---------------------------------------------------------------- * ExecSeqRestrPos * * Restores scan position. * ---------------------------------------------------------------- */ void ExecSeqRestrPos(SeqScanState *node) { HeapScanDesc scan = node->ss_currentScanDesc; Assert((node->scan_state & SCAN_SCAN) != 0); Assert((node->scan_state & SCAN_MARKPOS) != 0); /* * Clear any reference to the previously returned tuple. This is needed * because the slot is simply pointing at scan->rs_cbuf, which * heap_restrpos will change; we'd have an internally inconsistent slot if * we didn't do this. */ ExecClearTuple(node->ss_ScanTupleSlot); heap_restrpos(scan); Gpmon_M_Incr(GpmonPktFromSeqScanState(node), GPMON_SEQSCAN_RESTOREPOS); CheckSendPlanStateGpmonPkt(&node->ps); node->scan_state &= (~ ((int) SCAN_MARKPOS)); }
void RestrPosHeapRelation(ScanState *scanState) { Assert(IsA(scanState, TableScanState) || IsA(scanState, DynamicTableScanState)); SeqScanState *node = (SeqScanState *)scanState; Assert((node->ss.scan_state & SCAN_SCAN) != 0); Assert((node->ss.scan_state & SCAN_MARKPOS) != 0); /* * Clear any reference to the previously returned tuple. This is needed * because the slot is simply pointing at scan->rs_cbuf, which * heap_restrpos will change; we'd have an internally inconsistent slot if * we didn't do this. */ ExecClearTuple(node->ss.ss_ScanTupleSlot); Assert(node->opaque != NULL && node->opaque->ss_currentScanDesc != NULL); heap_restrpos(node->opaque->ss_currentScanDesc); node->ss.scan_state &= (~ ((int) SCAN_MARKPOS)); }