summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi Inoue <inoue@tpf.co.jp>2001-10-01 09:38:14 +0000
committerHiroshi Inoue <inoue@tpf.co.jp>2001-10-01 09:38:14 +0000
commita59881aae1681fe25918327b6cb6ec80c7721029 (patch)
treed36fead7e50b2a9193e8883c8169aec8fbfdb6fd
parente419d86fe244f8b1dc495ba43ddbcf65f7114e2f (diff)
downloadpostgresql-a59881aae1681fe25918327b6cb6ec80c7721029.tar.gz
Keep the contents of TIDs not the pointers.
Tid scan has been broken for 7.1.
-rw-r--r--src/backend/executor/nodeTidscan.c27
-rw-r--r--src/include/nodes/execnodes.h4
2 files changed, 13 insertions, 18 deletions
diff --git a/src/backend/executor/nodeTidscan.c b/src/backend/executor/nodeTidscan.c
index 01a26d5930..a002e77e74 100644
--- a/src/backend/executor/nodeTidscan.c
+++ b/src/backend/executor/nodeTidscan.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeTidscan.c,v 1.16 2001/03/22 06:16:13 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeTidscan.c,v 1.16.2.1 2001/10/01 09:38:14 inoue Exp $
*
*-------------------------------------------------------------------------
*/
@@ -29,11 +29,11 @@
#include "access/heapam.h"
#include "parser/parsetree.h"
-static int TidListCreate(List *, ExprContext *, ItemPointer *);
+static int TidListCreate(List *, ExprContext *, ItemPointerData []);
static TupleTableSlot *TidNext(TidScan *node);
static int
-TidListCreate(List *evalList, ExprContext *econtext, ItemPointer *tidList)
+TidListCreate(List *evalList, ExprContext *econtext, ItemPointerData tidList[])
{
List *lst;
ItemPointer itemptr;
@@ -49,7 +49,7 @@ TidListCreate(List *evalList, ExprContext *econtext, ItemPointer *tidList)
NULL));
if (!isNull && itemptr && ItemPointerIsValid(itemptr))
{
- tidList[numTids] = itemptr;
+ tidList[numTids] = *itemptr;
numTids++;
}
}
@@ -80,8 +80,7 @@ TidNext(TidScan *node)
bool bBackward;
int tidNumber;
- ItemPointer *tidList,
- itemptr;
+ ItemPointerData* tidList;
/*
* extract necessary information from tid scan node
@@ -146,14 +145,10 @@ TidNext(TidScan *node)
{
bool slot_is_valid = false;
- itemptr = tidList[tidstate->tss_TidPtr];
tuple->t_datamcxt = NULL;
tuple->t_data = NULL;
- if (itemptr)
- {
- tuple->t_self = *(itemptr);
- heap_fetch(heapRelation, snapshot, tuple, &buffer);
- }
+ tuple->t_self = tidList[tidstate->tss_TidPtr];
+ heap_fetch(heapRelation, snapshot, tuple, &buffer);
if (tuple->t_data != NULL)
{
bool prev_matches = false;
@@ -187,7 +182,7 @@ TidNext(TidScan *node)
for (prev_tid = 0; prev_tid < tidstate->tss_TidPtr;
prev_tid++)
{
- if (ItemPointerEquals(tidList[prev_tid], &tuple->t_self))
+ if (ItemPointerEquals(&tidList[prev_tid], &tuple->t_self))
{
prev_matches = true;
break;
@@ -254,7 +249,7 @@ ExecTidReScan(TidScan *node, ExprContext *exprCtxt, Plan *parent)
{
EState *estate;
TidScanState *tidstate;
- ItemPointer *tidList;
+ ItemPointerData* tidList;
tidstate = node->tidstate;
estate = node->scan.plan.state;
@@ -381,7 +376,7 @@ ExecInitTidScan(TidScan *node, EState *estate, Plan *parent)
{
TidScanState *tidstate;
CommonScanState *scanstate;
- ItemPointer *tidList;
+ ItemPointerData* tidList;
int numTids;
int tidPtr;
List *rangeTable;
@@ -436,7 +431,7 @@ ExecInitTidScan(TidScan *node, EState *estate, Plan *parent)
/*
* get the tid node information
*/
- tidList = (ItemPointer *) palloc(length(node->tideval) * sizeof(ItemPointer));
+ tidList = (ItemPointerData *) palloc(length(node->tideval) * sizeof(ItemPointerData));
numTids = 0;
if (!node->needRescan)
numTids = TidListCreate(node->tideval, scanstate->cstate.cs_ExprContext, tidList);
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index c5a30ebe90..d81ca4ba53 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: execnodes.h,v 1.57.2.1 2001/05/15 00:34:02 tgl Exp $
+ * $Id: execnodes.h,v 1.57.2.2 2001/10/01 09:38:14 inoue Exp $
*
*-------------------------------------------------------------------------
*/
@@ -454,7 +454,7 @@ typedef struct TidScanState
int tss_NumTids;
int tss_TidPtr;
int tss_MarkTidPtr;
- ItemPointer *tss_TidList;
+ ItemPointerData* tss_TidList;
HeapTupleData tss_htup;
} TidScanState;