Skip to content

Commit e9e1ff2

Browse files
committed
Remove all time travel stuff. Small parser cleanup.
1 parent e075271 commit e9e1ff2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+574
-899
lines changed

src/backend/access/gist/gist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ gistbuild(Relation heap,
169169
econtext = NULL;
170170
}
171171
#endif /* OMIT_PARTIAL_INDEX */
172-
scan = heap_beginscan(heap, 0, NowTimeQual, 0, (ScanKey) NULL);
172+
scan = heap_beginscan(heap, 0, false, 0, (ScanKey) NULL);
173173
htup = heap_getnext(scan, 0, &buffer);
174174

175175
/* int the tuples as we insert them */

src/backend/access/hash/hash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.16 1997/09/08 21:40:45 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.17 1997/11/20 23:19:50 momjian Exp $
1111
*
1212
* NOTES
1313
* This file contains only the public interface routines.
@@ -121,7 +121,7 @@ hashbuild(Relation heap,
121121
#endif /* OMIT_PARTIAL_INDEX */
122122

123123
/* start a heap scan */
124-
hscan = heap_beginscan(heap, 0, NowTimeQual, 0, (ScanKey) NULL);
124+
hscan = heap_beginscan(heap, 0, false, 0, (ScanKey) NULL);
125125
htup = heap_getnext(hscan, 0, &buffer);
126126

127127
/* build the index */

src/backend/access/heap/heapam.c

Lines changed: 22 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.21 1997/11/02 15:24:26 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.22 1997/11/20 23:19:57 momjian Exp $
1111
*
1212
*
1313
* INTERFACE ROUTINES
@@ -215,7 +215,7 @@ heapgettup(Relation relation,
215215
ItemPointer tid,
216216
int dir,
217217
Buffer *b,
218-
TimeQual timeQual,
218+
bool seeself,
219219
int nkeys,
220220
ScanKey key)
221221
{
@@ -254,19 +254,11 @@ heapgettup(Relation relation,
254254
elog(DEBUG, "heapgettup(%.16s, tid=0x%x, dir=%d, ...)",
255255
RelationGetRelationName(relation), tid, dir);
256256
}
257-
elog(DEBUG, "heapgettup(..., b=0x%x, timeQ=0x%x, nkeys=%d, key=0x%x",
258-
b, timeQual, nkeys, key);
259-
if (timeQual == SelfTimeQual)
260-
{
261-
elog(DEBUG, "heapgettup: relation(%c)=`%.16s', SelfTimeQual",
262-
relation->rd_rel->relkind, &relation->rd_rel->relname);
263-
}
264-
else
265-
{
266-
elog(DEBUG, "heapgettup: relation(%c)=`%.16s', timeQual=%d",
267-
relation->rd_rel->relkind, &relation->rd_rel->relname,
268-
timeQual);
269-
}
257+
elog(DEBUG, "heapgettup(..., b=0x%x, nkeys=%d, key=0x%x", b, nkeys, key);
258+
259+
elog(DEBUG, "heapgettup: relation(%c)=`%.16s', %s",
260+
relation->rd_rel->relkind, &relation->rd_rel->relname,
261+
(seeself == true) ? "SeeSelf" : "NoSeeSelf");
270262
#endif /* !defined(HEAPDEBUGALL) */
271263

272264
if (!ItemPointerIsValid(tid))
@@ -303,9 +295,7 @@ heapgettup(Relation relation,
303295

304296
#ifndef NO_BUFFERISVALID
305297
if (!BufferIsValid(*b))
306-
{
307298
elog(WARN, "heapgettup: failed ReadBuffer");
308-
}
309299
#endif
310300

311301
dp = (Page) BufferGetPage(*b);
@@ -430,7 +420,7 @@ heapgettup(Relation relation,
430420
* ----------------
431421
*/
432422
HeapTupleSatisfies(lpp, relation, *b, (PageHeader) dp,
433-
timeQual, nkeys, key, rtup);
423+
seeself, nkeys, key, rtup);
434424
if (rtup != NULL)
435425
{
436426
ItemPointer iptr = &(rtup->t_ctid);
@@ -618,7 +608,7 @@ heap_close(Relation relation)
618608
HeapScanDesc
619609
heap_beginscan(Relation relation,
620610
int atend,
621-
TimeQual timeQual,
611+
bool seeself,
622612
unsigned nkeys,
623613
ScanKey key)
624614
{
@@ -646,9 +636,7 @@ heap_beginscan(Relation relation,
646636

647637
/* XXX someday assert SelfTimeQual if relkind == RELKIND_UNCATALOGED */
648638
if (relation->rd_rel->relkind == RELKIND_UNCATALOGED)
649-
{
650-
timeQual = SelfTimeQual;
651-
}
639+
seeself = true;
652640

653641
/* ----------------
654642
* increment relation ref count while scanning relation
@@ -666,24 +654,19 @@ heap_beginscan(Relation relation,
666654
sdesc->rs_rd = relation;
667655

668656
if (nkeys)
669-
{
670-
671657
/*
672658
* we do this here instead of in initsdesc() because heap_rescan
673659
* also calls initsdesc() and we don't want to allocate memory
674660
* again
675661
*/
676662
sdesc->rs_key = (ScanKey) palloc(sizeof(ScanKeyData) * nkeys);
677-
}
678663
else
679-
{
680664
sdesc->rs_key = NULL;
681-
}
682665

683666
initsdesc(sdesc, relation, atend, nkeys, key);
684667

685668
sdesc->rs_atend = atend;
686-
sdesc->rs_tr = timeQual;
669+
sdesc->rs_seeself = seeself;
687670
sdesc->rs_nkeys = (short) nkeys;
688671

689672
return (sdesc);
@@ -900,7 +883,7 @@ heap_getnext(HeapScanDesc scandesc,
900883
iptr,
901884
-1,
902885
&(sdesc->rs_cbuf),
903-
sdesc->rs_tr,
886+
sdesc->rs_seeself,
904887
sdesc->rs_nkeys,
905888
sdesc->rs_key);
906889
}
@@ -987,7 +970,7 @@ heap_getnext(HeapScanDesc scandesc,
987970
iptr,
988971
1,
989972
&sdesc->rs_cbuf,
990-
sdesc->rs_tr,
973+
sdesc->rs_seeself,
991974
sdesc->rs_nkeys,
992975
sdesc->rs_key);
993976
}
@@ -1032,7 +1015,7 @@ heap_getnext(HeapScanDesc scandesc,
10321015
*/
10331016
HeapTuple
10341017
heap_fetch(Relation relation,
1035-
TimeQual timeQual,
1018+
bool seeself,
10361019
ItemPointer tid,
10371020
Buffer *b)
10381021
{
@@ -1094,7 +1077,7 @@ heap_fetch(Relation relation,
10941077
*/
10951078

10961079
HeapTupleSatisfies(lp, relation, buffer, dp,
1097-
timeQual, 0, (ScanKey) NULL, tuple);
1080+
seeself, 0, (ScanKey) NULL, tuple);
10981081

10991082
if (tuple == NULL)
11001083
{
@@ -1259,7 +1242,7 @@ heap_delete(Relation relation, ItemPointer tid)
12591242
* ----------------
12601243
*/
12611244
HeapTupleSatisfies(lp, relation, b, dp,
1262-
NowTimeQual, 0, (ScanKey) NULL, tp);
1245+
false, 0, (ScanKey) NULL, tp);
12631246
if (!tp)
12641247
{
12651248

@@ -1395,7 +1378,7 @@ heap_replace(Relation relation, ItemPointer otid, HeapTuple tup)
13951378
relation,
13961379
buffer,
13971380
(PageHeader) dp,
1398-
NowTimeQual,
1381+
false,
13991382
0,
14001383
(ScanKey) NULL,
14011384
tuple);
@@ -1492,7 +1475,7 @@ heap_markpos(HeapScanDesc sdesc)
14921475
(ItemPointer) NULL : &sdesc->rs_ctup->t_ctid,
14931476
-1,
14941477
&sdesc->rs_pbuf,
1495-
sdesc->rs_tr,
1478+
sdesc->rs_seeself,
14961479
sdesc->rs_nkeys,
14971480
sdesc->rs_key);
14981481

@@ -1506,7 +1489,7 @@ heap_markpos(HeapScanDesc sdesc)
15061489
(ItemPointer) NULL : &sdesc->rs_ctup->t_ctid,
15071490
1,
15081491
&sdesc->rs_nbuf,
1509-
sdesc->rs_tr,
1492+
sdesc->rs_seeself,
15101493
sdesc->rs_nkeys,
15111494
sdesc->rs_key);
15121495
}
@@ -1594,7 +1577,7 @@ heap_restrpos(HeapScanDesc sdesc)
15941577
&sdesc->rs_mptid,
15951578
0,
15961579
&sdesc->rs_pbuf,
1597-
NowTimeQual,
1580+
false,
15981581
0,
15991582
(ScanKey) NULL);
16001583
}
@@ -1610,7 +1593,7 @@ heap_restrpos(HeapScanDesc sdesc)
16101593
&sdesc->rs_mctid,
16111594
0,
16121595
&sdesc->rs_cbuf,
1613-
NowTimeQual,
1596+
false,
16141597
0,
16151598
(ScanKey) NULL);
16161599
}
@@ -1626,7 +1609,7 @@ heap_restrpos(HeapScanDesc sdesc)
16261609
&sdesc->rs_mntid,
16271610
0,
16281611
&sdesc->rs_nbuf,
1629-
NowTimeQual,
1612+
false,
16301613
0,
16311614
(ScanKey) NULL);
16321615
}

src/backend/access/index/istrat.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.12 1997/09/08 21:41:07 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.13 1997/11/20 23:20:07 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -508,7 +508,7 @@ OperatorRelationFillScanKeyEntry(Relation operatorRelation,
508508
ObjectIdEqualRegProcedure,
509509
ObjectIdGetDatum(operatorObjectId));
510510

511-
scan = heap_beginscan(operatorRelation, false, NowTimeQual,
511+
scan = heap_beginscan(operatorRelation, false, false,
512512
1, &scanKeyData);
513513

514514
tuple = heap_getnext(scan, false, (Buffer *) NULL);
@@ -564,7 +564,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
564564
ObjectIdGetDatum(indexObjectId));
565565

566566
relation = heap_openr(IndexRelationName);
567-
scan = heap_beginscan(relation, false, NowTimeQual, 1, entry);
567+
scan = heap_beginscan(relation, false, false, 1, entry);
568568
tuple = heap_getnext(scan, 0, (Buffer *) NULL);
569569
if (!HeapTupleIsValid(tuple))
570570
elog(WARN, "IndexSupportInitialize: corrupted catalogs");
@@ -628,7 +628,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
628628
entry[1].sk_argument =
629629
ObjectIdGetDatum(operatorClassObjectId[attributeNumber - 1]);
630630

631-
scan = heap_beginscan(relation, false, NowTimeQual, 2, entry);
631+
scan = heap_beginscan(relation, false, false, 2, entry);
632632

633633
while (tuple = heap_getnext(scan, 0, (Buffer *) NULL),
634634
HeapTupleIsValid(tuple))
@@ -671,7 +671,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
671671
for (strategy = 1; strategy <= maxStrategyNumber; strategy++)
672672
ScanKeyEntrySetIllegal(StrategyMapGetScanKeyEntry(map, strategy));
673673

674-
scan = heap_beginscan(relation, false, NowTimeQual, 2, entry);
674+
scan = heap_beginscan(relation, false, false, 2, entry);
675675

676676
while (tuple = heap_getnext(scan, 0, (Buffer *) NULL),
677677
HeapTupleIsValid(tuple))

src/backend/access/nbtree/nbtinsert.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.20 1997/09/08 21:41:18 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.21 1997/11/20 23:20:16 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -120,7 +120,7 @@ _bt_doinsert(Relation rel, BTItem btitem, bool index_is_unique, Relation heapRel
120120
{ /* they're equal */
121121
btitem = (BTItem) PageGetItem(page, PageGetItemId(page, offset));
122122
itup = &(btitem->bti_itup);
123-
htup = heap_fetch(heapRel, SelfTimeQual, &(itup->t_tid), NULL);
123+
htup = heap_fetch(heapRel, true, &(itup->t_tid), NULL);
124124
if (htup != (HeapTuple) NULL)
125125
{ /* it is a duplicate */
126126
elog(WARN, "Cannot insert a duplicate key into a unique index.");

src/backend/access/nbtree/nbtree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.23 1997/09/08 21:41:24 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.24 1997/11/20 23:20:21 momjian Exp $
1212
*
1313
* NOTES
1414
* This file contains only the public interface routines.
@@ -153,7 +153,7 @@ btbuild(Relation heap,
153153
#endif /* OMIT_PARTIAL_INDEX */
154154

155155
/* start a heap scan */
156-
hscan = heap_beginscan(heap, 0, NowTimeQual, 0, (ScanKey) NULL);
156+
hscan = heap_beginscan(heap, 0, false, 0, (ScanKey) NULL);
157157
htup = heap_getnext(hscan, 0, &buffer);
158158

159159
/* build the index */

src/backend/access/rtree/rtree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.18 1997/09/18 20:19:59 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.19 1997/11/20 23:20:26 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -164,7 +164,7 @@ rtbuild(Relation heap,
164164
slot = NULL;
165165
}
166166
#endif /* OMIT_PARTIAL_INDEX */
167-
scan = heap_beginscan(heap, 0, NowTimeQual, 0, (ScanKey) NULL);
167+
scan = heap_beginscan(heap, 0, false, 0, (ScanKey) NULL);
168168
htup = heap_getnext(scan, 0, &buffer);
169169

170170
/* count the tuples as we insert them */

src/backend/bootstrap/bootstrap.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.27 1997/11/17 16:58:55 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.28 1997/11/20 23:20:33 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -487,14 +487,14 @@ boot_openrel(char *relname)
487487
{
488488
StartPortalAllocMode(DefaultAllocMode, 0);
489489
rdesc = heap_openr(TypeRelationName);
490-
sdesc = heap_beginscan(rdesc, 0, NowTimeQual, 0, (ScanKey) NULL);
490+
sdesc = heap_beginscan(rdesc, 0, false, 0, (ScanKey) NULL);
491491
for (i = 0; PointerIsValid(tup = heap_getnext(sdesc, 0, (Buffer *) NULL)); ++i);
492492
heap_endscan(sdesc);
493493
app = Typ = ALLOC(struct typmap *, i + 1);
494494
while (i-- > 0)
495495
*app++ = ALLOC(struct typmap, 1);
496496
*app = (struct typmap *) NULL;
497-
sdesc = heap_beginscan(rdesc, 0, NowTimeQual, 0, (ScanKey) NULL);
497+
sdesc = heap_beginscan(rdesc, 0, false, 0, (ScanKey) NULL);
498498
app = Typ;
499499
while (PointerIsValid(tup = heap_getnext(sdesc, 0, (Buffer *) NULL)))
500500
{
@@ -852,7 +852,7 @@ gettype(char *type)
852852
if (DebugMode)
853853
printf("bootstrap.c: External Type: %s\n", type);
854854
rdesc = heap_openr(TypeRelationName);
855-
sdesc = heap_beginscan(rdesc, 0, NowTimeQual, 0, (ScanKey) NULL);
855+
sdesc = heap_beginscan(rdesc, 0, false, 0, (ScanKey) NULL);
856856
i = 0;
857857
while (PointerIsValid(tup = heap_getnext(sdesc, 0, (Buffer *) NULL)))
858858
++i;
@@ -861,7 +861,7 @@ gettype(char *type)
861861
while (i-- > 0)
862862
*app++ = ALLOC(struct typmap, 1);
863863
*app = (struct typmap *) NULL;
864-
sdesc = heap_beginscan(rdesc, 0, NowTimeQual, 0, (ScanKey) NULL);
864+
sdesc = heap_beginscan(rdesc, 0, false, 0, (ScanKey) NULL);
865865
app = Typ;
866866
while (PointerIsValid(tup = heap_getnext(sdesc, 0, (Buffer *) NULL)))
867867
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy