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{
3838List * lst ;
3939ItemPointer itemptr ;
@@ -49,7 +49,7 @@ TidListCreate(List *evalList, ExprContext *econtext, ItemPointer *tidList)
4949NULL ));
5050if (!isNull && itemptr && ItemPointerIsValid (itemptr ))
5151{
52- tidList [numTids ]= itemptr ;
52+ tidList [numTids ]= * itemptr ;
5353numTids ++ ;
5454}
5555}
@@ -80,8 +80,7 @@ TidNext(TidScan *node)
8080
8181bool bBackward ;
8282int 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{
147146bool slot_is_valid = false;
148147
149- itemptr = tidList [tidstate -> tss_TidPtr ];
150148tuple -> t_datamcxt = NULL ;
151149tuple -> 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 );
157152if (tuple -> t_data != NULL )
158153{
159154bool prev_matches = false;
@@ -187,7 +182,7 @@ TidNext(TidScan *node)
187182for (prev_tid = 0 ;prev_tid < tidstate -> tss_TidPtr ;
188183prev_tid ++ )
189184{
190- if (ItemPointerEquals (tidList [prev_tid ],& tuple -> t_self ))
185+ if (ItemPointerEquals (& tidList [prev_tid ],& tuple -> t_self ))
191186{
192187prev_matches = true;
193188break ;
@@ -254,7 +249,7 @@ ExecTidReScan(TidScan *node, ExprContext *exprCtxt, Plan *parent)
254249{
255250EState * estate ;
256251TidScanState * tidstate ;
257- ItemPointer * tidList ;
252+ ItemPointerData * tidList ;
258253
259254tidstate = node -> tidstate ;
260255estate = node -> scan .plan .state ;
@@ -381,7 +376,7 @@ ExecInitTidScan(TidScan *node, EState *estate, Plan *parent)
381376{
382377TidScanState * tidstate ;
383378CommonScanState * scanstate ;
384- ItemPointer * tidList ;
379+ ItemPointerData * tidList ;
385380int numTids ;
386381int tidPtr ;
387382List * 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 ));
440435numTids = 0 ;
441436if (!node -> needRescan )
442437numTids = TidListCreate (node -> tideval ,scanstate -> cstate .cs_ExprContext ,tidList );