diff options
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 | 61 | ||||
-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, 36 insertions, 53 deletions
diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c index f39b49ce720..e9ea3041b75 100644 --- a/src/backend/access/gist/gist.c +++ b/src/backend/access/gist/gist.c @@ -169,7 +169,7 @@ gistbuild(Relation heap, econtext = NULL; } #endif /* OMIT_PARTIAL_INDEX */ - scan = heap_beginscan(heap, 0, NowTimeQual, 0, (ScanKey) NULL); + scan = heap_beginscan(heap, 0, false, 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 93ae2885378..bcfe5fdfc8a 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.16 1997/09/08 21:40:45 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.17 1997/11/20 23:19:50 momjian 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, NowTimeQual, 0, (ScanKey) NULL); + hscan = heap_beginscan(heap, 0, false, 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 cc173f4fe8b..53fd3f882d9 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.21 1997/11/02 15:24:26 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.22 1997/11/20 23:19:57 momjian Exp $ * * * INTERFACE ROUTINES @@ -215,7 +215,7 @@ heapgettup(Relation relation, ItemPointer tid, int dir, Buffer *b, - TimeQual timeQual, + bool seeself, int nkeys, ScanKey key) { @@ -254,19 +254,11 @@ heapgettup(Relation relation, elog(DEBUG, "heapgettup(%.16s, tid=0x%x, dir=%d, ...)", RelationGetRelationName(relation), tid, dir); } - elog(DEBUG, "heapgettup(..., b=0x%x, timeQ=0x%x, nkeys=%d, key=0x%x", - b, timeQual, nkeys, key); - if (timeQual == SelfTimeQual) - { - elog(DEBUG, "heapgettup: relation(%c)=`%.16s', SelfTimeQual", - relation->rd_rel->relkind, &relation->rd_rel->relname); - } - else - { - elog(DEBUG, "heapgettup: relation(%c)=`%.16s', timeQual=%d", - relation->rd_rel->relkind, &relation->rd_rel->relname, - timeQual); - } + elog(DEBUG, "heapgettup(..., b=0x%x, nkeys=%d, key=0x%x", b, nkeys, key); + + elog(DEBUG, "heapgettup: relation(%c)=`%.16s', %s", + relation->rd_rel->relkind, &relation->rd_rel->relname, + (seeself == true) ? "SeeSelf" : "NoSeeSelf"); #endif /* !defined(HEAPDEBUGALL) */ if (!ItemPointerIsValid(tid)) @@ -303,9 +295,7 @@ heapgettup(Relation relation, #ifndef NO_BUFFERISVALID if (!BufferIsValid(*b)) - { elog(WARN, "heapgettup: failed ReadBuffer"); - } #endif dp = (Page) BufferGetPage(*b); @@ -430,7 +420,7 @@ heapgettup(Relation relation, * ---------------- */ HeapTupleSatisfies(lpp, relation, *b, (PageHeader) dp, - timeQual, nkeys, key, rtup); + seeself, nkeys, key, rtup); if (rtup != NULL) { ItemPointer iptr = &(rtup->t_ctid); @@ -618,7 +608,7 @@ heap_close(Relation relation) HeapScanDesc heap_beginscan(Relation relation, int atend, - TimeQual timeQual, + bool seeself, unsigned nkeys, ScanKey key) { @@ -646,9 +636,7 @@ heap_beginscan(Relation relation, /* XXX someday assert SelfTimeQual if relkind == RELKIND_UNCATALOGED */ if (relation->rd_rel->relkind == RELKIND_UNCATALOGED) - { - timeQual = SelfTimeQual; - } + seeself = true; /* ---------------- * increment relation ref count while scanning relation @@ -666,24 +654,19 @@ heap_beginscan(Relation relation, sdesc->rs_rd = relation; if (nkeys) - { - /* * we do this here instead of in initsdesc() because heap_rescan * also calls initsdesc() and we don't want to allocate memory * again */ sdesc->rs_key = (ScanKey) palloc(sizeof(ScanKeyData) * nkeys); - } else - { sdesc->rs_key = NULL; - } initsdesc(sdesc, relation, atend, nkeys, key); sdesc->rs_atend = atend; - sdesc->rs_tr = timeQual; + sdesc->rs_seeself = seeself; sdesc->rs_nkeys = (short) nkeys; return (sdesc); @@ -900,7 +883,7 @@ heap_getnext(HeapScanDesc scandesc, iptr, -1, &(sdesc->rs_cbuf), - sdesc->rs_tr, + sdesc->rs_seeself, sdesc->rs_nkeys, sdesc->rs_key); } @@ -987,7 +970,7 @@ heap_getnext(HeapScanDesc scandesc, iptr, 1, &sdesc->rs_cbuf, - sdesc->rs_tr, + sdesc->rs_seeself, sdesc->rs_nkeys, sdesc->rs_key); } @@ -1032,7 +1015,7 @@ heap_getnext(HeapScanDesc scandesc, */ HeapTuple heap_fetch(Relation relation, - TimeQual timeQual, + bool seeself, ItemPointer tid, Buffer *b) { @@ -1094,7 +1077,7 @@ heap_fetch(Relation relation, */ HeapTupleSatisfies(lp, relation, buffer, dp, - timeQual, 0, (ScanKey) NULL, tuple); + seeself, 0, (ScanKey) NULL, tuple); if (tuple == NULL) { @@ -1259,7 +1242,7 @@ heap_delete(Relation relation, ItemPointer tid) * ---------------- */ HeapTupleSatisfies(lp, relation, b, dp, - NowTimeQual, 0, (ScanKey) NULL, tp); + false, 0, (ScanKey) NULL, tp); if (!tp) { @@ -1395,7 +1378,7 @@ heap_replace(Relation relation, ItemPointer otid, HeapTuple tup) relation, buffer, (PageHeader) dp, - NowTimeQual, + false, 0, (ScanKey) NULL, tuple); @@ -1492,7 +1475,7 @@ heap_markpos(HeapScanDesc sdesc) (ItemPointer) NULL : &sdesc->rs_ctup->t_ctid, -1, &sdesc->rs_pbuf, - sdesc->rs_tr, + sdesc->rs_seeself, sdesc->rs_nkeys, sdesc->rs_key); @@ -1506,7 +1489,7 @@ heap_markpos(HeapScanDesc sdesc) (ItemPointer) NULL : &sdesc->rs_ctup->t_ctid, 1, &sdesc->rs_nbuf, - sdesc->rs_tr, + sdesc->rs_seeself, sdesc->rs_nkeys, sdesc->rs_key); } @@ -1594,7 +1577,7 @@ heap_restrpos(HeapScanDesc sdesc) &sdesc->rs_mptid, 0, &sdesc->rs_pbuf, - NowTimeQual, + false, 0, (ScanKey) NULL); } @@ -1610,7 +1593,7 @@ heap_restrpos(HeapScanDesc sdesc) &sdesc->rs_mctid, 0, &sdesc->rs_cbuf, - NowTimeQual, + false, 0, (ScanKey) NULL); } @@ -1626,7 +1609,7 @@ heap_restrpos(HeapScanDesc sdesc) &sdesc->rs_mntid, 0, &sdesc->rs_nbuf, - NowTimeQual, + false, 0, (ScanKey) NULL); } diff --git a/src/backend/access/index/istrat.c b/src/backend/access/index/istrat.c index d47ceed6d6a..36693592c46 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.12 1997/09/08 21:41:07 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.13 1997/11/20 23:20:07 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -508,7 +508,7 @@ OperatorRelationFillScanKeyEntry(Relation operatorRelation, ObjectIdEqualRegProcedure, ObjectIdGetDatum(operatorObjectId)); - scan = heap_beginscan(operatorRelation, false, NowTimeQual, + scan = heap_beginscan(operatorRelation, false, false, 1, &scanKeyData); tuple = heap_getnext(scan, false, (Buffer *) NULL); @@ -564,7 +564,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy, ObjectIdGetDatum(indexObjectId)); relation = heap_openr(IndexRelationName); - scan = heap_beginscan(relation, false, NowTimeQual, 1, entry); + scan = heap_beginscan(relation, false, false, 1, entry); tuple = heap_getnext(scan, 0, (Buffer *) NULL); if (!HeapTupleIsValid(tuple)) elog(WARN, "IndexSupportInitialize: corrupted catalogs"); @@ -628,7 +628,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy, entry[1].sk_argument = ObjectIdGetDatum(operatorClassObjectId[attributeNumber - 1]); - scan = heap_beginscan(relation, false, NowTimeQual, 2, entry); + scan = heap_beginscan(relation, false, false, 2, entry); while (tuple = heap_getnext(scan, 0, (Buffer *) NULL), HeapTupleIsValid(tuple)) @@ -671,7 +671,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy, for (strategy = 1; strategy <= maxStrategyNumber; strategy++) ScanKeyEntrySetIllegal(StrategyMapGetScanKeyEntry(map, strategy)); - scan = heap_beginscan(relation, false, NowTimeQual, 2, entry); + scan = heap_beginscan(relation, false, false, 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 f634cf6715d..340d8308121 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.20 1997/09/08 21:41:18 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.21 1997/11/20 23:20:16 momjian 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, SelfTimeQual, &(itup->t_tid), NULL); + htup = heap_fetch(heapRel, true, &(itup->t_tid), NULL); if (htup != (HeapTuple) NULL) { /* it is a duplicate */ elog(WARN, "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 0bdd55d7322..bf4c1bfae9d 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.23 1997/09/08 21:41:24 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.24 1997/11/20 23:20:21 momjian 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, NowTimeQual, 0, (ScanKey) NULL); + hscan = heap_beginscan(heap, 0, false, 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 9415fc16558..a51f3c36728 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.18 1997/09/18 20:19:59 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.19 1997/11/20 23:20:26 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -164,7 +164,7 @@ rtbuild(Relation heap, slot = NULL; } #endif /* OMIT_PARTIAL_INDEX */ - scan = heap_beginscan(heap, 0, NowTimeQual, 0, (ScanKey) NULL); + scan = heap_beginscan(heap, 0, false, 0, (ScanKey) NULL); htup = heap_getnext(scan, 0, &buffer); /* count the tuples as we insert them */ |