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)
618608HeapScanDesc
619609heap_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 */
10331016HeapTuple
10341017heap_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 }
0 commit comments