diff options
author | Vadim B. Mikheev <vadim4o@yahoo.com> | 1998-07-27 19:38:40 +0000 |
---|---|---|
committer | Vadim B. Mikheev <vadim4o@yahoo.com> | 1998-07-27 19:38:40 +0000 |
commit | be8300b18f26363c0b18c62fa884a6a62e26405e (patch) | |
tree | a44ac3f51d81a7616bd9c7912fa23a5e81c9d483 /src/backend/access | |
parent | f7f989c9907b181f1785c699e6384e6eba8ae9a5 (diff) | |
download | postgresql-be8300b18f26363c0b18c62fa884a6a62e26405e.tar.gz postgresql-be8300b18f26363c0b18c62fa884a6a62e26405e.zip |
Use Snapshot in heap access methods.
Diffstat (limited to 'src/backend/access')
-rw-r--r-- | src/backend/access/gist/gist.c | 2 | ||||
-rw-r--r-- | src/backend/access/hash/hash.c | 4 | ||||
-rw-r--r-- | src/backend/access/heap/heapam.c | 28 | ||||
-rw-r--r-- | src/backend/access/index/istrat.c | 10 | ||||
-rw-r--r-- | src/backend/access/nbtree/nbtinsert.c | 4 | ||||
-rw-r--r-- | src/backend/access/nbtree/nbtree.c | 4 | ||||
-rw-r--r-- | src/backend/access/rtree/rtree.c | 4 |
7 files changed, 28 insertions, 28 deletions
diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c index 5003204df4a..1445ff7f2eb 100644 --- a/src/backend/access/gist/gist.c +++ b/src/backend/access/gist/gist.c @@ -170,7 +170,7 @@ gistbuild(Relation heap, econtext = NULL; } #endif /* OMIT_PARTIAL_INDEX */ - scan = heap_beginscan(heap, 0, false, 0, (ScanKey) NULL); + scan = heap_beginscan(heap, 0, SnapshotNow, 0, (ScanKey) NULL); htup = heap_getnext(scan, 0, &buffer); /* int the tuples as we insert them */ diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c index e443f393ba0..6e913e7da49 100644 --- a/src/backend/access/hash/hash.c +++ b/src/backend/access/hash/hash.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.18 1998/02/26 04:29:28 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.19 1998/07/27 19:37:35 vadim Exp $ * * NOTES * This file contains only the public interface routines. @@ -121,7 +121,7 @@ hashbuild(Relation heap, #endif /* OMIT_PARTIAL_INDEX */ /* start a heap scan */ - hscan = heap_beginscan(heap, 0, false, 0, (ScanKey) NULL); + hscan = heap_beginscan(heap, 0, SnapshotNow, 0, (ScanKey) NULL); htup = heap_getnext(hscan, 0, &buffer); /* build the index */ diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 10c0abd2cd0..75127b027d1 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.30 1998/07/20 16:56:53 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.31 1998/07/27 19:37:36 vadim Exp $ * * * INTERFACE ROUTINES @@ -209,7 +209,7 @@ heapgettup(Relation relation, ItemPointer tid, int dir, Buffer *b, - bool seeself, + Snapshot snapshot, int nkeys, ScanKey key) { @@ -250,9 +250,9 @@ heapgettup(Relation relation, } elog(DEBUG, "heapgettup(..., b=0x%x, nkeys=%d, key=0x%x", b, nkeys, key); - elog(DEBUG, "heapgettup: relation(%c)=`%s', %s", + elog(DEBUG, "heapgettup: relation(%c)=`%s', %p", relation->rd_rel->relkind, &relation->rd_rel->relname, - (seeself == true) ? "SeeSelf" : "NoSeeSelf"); + snapshot); #endif /* !defined(HEAPDEBUGALL) */ if (!ItemPointerIsValid(tid)) @@ -402,7 +402,7 @@ heapgettup(Relation relation, * ---------------- */ HeapTupleSatisfies(lpp, relation, *b, (PageHeader) dp, - seeself, nkeys, key, rtup); + snapshot, nkeys, key, rtup); if (rtup != NULL) { ItemPointer iptr = &(rtup->t_ctid); @@ -580,7 +580,7 @@ heap_close(Relation relation) HeapScanDesc heap_beginscan(Relation relation, int atend, - bool seeself, + Snapshot snapshot, unsigned nkeys, ScanKey key) { @@ -608,7 +608,7 @@ heap_beginscan(Relation relation, /* XXX someday assert SelfTimeQual if relkind == RELKIND_UNCATALOGED */ if (relation->rd_rel->relkind == RELKIND_UNCATALOGED) - seeself = true; + snapshot = SnapshotSelf; /* ---------------- * increment relation ref count while scanning relation @@ -639,7 +639,7 @@ heap_beginscan(Relation relation, initsdesc(sdesc, relation, atend, nkeys, key); sdesc->rs_atend = atend; - sdesc->rs_seeself = seeself; + sdesc->rs_snapshot = snapshot; sdesc->rs_nkeys = (short) nkeys; return (sdesc); @@ -856,7 +856,7 @@ heap_getnext(HeapScanDesc scandesc, iptr, -1, &(sdesc->rs_cbuf), - sdesc->rs_seeself, + sdesc->rs_snapshot, sdesc->rs_nkeys, sdesc->rs_key); } @@ -943,7 +943,7 @@ heap_getnext(HeapScanDesc scandesc, iptr, 1, &sdesc->rs_cbuf, - sdesc->rs_seeself, + sdesc->rs_snapshot, sdesc->rs_nkeys, sdesc->rs_key); } @@ -988,7 +988,7 @@ heap_getnext(HeapScanDesc scandesc, */ HeapTuple heap_fetch(Relation relation, - bool seeself, + Snapshot snapshot, ItemPointer tid, Buffer *b) { @@ -1050,7 +1050,7 @@ heap_fetch(Relation relation, */ HeapTupleSatisfies(lp, relation, buffer, dp, - seeself, 0, (ScanKey) NULL, tuple); + snapshot, 0, (ScanKey) NULL, tuple); if (tuple == NULL) { @@ -1447,7 +1447,7 @@ heap_markpos(HeapScanDesc sdesc) (ItemPointer) NULL : &sdesc->rs_ctup->t_ctid, -1, &sdesc->rs_pbuf, - sdesc->rs_seeself, + sdesc->rs_snapshot, sdesc->rs_nkeys, sdesc->rs_key); @@ -1461,7 +1461,7 @@ heap_markpos(HeapScanDesc sdesc) (ItemPointer) NULL : &sdesc->rs_ctup->t_ctid, 1, &sdesc->rs_nbuf, - sdesc->rs_seeself, + sdesc->rs_snapshot, sdesc->rs_nkeys, sdesc->rs_key); } diff --git a/src/backend/access/index/istrat.c b/src/backend/access/index/istrat.c index b0b0cdc452d..5b940ba1155 100644 --- a/src/backend/access/index/istrat.c +++ b/src/backend/access/index/istrat.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.20 1998/06/15 19:27:54 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.21 1998/07/27 19:37:37 vadim Exp $ * *------------------------------------------------------------------------- */ @@ -501,7 +501,7 @@ OperatorRelationFillScanKeyEntry(Relation operatorRelation, F_OIDEQ, ObjectIdGetDatum(operatorObjectId)); - scan = heap_beginscan(operatorRelation, false, false, + scan = heap_beginscan(operatorRelation, false, SnapshotNow, 1, &scanKeyData); tuple = heap_getnext(scan, false, (Buffer *) NULL); @@ -558,7 +558,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy, ObjectIdGetDatum(indexObjectId)); relation = heap_openr(IndexRelationName); - scan = heap_beginscan(relation, false, false, 1, entry); + scan = heap_beginscan(relation, false, SnapshotNow, 1, entry); tuple = heap_getnext(scan, 0, (Buffer *) NULL); if (!HeapTupleIsValid(tuple)) elog(ERROR, "IndexSupportInitialize: corrupted catalogs"); @@ -618,7 +618,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy, entry[1].sk_argument = ObjectIdGetDatum(operatorClassObjectId[attributeNumber - 1]); - scan = heap_beginscan(relation, false, false, 2, entry); + scan = heap_beginscan(relation, false, SnapshotNow, 2, entry); while (tuple = heap_getnext(scan, 0, (Buffer *) NULL), HeapTupleIsValid(tuple)) @@ -661,7 +661,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy, for (strategy = 1; strategy <= maxStrategyNumber; strategy++) ScanKeyEntrySetIllegal(StrategyMapGetScanKeyEntry(map, strategy)); - scan = heap_beginscan(relation, false, false, 2, entry); + scan = heap_beginscan(relation, false, SnapshotNow, 2, entry); while (tuple = heap_getnext(scan, 0, (Buffer *) NULL), HeapTupleIsValid(tuple)) diff --git a/src/backend/access/nbtree/nbtinsert.c b/src/backend/access/nbtree/nbtinsert.c index 350e198514b..046cce37a0c 100644 --- a/src/backend/access/nbtree/nbtinsert.c +++ b/src/backend/access/nbtree/nbtinsert.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.26 1998/06/15 19:27:55 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.27 1998/07/27 19:37:39 vadim Exp $ * *------------------------------------------------------------------------- */ @@ -120,7 +120,7 @@ _bt_doinsert(Relation rel, BTItem btitem, bool index_is_unique, Relation heapRel { /* they're equal */ btitem = (BTItem) PageGetItem(page, PageGetItemId(page, offset)); itup = &(btitem->bti_itup); - htup = heap_fetch(heapRel, true, &(itup->t_tid), NULL); + htup = heap_fetch(heapRel, SnapshotSelf, &(itup->t_tid), NULL); if (htup != (HeapTuple) NULL) { /* it is a duplicate */ elog(ERROR, "Cannot insert a duplicate key into a unique index"); diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c index b4d1185a601..c4ea6aa6127 100644 --- a/src/backend/access/nbtree/nbtree.c +++ b/src/backend/access/nbtree/nbtree.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.26 1998/06/15 19:27:56 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.27 1998/07/27 19:37:40 vadim Exp $ * * NOTES * This file contains only the public interface routines. @@ -153,7 +153,7 @@ btbuild(Relation heap, #endif /* OMIT_PARTIAL_INDEX */ /* start a heap scan */ - hscan = heap_beginscan(heap, 0, false, 0, (ScanKey) NULL); + hscan = heap_beginscan(heap, 0, SnapshotNow, 0, (ScanKey) NULL); htup = heap_getnext(hscan, 0, &buffer); /* build the index */ diff --git a/src/backend/access/rtree/rtree.c b/src/backend/access/rtree/rtree.c index 57217b050b3..f8ea84a6d0c 100644 --- a/src/backend/access/rtree/rtree.c +++ b/src/backend/access/rtree/rtree.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.24 1998/06/15 19:28:01 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.25 1998/07/27 19:37:41 vadim Exp $ * *------------------------------------------------------------------------- */ @@ -164,7 +164,7 @@ rtbuild(Relation heap, slot = NULL; } #endif /* OMIT_PARTIAL_INDEX */ - scan = heap_beginscan(heap, 0, false, 0, (ScanKey) NULL); + scan = heap_beginscan(heap, 0, SnapshotNow, 0, (ScanKey) NULL); htup = heap_getnext(scan, 0, &buffer); /* count the tuples as we insert them */ |