mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
cleanup
This commit is contained in:
@ -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,
|
|||||||
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,
|
|||||||
{
|
{
|
||||||
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,
|
|||||||
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,
|
|||||||
&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,
|
|||||||
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;
|
||||||
|
Reference in New Issue
Block a user