88 *
99 *
1010 * IDENTIFICATION
11- * $Header: /cvsroot/pgsql/src/backend/executor/nodeTidscan.c,v 1.16 2001/03/22 06:16:13 momjian Exp $
11+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeTidscan.c,v 1.16.2.1 2001/10/01 09:38:14 inoue Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
2929#include "access/heapam.h"
3030#include "parser/parsetree.h"
3131
32- static int TidListCreate (List * , ExprContext * , ItemPointer * );
32+ static int TidListCreate (List * , ExprContext * , ItemPointerData [] );
3333static TupleTableSlot * TidNext (TidScan * node );
3434
3535static int
36- TidListCreate (List * evalList , ExprContext * econtext , ItemPointer * tidList )
36+ TidListCreate (List * evalList , ExprContext * econtext , ItemPointerData tidList [] )
3737{
3838 List * lst ;
3939 ItemPointer itemptr ;
@@ -49,7 +49,7 @@ TidListCreate(List *evalList, ExprContext *econtext, ItemPointer *tidList)
4949 NULL ));
5050 if (!isNull && itemptr && ItemPointerIsValid (itemptr ))
5151 {
52- tidList [numTids ] = itemptr ;
52+ tidList [numTids ] = * itemptr ;
5353 numTids ++ ;
5454 }
5555 }
@@ -80,8 +80,7 @@ TidNext(TidScan *node)
8080
8181 bool bBackward ;
8282 int tidNumber ;
83- ItemPointer * tidList ,
84- itemptr ;
83+ ItemPointerData * tidList ;
8584
8685 /*
8786 * extract necessary information from tid scan node
@@ -146,14 +145,10 @@ TidNext(TidScan *node)
146145 {
147146 bool slot_is_valid = false;
148147
149- itemptr = tidList [tidstate -> tss_TidPtr ];
150148 tuple -> t_datamcxt = NULL ;
151149 tuple -> t_data = NULL ;
152- if (itemptr )
153- {
154- tuple -> t_self = * (itemptr );
155- heap_fetch (heapRelation , snapshot , tuple , & buffer );
156- }
150+ tuple -> t_self = tidList [tidstate -> tss_TidPtr ];
151+ heap_fetch (heapRelation , snapshot , tuple , & buffer );
157152 if (tuple -> t_data != NULL )
158153 {
159154 bool prev_matches = false;
@@ -187,7 +182,7 @@ TidNext(TidScan *node)
187182 for (prev_tid = 0 ; prev_tid < tidstate -> tss_TidPtr ;
188183 prev_tid ++ )
189184 {
190- if (ItemPointerEquals (tidList [prev_tid ], & tuple -> t_self ))
185+ if (ItemPointerEquals (& tidList [prev_tid ], & tuple -> t_self ))
191186 {
192187 prev_matches = true;
193188 break ;
@@ -254,7 +249,7 @@ ExecTidReScan(TidScan *node, ExprContext *exprCtxt, Plan *parent)
254249{
255250 EState * estate ;
256251 TidScanState * tidstate ;
257- ItemPointer * tidList ;
252+ ItemPointerData * tidList ;
258253
259254 tidstate = node -> tidstate ;
260255 estate = node -> scan .plan .state ;
@@ -381,7 +376,7 @@ ExecInitTidScan(TidScan *node, EState *estate, Plan *parent)
381376{
382377 TidScanState * tidstate ;
383378 CommonScanState * scanstate ;
384- ItemPointer * tidList ;
379+ ItemPointerData * tidList ;
385380 int numTids ;
386381 int tidPtr ;
387382 List * rangeTable ;
@@ -436,7 +431,7 @@ ExecInitTidScan(TidScan *node, EState *estate, Plan *parent)
436431 /*
437432 * get the tid node information
438433 */
439- tidList = (ItemPointer * ) palloc (length (node -> tideval ) * sizeof (ItemPointer ));
434+ tidList = (ItemPointerData * ) palloc (length (node -> tideval ) * sizeof (ItemPointerData ));
440435 numTids = 0 ;
441436 if (!node -> needRescan )
442437 numTids = TidListCreate (node -> tideval , scanstate -> cstate .cs_ExprContext , tidList );
0 commit comments