Commit c0dd20f9 authored by Bruce Momjian's avatar Bruce Momjian

cleanup

parent b9cbb1ed
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.28 1998/09/01 06:51:35 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.29 1998/09/01 16:21:47 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -106,9 +106,9 @@ CatalogIndexInsert(Relation *idescs, ...@@ -106,9 +106,9 @@ CatalogIndexInsert(Relation *idescs,
Relation heapRelation, Relation heapRelation,
HeapTuple heapTuple) HeapTuple heapTuple)
{ {
HeapTuple pgIndexTup; HeapTuple index_tup;
TupleDesc heapDescriptor; TupleDesc heapDescriptor;
Form_pg_index pgIndexP; Form_pg_index index_form;
Datum datum; Datum datum;
int natts; int natts;
AttrNumber *attnumP; AttrNumber *attnumP;
...@@ -123,25 +123,25 @@ CatalogIndexInsert(Relation *idescs, ...@@ -123,25 +123,25 @@ CatalogIndexInsert(Relation *idescs,
{ {
InsertIndexResult indexRes; InsertIndexResult indexRes;
pgIndexTup = SearchSysCacheTupleCopy(INDEXRELID, index_tup = SearchSysCacheTupleCopy(INDEXRELID,
ObjectIdGetDatum(idescs[i]->rd_id), ObjectIdGetDatum(idescs[i]->rd_id),
0, 0, 0); 0, 0, 0);
Assert(pgIndexTup); Assert(index_tup);
pgIndexP = (Form_pg_index) GETSTRUCT(pgIndexTup); index_form = (Form_pg_index) GETSTRUCT(index_tup);
/* /*
* Compute the number of attributes we are indexing upon. * Compute the number of attributes we are indexing upon.
*/ */
for (attnumP = pgIndexP->indkey, natts = 0; for (attnumP = index_form->indkey, natts = 0;
*attnumP != InvalidAttrNumber; *attnumP != InvalidAttrNumber;
attnumP++, natts++) attnumP++, natts++)
; ;
if (pgIndexP->indproc != InvalidOid) if (index_form->indproc != InvalidOid)
{ {
FIgetnArgs(&finfo) = natts; FIgetnArgs(&finfo) = natts;
natts = 1; natts = 1;
FIgetProcOid(&finfo) = pgIndexP->indproc; FIgetProcOid(&finfo) = index_form->indproc;
*(FIgetname(&finfo)) = '\0'; *(FIgetname(&finfo)) = '\0';
finfoP = &finfo; finfoP = &finfo;
} }
...@@ -149,7 +149,7 @@ CatalogIndexInsert(Relation *idescs, ...@@ -149,7 +149,7 @@ CatalogIndexInsert(Relation *idescs,
finfoP = (FuncIndexInfo *) NULL; finfoP = (FuncIndexInfo *) NULL;
FormIndexDatum(natts, FormIndexDatum(natts,
(AttrNumber *) pgIndexP->indkey, (AttrNumber *) index_form->indkey,
heapTuple, heapTuple,
heapDescriptor, heapDescriptor,
&datum, &datum,
...@@ -160,7 +160,7 @@ CatalogIndexInsert(Relation *idescs, ...@@ -160,7 +160,7 @@ CatalogIndexInsert(Relation *idescs,
&heapTuple->t_ctid, heapRelation); &heapTuple->t_ctid, heapRelation);
if (indexRes) if (indexRes)
pfree(indexRes); pfree(indexRes);
pfree(pgIndexTup); pfree(index_tup);
} }
} }
...@@ -230,10 +230,8 @@ CatalogIndexFetchTuple(Relation heapRelation, ...@@ -230,10 +230,8 @@ CatalogIndexFetchTuple(Relation heapRelation,
sd = index_beginscan(idesc, false, num_keys, skey); sd = index_beginscan(idesc, false, num_keys, skey);
while ((indexRes = index_getnext(sd, ForwardScanDirection))) while ((indexRes = index_getnext(sd, ForwardScanDirection)))
{ {
ItemPointer iptr; tuple = heap_fetch(heapRelation, SnapshotNow, &indexRes->heap_iptr,
&buffer);
iptr = &indexRes->heap_iptr;
tuple = heap_fetch(heapRelation, SnapshotNow, iptr, &buffer);
pfree(indexRes); pfree(indexRes);
if (HeapTupleIsValid(tuple)) if (HeapTupleIsValid(tuple))
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment