diff options
Diffstat (limited to 'src/backend/access/index/indexam.c')
-rw-r--r-- | src/backend/access/index/indexam.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/backend/access/index/indexam.c b/src/backend/access/index/indexam.c index 02087659647..31d705c0561 100644 --- a/src/backend/access/index/indexam.c +++ b/src/backend/access/index/indexam.c @@ -126,7 +126,7 @@ do { \ } while(0) static IndexScanDesc index_beginscan_internal(Relation indexRelation, - int nkeys, int norderbys); + int nkeys, int norderbys, Snapshot snapshot); /* ---------------------------------------------------------------- @@ -234,7 +234,7 @@ index_beginscan(Relation heapRelation, { IndexScanDesc scan; - scan = index_beginscan_internal(indexRelation, nkeys, norderbys); + scan = index_beginscan_internal(indexRelation, nkeys, norderbys, snapshot); /* * Save additional parameters into the scandesc. Everything else was set @@ -259,7 +259,7 @@ index_beginscan_bitmap(Relation indexRelation, { IndexScanDesc scan; - scan = index_beginscan_internal(indexRelation, nkeys, 0); + scan = index_beginscan_internal(indexRelation, nkeys, 0, snapshot); /* * Save additional parameters into the scandesc. Everything else was set @@ -275,7 +275,7 @@ index_beginscan_bitmap(Relation indexRelation, */ static IndexScanDesc index_beginscan_internal(Relation indexRelation, - int nkeys, int norderbys) + int nkeys, int norderbys, Snapshot snapshot) { IndexScanDesc scan; FmgrInfo *procedure; @@ -284,7 +284,7 @@ index_beginscan_internal(Relation indexRelation, GET_REL_PROCEDURE(ambeginscan); if (!(indexRelation->rd_am->ampredlocks)) - PredicateLockRelation(indexRelation); + PredicateLockRelation(indexRelation, snapshot); /* * We hold a reference count to the relcache entry throughout the scan. @@ -602,7 +602,8 @@ index_getnext(IndexScanDesc scan, ScanDirection direction) scan->xs_cbuf); CheckForSerializableConflictOut(valid, scan->heapRelation, - heapTuple, scan->xs_cbuf); + heapTuple, scan->xs_cbuf, + scan->xs_snapshot); if (valid) { @@ -624,7 +625,7 @@ index_getnext(IndexScanDesc scan, ScanDirection direction) else scan->xs_next_hot = InvalidOffsetNumber; - PredicateLockTuple(scan->heapRelation, heapTuple); + PredicateLockTuple(scan->heapRelation, heapTuple, scan->xs_snapshot); LockBuffer(scan->xs_cbuf, BUFFER_LOCK_UNLOCK); |