mirror of
https://github.com/postgres/postgres.git
synced 2025-08-27 07:42:10 +03:00
Renaming cleanup, no pgindent yet.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.39 1998/08/19 02:00:53 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.40 1998/09/01 03:20:41 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* The old interface functions have been converted to macros
|
||||
@@ -55,13 +55,13 @@ long heap_sysoffset[] = {
|
||||
*/
|
||||
Size
|
||||
ComputeDataSize(TupleDesc tupleDesc,
|
||||
Datum value[],
|
||||
char nulls[])
|
||||
Datum *value,
|
||||
char *nulls)
|
||||
{
|
||||
uint32 data_length;
|
||||
int i;
|
||||
int numberOfAttributes = tupleDesc->natts;
|
||||
AttributeTupleForm *att = tupleDesc->attrs;
|
||||
Form_pg_attribute *att = tupleDesc->attrs;
|
||||
|
||||
for (data_length = 0, i = 0; i < numberOfAttributes; i++)
|
||||
{
|
||||
@@ -118,8 +118,8 @@ ComputeDataSize(TupleDesc tupleDesc,
|
||||
void
|
||||
DataFill(char *data,
|
||||
TupleDesc tupleDesc,
|
||||
Datum value[],
|
||||
char nulls[],
|
||||
Datum *value,
|
||||
char *nulls,
|
||||
uint16 *infomask,
|
||||
bits8 *bit)
|
||||
{
|
||||
@@ -128,7 +128,7 @@ DataFill(char *data,
|
||||
uint32 data_length;
|
||||
int i;
|
||||
int numberOfAttributes = tupleDesc->natts;
|
||||
AttributeTupleForm *att = tupleDesc->attrs;
|
||||
Form_pg_attribute *att = tupleDesc->attrs;
|
||||
|
||||
if (bit != NULL)
|
||||
{
|
||||
@@ -227,13 +227,13 @@ int
|
||||
heap_attisnull(HeapTuple tup, int attnum)
|
||||
{
|
||||
if (attnum > (int) tup->t_natts)
|
||||
return (1);
|
||||
return 1;
|
||||
|
||||
if (HeapTupleNoNulls(tup))
|
||||
return (0);
|
||||
return 0;
|
||||
|
||||
if (attnum > 0)
|
||||
return (att_isnull(attnum - 1, tup->t_bits));
|
||||
return att_isnull(attnum - 1, tup->t_bits);
|
||||
else
|
||||
switch (attnum)
|
||||
{
|
||||
@@ -252,7 +252,7 @@ heap_attisnull(HeapTuple tup, int attnum)
|
||||
elog(ERROR, "heap_attisnull: undefined negative attnum");
|
||||
}
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
@@ -343,21 +343,21 @@ heap_getsysattr(HeapTuple tup, Buffer b, int attnum)
|
||||
switch (attnum)
|
||||
{
|
||||
case SelfItemPointerAttributeNumber:
|
||||
return ((Datum) &tup->t_ctid);
|
||||
return (Datum) &tup->t_ctid;
|
||||
case ObjectIdAttributeNumber:
|
||||
return ((Datum) (long) tup->t_oid);
|
||||
return (Datum) (long) tup->t_oid;
|
||||
case MinTransactionIdAttributeNumber:
|
||||
return ((Datum) (long) tup->t_xmin);
|
||||
return (Datum) (long) tup->t_xmin;
|
||||
case MinCommandIdAttributeNumber:
|
||||
return ((Datum) (long) tup->t_cmin);
|
||||
return (Datum) (long) tup->t_cmin;
|
||||
case MaxTransactionIdAttributeNumber:
|
||||
return ((Datum) (long) tup->t_xmax);
|
||||
return (Datum) (long) tup->t_xmax;
|
||||
case MaxCommandIdAttributeNumber:
|
||||
return ((Datum) (long) tup->t_cmax);
|
||||
return (Datum) (long) tup->t_cmax;
|
||||
default:
|
||||
elog(ERROR, "heap_getsysattr: undefined attnum %d", attnum);
|
||||
}
|
||||
return ((Datum) NULL);
|
||||
return (Datum) NULL;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@@ -388,7 +388,7 @@ nocachegetattr(HeapTuple tup,
|
||||
char *tp; /* ptr to att in tuple */
|
||||
bits8 *bp = tup->t_bits; /* ptr to att in tuple */
|
||||
int slow; /* do we have to walk nulls? */
|
||||
AttributeTupleForm *att = tupleDesc->attrs;
|
||||
Form_pg_attribute *att = tupleDesc->attrs;
|
||||
|
||||
|
||||
#if IN_MACRO
|
||||
@@ -426,7 +426,7 @@ nocachegetattr(HeapTuple tup,
|
||||
/*
|
||||
* first attribute is always at position zero
|
||||
*/
|
||||
return ((Datum) fetchatt(&(att[0]), (char *) tup + tup->t_hoff));
|
||||
return (Datum) fetchatt(&(att[0]), (char *) tup + tup->t_hoff);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -505,7 +505,7 @@ nocachegetattr(HeapTuple tup,
|
||||
tp + att[attnum]->attcacheoff);
|
||||
}
|
||||
else if (attnum == 0)
|
||||
return ((Datum) fetchatt(&(att[0]), (char *) tp));
|
||||
return (Datum) fetchatt(&(att[0]), (char *) tp);
|
||||
else if (!HeapTupleAllFixed(tup))
|
||||
{
|
||||
int j = 0;
|
||||
@@ -734,11 +734,11 @@ heap_copytuple(HeapTuple tuple)
|
||||
HeapTuple newTuple;
|
||||
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
return (NULL);
|
||||
return NULL;
|
||||
|
||||
newTuple = (HeapTuple) palloc(tuple->t_len);
|
||||
memmove((char *) newTuple, (char *) tuple, (int) tuple->t_len);
|
||||
return (newTuple);
|
||||
return newTuple;
|
||||
}
|
||||
|
||||
#ifdef NOT_USED
|
||||
@@ -751,8 +751,8 @@ heap_copytuple(HeapTuple tuple)
|
||||
void
|
||||
heap_deformtuple(HeapTuple tuple,
|
||||
TupleDesc tdesc,
|
||||
Datum values[],
|
||||
char nulls[])
|
||||
Datum *values,
|
||||
char *nulls)
|
||||
{
|
||||
int i;
|
||||
int natts;
|
||||
@@ -780,7 +780,7 @@ heap_deformtuple(HeapTuple tuple,
|
||||
/* ----------------
|
||||
* heap_formtuple
|
||||
*
|
||||
* constructs a tuple from the given value[] and null[] arrays
|
||||
* constructs a tuple from the given *value and *null arrays
|
||||
*
|
||||
* old comments
|
||||
* Handles alignment by aligning 2 byte attributes on short boundries
|
||||
@@ -789,7 +789,7 @@ heap_deformtuple(HeapTuple tuple,
|
||||
* not properly align fixed length arrays of 1 or 2 byte types (yet).
|
||||
*
|
||||
* Null attributes are indicated by a 'n' in the appropriate byte
|
||||
* of the null[]. Non-null attributes are indicated by a ' ' (space).
|
||||
* of the *null. Non-null attributes are indicated by a ' ' (space).
|
||||
*
|
||||
* Fix me. (Figure that must keep context if debug--allow give oid.)
|
||||
* Assumes in order.
|
||||
@@ -797,8 +797,8 @@ heap_deformtuple(HeapTuple tuple,
|
||||
*/
|
||||
HeapTuple
|
||||
heap_formtuple(TupleDesc tupleDescriptor,
|
||||
Datum value[],
|
||||
char nulls[])
|
||||
Datum *value,
|
||||
char *nulls)
|
||||
{
|
||||
char *tp; /* tuple pointer */
|
||||
HeapTuple tuple; /* return tuple */
|
||||
@@ -849,7 +849,7 @@ heap_formtuple(TupleDesc tupleDescriptor,
|
||||
|
||||
tuple->t_infomask |= HEAP_XMAX_INVALID;
|
||||
|
||||
return (tuple);
|
||||
return tuple;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@@ -862,9 +862,9 @@ heap_formtuple(TupleDesc tupleDescriptor,
|
||||
HeapTuple
|
||||
heap_modifytuple(HeapTuple tuple,
|
||||
Relation relation,
|
||||
Datum replValue[],
|
||||
char replNull[],
|
||||
char repl[])
|
||||
Datum *replValue,
|
||||
char *replNull,
|
||||
char *repl)
|
||||
{
|
||||
int attoff;
|
||||
int numberOfAttributes;
|
||||
@@ -884,10 +884,10 @@ heap_modifytuple(HeapTuple tuple,
|
||||
Assert(PointerIsValid(replNull));
|
||||
Assert(PointerIsValid(repl));
|
||||
|
||||
numberOfAttributes = RelationGetRelationTupleForm(relation)->relnatts;
|
||||
numberOfAttributes = RelationGetForm(relation)->relnatts;
|
||||
|
||||
/* ----------------
|
||||
* allocate and fill value[] and nulls[] arrays from either
|
||||
* allocate and fill *value and *nulls arrays from either
|
||||
* the tuple or the repl information, as appropriate.
|
||||
* ----------------
|
||||
*/
|
||||
@@ -904,7 +904,7 @@ heap_modifytuple(HeapTuple tuple,
|
||||
value[attoff] =
|
||||
heap_getattr(tuple,
|
||||
AttrOffsetGetAttrNumber(attoff),
|
||||
RelationGetTupleDescriptor(relation),
|
||||
RelationGetDescr(relation),
|
||||
&isNull);
|
||||
nulls[attoff] = (isNull) ? 'n' : ' ';
|
||||
|
||||
@@ -919,10 +919,10 @@ heap_modifytuple(HeapTuple tuple,
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
* create a new tuple from the values[] and nulls[] arrays
|
||||
* create a new tuple from the *values and *nulls arrays
|
||||
* ----------------
|
||||
*/
|
||||
newTuple = heap_formtuple(RelationGetTupleDescriptor(relation),
|
||||
newTuple = heap_formtuple(RelationGetDescr(relation),
|
||||
value,
|
||||
nulls);
|
||||
|
||||
@@ -972,5 +972,5 @@ heap_addheader(uint32 natts, /* max domain index */
|
||||
|
||||
memmove(tp, structure, structlen);
|
||||
|
||||
return (tup);
|
||||
return tup;
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.30 1998/08/27 05:06:54 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.31 1998/09/01 03:20:42 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -38,8 +38,8 @@
|
||||
*/
|
||||
IndexTuple
|
||||
index_formtuple(TupleDesc tupleDescriptor,
|
||||
Datum value[],
|
||||
char null[])
|
||||
Datum *value,
|
||||
char *null)
|
||||
{
|
||||
char *tp; /* tuple pointer */
|
||||
IndexTuple tuple; /* return tuple */
|
||||
@@ -107,7 +107,7 @@ index_formtuple(TupleDesc tupleDescriptor,
|
||||
* ----------------
|
||||
*/
|
||||
tuple->t_info = infomask;
|
||||
return (tuple);
|
||||
return tuple;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@@ -139,7 +139,7 @@ nocache_index_getattr(IndexTuple tup,
|
||||
char *bp = NULL; /* ptr to att in tuple */
|
||||
int slow; /* do we have to walk nulls? */
|
||||
int data_off; /* tuple data offset */
|
||||
AttributeTupleForm *att = tupleDesc->attrs;
|
||||
Form_pg_attribute *att = tupleDesc->attrs;
|
||||
|
||||
/* ----------------
|
||||
* sanity checks
|
||||
@@ -256,7 +256,7 @@ nocache_index_getattr(IndexTuple tup,
|
||||
tp + att[attnum]->attcacheoff);
|
||||
}
|
||||
else if (attnum == 0)
|
||||
return ((Datum) fetchatt(&(att[0]), (char *) tp));
|
||||
return (Datum) fetchatt(&(att[0]), (char *) tp);
|
||||
else if (!IndexTupleAllFixed(tup))
|
||||
{
|
||||
int j = 0;
|
||||
@@ -461,7 +461,7 @@ FormRetrieveIndexResult(ItemPointer indexItemPointer,
|
||||
result->index_iptr = *indexItemPointer;
|
||||
result->heap_iptr = *heapItemPointer;
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.19 1998/06/15 19:27:45 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.20 1998/09/01 03:20:44 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -57,11 +57,11 @@ index_keytest(IndexTuple tuple,
|
||||
if (isNull)
|
||||
{
|
||||
/* XXX eventually should check if SK_ISNULL */
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (key[0].sk_flags & SK_ISNULL)
|
||||
return (false);
|
||||
return false;
|
||||
|
||||
if (key[0].sk_flags & SK_COMMUTE)
|
||||
{
|
||||
@@ -77,11 +77,11 @@ index_keytest(IndexTuple tuple,
|
||||
}
|
||||
|
||||
if (!test == !(key[0].sk_flags & SK_NEGATE))
|
||||
return (false);
|
||||
return false;
|
||||
|
||||
scanKeySize -= 1;
|
||||
key++;
|
||||
}
|
||||
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.33 1998/08/30 19:30:38 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.34 1998/09/01 03:20:45 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -46,10 +46,10 @@ typtoout(Oid type)
|
||||
0, 0, 0);
|
||||
|
||||
if (HeapTupleIsValid(typeTuple))
|
||||
return ((Oid) ((TypeTupleForm) GETSTRUCT(typeTuple))->typoutput);
|
||||
return (Oid) ((Form_pg_type) GETSTRUCT(typeTuple))->typoutput;
|
||||
|
||||
elog(ERROR, "typtoout: Cache lookup of type %d failed", type);
|
||||
return (InvalidOid);
|
||||
return InvalidOid;
|
||||
}
|
||||
|
||||
Oid
|
||||
@@ -62,10 +62,10 @@ gettypelem(Oid type)
|
||||
0, 0, 0);
|
||||
|
||||
if (HeapTupleIsValid(typeTuple))
|
||||
return ((Oid) ((TypeTupleForm) GETSTRUCT(typeTuple))->typelem);
|
||||
return (Oid) ((Form_pg_type) GETSTRUCT(typeTuple))->typelem;
|
||||
|
||||
elog(ERROR, "typtoout: Cache lookup of type %d failed", type);
|
||||
return (InvalidOid);
|
||||
return InvalidOid;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@@ -157,7 +157,7 @@ printtup(HeapTuple tuple, TupleDesc typeinfo)
|
||||
*/
|
||||
static void
|
||||
printatt(unsigned attributeId,
|
||||
AttributeTupleForm attributeP,
|
||||
Form_pg_attribute attributeP,
|
||||
char *value)
|
||||
{
|
||||
printf("\t%2d: %s%s%s%s\t(typeid = %u, len = %d, typmod = %d, byval = %c)\n",
|
||||
@@ -181,7 +181,7 @@ showatts(char *name, TupleDesc tupleDesc)
|
||||
{
|
||||
int i;
|
||||
int natts = tupleDesc->natts;
|
||||
AttributeTupleForm *attinfo = tupleDesc->attrs;
|
||||
Form_pg_attribute *attinfo = tupleDesc->attrs;
|
||||
|
||||
puts(name);
|
||||
for (i = 0; i < natts; ++i)
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.42 1998/08/19 02:00:56 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.43 1998/09/01 03:20:46 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* some of the executor utility code such as "ExecTypeFromTL" should be
|
||||
@@ -57,25 +57,25 @@ CreateTemplateTupleDesc(int natts)
|
||||
* is filled with NULL pointers.
|
||||
* ----------------
|
||||
*/
|
||||
size = natts * sizeof(AttributeTupleForm);
|
||||
size = natts * sizeof(Form_pg_attribute);
|
||||
desc = (TupleDesc) palloc(sizeof(struct tupleDesc));
|
||||
desc->attrs = (AttributeTupleForm *) palloc(size);
|
||||
desc->attrs = (Form_pg_attribute *) palloc(size);
|
||||
desc->constr = NULL;
|
||||
MemSet(desc->attrs, 0, size);
|
||||
|
||||
desc->natts = natts;
|
||||
|
||||
return (desc);
|
||||
return desc;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* CreateTupleDesc
|
||||
*
|
||||
* This function allocates a new TupleDesc from AttributeTupleForm array
|
||||
* This function allocates a new TupleDesc from Form_pg_attribute array
|
||||
* ----------------------------------------------------------------
|
||||
*/
|
||||
TupleDesc
|
||||
CreateTupleDesc(int natts, AttributeTupleForm *attrs)
|
||||
CreateTupleDesc(int natts, Form_pg_attribute *attrs)
|
||||
{
|
||||
TupleDesc desc;
|
||||
|
||||
@@ -90,7 +90,7 @@ CreateTupleDesc(int natts, AttributeTupleForm *attrs)
|
||||
desc->natts = natts;
|
||||
desc->constr = NULL;
|
||||
|
||||
return (desc);
|
||||
return desc;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
@@ -111,12 +111,12 @@ CreateTupleDescCopy(TupleDesc tupdesc)
|
||||
|
||||
desc = (TupleDesc) palloc(sizeof(struct tupleDesc));
|
||||
desc->natts = tupdesc->natts;
|
||||
size = desc->natts * sizeof(AttributeTupleForm);
|
||||
desc->attrs = (AttributeTupleForm *) palloc(size);
|
||||
size = desc->natts * sizeof(Form_pg_attribute);
|
||||
desc->attrs = (Form_pg_attribute *) palloc(size);
|
||||
for (i = 0; i < desc->natts; i++)
|
||||
{
|
||||
desc->attrs[i] =
|
||||
(AttributeTupleForm) palloc(ATTRIBUTE_TUPLE_SIZE);
|
||||
(Form_pg_attribute) palloc(ATTRIBUTE_TUPLE_SIZE);
|
||||
memmove(desc->attrs[i],
|
||||
tupdesc->attrs[i],
|
||||
ATTRIBUTE_TUPLE_SIZE);
|
||||
@@ -146,12 +146,12 @@ CreateTupleDescCopyConstr(TupleDesc tupdesc)
|
||||
|
||||
desc = (TupleDesc) palloc(sizeof(struct tupleDesc));
|
||||
desc->natts = tupdesc->natts;
|
||||
size = desc->natts * sizeof(AttributeTupleForm);
|
||||
desc->attrs = (AttributeTupleForm *) palloc(size);
|
||||
size = desc->natts * sizeof(Form_pg_attribute);
|
||||
desc->attrs = (Form_pg_attribute *) palloc(size);
|
||||
for (i = 0; i < desc->natts; i++)
|
||||
{
|
||||
desc->attrs[i] =
|
||||
(AttributeTupleForm) palloc(ATTRIBUTE_TUPLE_SIZE);
|
||||
(Form_pg_attribute) palloc(ATTRIBUTE_TUPLE_SIZE);
|
||||
memmove(desc->attrs[i],
|
||||
tupdesc->attrs[i],
|
||||
ATTRIBUTE_TUPLE_SIZE);
|
||||
@@ -260,8 +260,8 @@ TupleDescInitEntry(TupleDesc desc,
|
||||
bool attisset)
|
||||
{
|
||||
HeapTuple tuple;
|
||||
TypeTupleForm typeForm;
|
||||
AttributeTupleForm att;
|
||||
Form_pg_type typeForm;
|
||||
Form_pg_attribute att;
|
||||
|
||||
/* ----------------
|
||||
* sanity checks
|
||||
@@ -284,7 +284,7 @@ TupleDescInitEntry(TupleDesc desc,
|
||||
* ----------------
|
||||
*/
|
||||
|
||||
att = (AttributeTupleForm) palloc(ATTRIBUTE_TUPLE_SIZE);
|
||||
att = (Form_pg_attribute) palloc(ATTRIBUTE_TUPLE_SIZE);
|
||||
desc->attrs[attributeNumber - 1] = att;
|
||||
|
||||
/* ----------------
|
||||
@@ -349,7 +349,7 @@ TupleDescInitEntry(TupleDesc desc,
|
||||
* information from the type tuple we found..
|
||||
* ----------------
|
||||
*/
|
||||
typeForm = (TypeTupleForm) GETSTRUCT(tuple);
|
||||
typeForm = (Form_pg_type) GETSTRUCT(tuple);
|
||||
|
||||
att->atttypid = tuple->t_oid;
|
||||
att->attalign = typeForm->typalign;
|
||||
@@ -412,7 +412,7 @@ TupleDescMakeSelfReference(TupleDesc desc,
|
||||
AttrNumber attnum,
|
||||
char *relname)
|
||||
{
|
||||
AttributeTupleForm att;
|
||||
Form_pg_attribute att;
|
||||
Type t = typeidType(OIDOID);
|
||||
|
||||
att = desc->attrs[attnum - 1];
|
||||
|
@@ -141,8 +141,8 @@ gistbuild(Relation heap,
|
||||
}
|
||||
|
||||
/* init the tuple descriptors and get set for a heap scan */
|
||||
hd = RelationGetTupleDescriptor(heap);
|
||||
id = RelationGetTupleDescriptor(index);
|
||||
hd = RelationGetDescr(heap);
|
||||
id = RelationGetDescr(index);
|
||||
d = (Datum *) palloc(natts * sizeof(*d));
|
||||
nulls = (bool *) palloc(natts * sizeof(*nulls));
|
||||
|
||||
@@ -350,7 +350,7 @@ gistinsert(Relation r, Datum *datum, char *nulls, ItemPointer ht_ctid, Relation
|
||||
compvec[i] = FALSE;
|
||||
datum[i] = (Datum) tmpentry.pred;
|
||||
}
|
||||
itup = index_formtuple(RelationGetTupleDescriptor(r), datum, nulls);
|
||||
itup = index_formtuple(RelationGetDescr(r), datum, nulls);
|
||||
itup->t_tid = *ht_ctid;
|
||||
|
||||
RelationSetLockForWrite(r);
|
||||
@@ -362,7 +362,7 @@ gistinsert(Relation r, Datum *datum, char *nulls, ItemPointer ht_ctid, Relation
|
||||
pfree(compvec);
|
||||
|
||||
/* XXX two-phase locking -- don't unlock the relation until EOT */
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -431,7 +431,7 @@ gistdoinsert(Relation r,
|
||||
res = gistSplit(r, buffer, stack, itup, giststate);
|
||||
gistfreestack(stack);
|
||||
WriteBuffer(buffer); /* don't forget to release buffer! */
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
if (PageIsEmpty(page))
|
||||
@@ -458,7 +458,7 @@ gistdoinsert(Relation r,
|
||||
res = (InsertIndexResult) palloc(sizeof(InsertIndexResultData));
|
||||
ItemPointerSet(&(res->pointerData), blk, l);
|
||||
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -512,7 +512,7 @@ gistChooseSubtree(Relation r, IndexTuple itup, /* itup has compressed
|
||||
*retstack = stack;
|
||||
*leafbuf = buffer;
|
||||
|
||||
return (blk);
|
||||
return blk;
|
||||
}
|
||||
|
||||
|
||||
@@ -568,7 +568,7 @@ gistAdjustKeys(Relation r,
|
||||
(*fmgr_faddr(&giststate->equalFn)) (ev0p->pred, datum, &result);
|
||||
if (!result)
|
||||
{
|
||||
TupleDesc td = RelationGetTupleDescriptor(r);
|
||||
TupleDesc td = RelationGetDescr(r);
|
||||
|
||||
/* compress datum for storage on page */
|
||||
gistcentryinit(giststate, ¢ry, datum, ev0p->rel, ev0p->page,
|
||||
@@ -869,7 +869,7 @@ gistSplit(Relation r,
|
||||
pfree(ltup);
|
||||
pfree(rtup);
|
||||
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -962,7 +962,7 @@ gistentryinsert(Relation r, GISTSTACK *stk, IndexTuple tup,
|
||||
res = gistSplit(r, b, stk->gs_parent, tup, giststate);
|
||||
WriteBuffer(b); /* don't forget to release buffer! -
|
||||
* 01/31/94 */
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -978,7 +978,7 @@ gistentryinsert(Relation r, GISTSTACK *stk, IndexTuple tup,
|
||||
pfree(tmpentry.pred);
|
||||
if (tup != newtup)
|
||||
pfree(newtup);
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1079,13 +1079,13 @@ gistchoose(Relation r, Page p, IndexTuple it, /* it has compressed entry */
|
||||
if (identry.pred != id)
|
||||
pfree(identry.pred);
|
||||
|
||||
return (which);
|
||||
return which;
|
||||
}
|
||||
|
||||
static int
|
||||
gistnospace(Page p, IndexTuple it)
|
||||
{
|
||||
return (PageGetFreeSpace(p) < IndexTupleSize(it));
|
||||
return PageGetFreeSpace(p) < IndexTupleSize(it);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1144,7 +1144,7 @@ initGISTstate(GISTSTATE *giststate, Relation index)
|
||||
picksplit_proc,
|
||||
equal_proc;
|
||||
HeapTuple htup;
|
||||
IndexTupleForm itupform;
|
||||
Form_pg_index itupform;
|
||||
|
||||
consistent_proc = index_getprocid(index, 1, GIST_CONSISTENT_PROC);
|
||||
union_proc = index_getprocid(index, 1, GIST_UNION_PROC);
|
||||
@@ -1165,7 +1165,7 @@ initGISTstate(GISTSTATE *giststate, Relation index)
|
||||
htup = SearchSysCacheTuple(INDEXRELID,
|
||||
ObjectIdGetDatum(RelationGetRelid(index)),
|
||||
0, 0, 0);
|
||||
itupform = (IndexTupleForm) GETSTRUCT(htup);
|
||||
itupform = (Form_pg_index) GETSTRUCT(htup);
|
||||
if (!HeapTupleIsValid(htup))
|
||||
elog(ERROR, "initGISTstate: index %d not found",
|
||||
RelationGetRelid(index));
|
||||
@@ -1183,7 +1183,7 @@ initGISTstate(GISTSTATE *giststate, Relation index)
|
||||
itupform->indexrelid, FirstOffsetNumber);
|
||||
return;
|
||||
}
|
||||
giststate->keytypbyval = (((AttributeTupleForm) htup)->attbyval);
|
||||
giststate->keytypbyval = (((Form_pg_attribute) htup)->attbyval);
|
||||
}
|
||||
else
|
||||
giststate->keytypbyval = FALSE;
|
||||
@@ -1210,7 +1210,7 @@ gist_tuple_replacekey(Relation r, GISTENTRY entry, IndexTuple t)
|
||||
/* or in new size */
|
||||
t->t_info |= MAXALIGN(entry.bytes + sizeof(IndexTupleData));
|
||||
|
||||
return (t);
|
||||
return t;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1228,7 +1228,7 @@ gist_tuple_replacekey(Relation r, GISTENTRY entry, IndexTuple t)
|
||||
isnull);
|
||||
newtup->t_tid = t->t_tid;
|
||||
pfree(isnull);
|
||||
return (newtup);
|
||||
return newtup;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1345,7 +1345,7 @@ text_range_out(TXTRANGE *r)
|
||||
*upper;
|
||||
|
||||
if (r == NULL)
|
||||
return (NULL);
|
||||
return NULL;
|
||||
result = (char *) palloc(NAMEDATALEN + VARSIZE(TRLOWER(r)) + VARSIZE(TRUPPER(r))
|
||||
- 2 * VARHDRSZ);
|
||||
|
||||
@@ -1359,7 +1359,7 @@ text_range_out(TXTRANGE *r)
|
||||
sprintf(result, "[%s,%s): %d", lower, upper, r->flag);
|
||||
pfree(lower);
|
||||
pfree(upper);
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1370,11 +1370,11 @@ int_range_out(INTRANGE *r)
|
||||
char *result;
|
||||
|
||||
if (r == NULL)
|
||||
return (NULL);
|
||||
return NULL;
|
||||
result = (char *) palloc(80);
|
||||
sprintf(result, "[%d,%d): %d", r->lower, r->upper, r->flag);
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif /* defined GISTDEBUG */
|
||||
|
@@ -48,14 +48,14 @@ gistgettuple(IndexScanDesc s, ScanDirection dir)
|
||||
|
||||
/* if we have it cached in the scan desc, just return the value */
|
||||
if ((res = gistscancache(s, dir)) != (RetrieveIndexResult) NULL)
|
||||
return (res);
|
||||
return res;
|
||||
|
||||
/* not cached, so we'll have to do some work */
|
||||
if (ItemPointerIsValid(&(s->currentItemData)))
|
||||
res = gistnext(s, dir);
|
||||
else
|
||||
res = gistfirst(s, dir);
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
static RetrieveIndexResult
|
||||
@@ -90,7 +90,7 @@ gistfirst(IndexScanDesc s, ScanDirection dir)
|
||||
|
||||
ReleaseBuffer(b);
|
||||
if (so->s_stack == (GISTSTACK *) NULL)
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
|
||||
stk = so->s_stack;
|
||||
b = ReadBuffer(s->relation, stk->gs_blk);
|
||||
@@ -116,7 +116,7 @@ gistfirst(IndexScanDesc s, ScanDirection dir)
|
||||
res = FormRetrieveIndexResult(&(s->currentItemData), &(it->t_tid));
|
||||
|
||||
ReleaseBuffer(b);
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -174,7 +174,7 @@ gistnext(IndexScanDesc s, ScanDirection dir)
|
||||
|
||||
ReleaseBuffer(b);
|
||||
if (so->s_stack == (GISTSTACK *) NULL)
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
|
||||
stk = so->s_stack;
|
||||
b = ReadBuffer(s->relation, stk->gs_blk);
|
||||
@@ -200,7 +200,7 @@ gistnext(IndexScanDesc s, ScanDirection dir)
|
||||
res = FormRetrieveIndexResult(&(s->currentItemData), &(it->t_tid));
|
||||
|
||||
ReleaseBuffer(b);
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -258,7 +258,7 @@ gistindex_keytest(IndexTuple tuple,
|
||||
if (isNull)
|
||||
{
|
||||
/* XXX eventually should check if SK_ISNULL */
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (key[0].sk_flags & SK_COMMUTE)
|
||||
@@ -276,13 +276,13 @@ gistindex_keytest(IndexTuple tuple,
|
||||
}
|
||||
|
||||
if (!test == !(key[0].sk_flags & SK_NEGATE))
|
||||
return (false);
|
||||
return false;
|
||||
|
||||
scanKeySize -= 1;
|
||||
key++;
|
||||
}
|
||||
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -315,7 +315,7 @@ gistfindnext(IndexScanDesc s, Page p, OffsetNumber n, ScanDirection dir)
|
||||
{
|
||||
it = (char *) PageGetItem(p, PageGetItemId(p, n));
|
||||
if (gistindex_keytest((IndexTuple) it,
|
||||
RelationGetTupleDescriptor(s->relation),
|
||||
RelationGetDescr(s->relation),
|
||||
s->numberOfKeys, s->keyData, giststate,
|
||||
s->relation, p, n))
|
||||
break;
|
||||
@@ -326,7 +326,7 @@ gistfindnext(IndexScanDesc s, Page p, OffsetNumber n, ScanDirection dir)
|
||||
n = OffsetNumberNext(n);
|
||||
}
|
||||
|
||||
return (n);
|
||||
return n;
|
||||
}
|
||||
|
||||
static RetrieveIndexResult
|
||||
@@ -339,7 +339,7 @@ gistscancache(IndexScanDesc s, ScanDirection dir)
|
||||
&& ItemPointerIsValid(&(s->currentItemData))))
|
||||
{
|
||||
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
}
|
||||
|
||||
ip = gistheapptr(s->relation, &(s->currentItemData));
|
||||
@@ -351,7 +351,7 @@ gistscancache(IndexScanDesc s, ScanDirection dir)
|
||||
|
||||
pfree(ip);
|
||||
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -381,5 +381,5 @@ gistheapptr(Relation r, ItemPointer itemp)
|
||||
else
|
||||
ItemPointerSetInvalid(ip);
|
||||
|
||||
return (ip);
|
||||
return ip;
|
||||
}
|
||||
|
@@ -72,7 +72,7 @@ gistbeginscan(Relation r,
|
||||
s = RelationGetIndexScan(r, fromEnd, nkeys, key);
|
||||
gistregscan(s);
|
||||
|
||||
return (s);
|
||||
return s;
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -99,7 +99,7 @@ RelationGetGISTStrategy(Relation r,
|
||||
AttrNumber attnum,
|
||||
RegProcedure proc)
|
||||
{
|
||||
return (RelationGetStrategy(r, attnum, &GISTEvaluationData, proc));
|
||||
return RelationGetStrategy(r, attnum, &GISTEvaluationData, proc);
|
||||
}
|
||||
|
||||
#ifdef NOT_USED
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.20 1998/08/19 02:01:00 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.21 1998/09/01 03:20:53 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* This file contains only the public interface routines.
|
||||
@@ -88,8 +88,8 @@ hashbuild(Relation heap,
|
||||
_hash_metapinit(index);
|
||||
|
||||
/* get tuple descriptors for heap and index relations */
|
||||
htupdesc = RelationGetTupleDescriptor(heap);
|
||||
itupdesc = RelationGetTupleDescriptor(index);
|
||||
htupdesc = RelationGetDescr(heap);
|
||||
itupdesc = RelationGetDescr(index);
|
||||
|
||||
/* get space for data items that'll appear in the index tuple */
|
||||
attdata = (Datum *) palloc(natts * sizeof(Datum));
|
||||
@@ -284,11 +284,11 @@ hashinsert(Relation rel, Datum *datum, char *nulls, ItemPointer ht_ctid, Relatio
|
||||
|
||||
|
||||
/* generate an index tuple */
|
||||
itup = index_formtuple(RelationGetTupleDescriptor(rel), datum, nulls);
|
||||
itup = index_formtuple(RelationGetDescr(rel), datum, nulls);
|
||||
itup->t_tid = *ht_ctid;
|
||||
|
||||
if (itup->t_info & INDEX_NULL_MASK)
|
||||
return ((InsertIndexResult) NULL);
|
||||
return (InsertIndexResult) NULL;
|
||||
|
||||
hitem = _hash_formitem(itup);
|
||||
|
||||
@@ -297,7 +297,7 @@ hashinsert(Relation rel, Datum *datum, char *nulls, ItemPointer ht_ctid, Relatio
|
||||
pfree(hitem);
|
||||
pfree(itup);
|
||||
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -320,7 +320,7 @@ hashgettuple(IndexScanDesc scan, ScanDirection dir)
|
||||
else
|
||||
res = _hash_first(scan, dir);
|
||||
|
||||
return ((char *) res);
|
||||
return (char *) res;
|
||||
}
|
||||
|
||||
|
||||
@@ -345,7 +345,7 @@ hashbeginscan(Relation rel,
|
||||
/* register scan in case we change pages it's using */
|
||||
_hash_regscan(scan);
|
||||
|
||||
return ((char *) scan);
|
||||
return (char *) scan;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.10 1998/08/19 02:01:02 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.11 1998/09/01 03:20:54 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* These functions are stored in pg_amproc. For each operator class
|
||||
@@ -23,13 +23,13 @@
|
||||
uint32
|
||||
hashint2(int16 key)
|
||||
{
|
||||
return ((uint32) ~key);
|
||||
return (uint32) ~key;
|
||||
}
|
||||
|
||||
uint32
|
||||
hashint4(uint32 key)
|
||||
{
|
||||
return (~key);
|
||||
return ~key;
|
||||
}
|
||||
|
||||
/* Hash function from Chris Torek. */
|
||||
@@ -76,7 +76,7 @@ hashfloat4(float32 keyp)
|
||||
} while (--loop);
|
||||
}
|
||||
}
|
||||
return (h);
|
||||
return h;
|
||||
}
|
||||
|
||||
|
||||
@@ -123,18 +123,18 @@ hashfloat8(float64 keyp)
|
||||
} while (--loop);
|
||||
}
|
||||
}
|
||||
return (h);
|
||||
return h;
|
||||
}
|
||||
|
||||
|
||||
uint32
|
||||
hashoid(Oid key)
|
||||
{
|
||||
return ((uint32) ~key);
|
||||
return (uint32) ~key;
|
||||
}
|
||||
|
||||
uint32
|
||||
hashoid8(Oid key[])
|
||||
hashoid8(Oid *key)
|
||||
{
|
||||
int i;
|
||||
uint32 result = 0;
|
||||
@@ -160,7 +160,7 @@ hashchar(char key)
|
||||
h = h * PRIME1 ^ (key - ' ');
|
||||
h %= PRIME2;
|
||||
|
||||
return (h);
|
||||
return h;
|
||||
}
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ hashname(NameData *n)
|
||||
h = h * PRIME1 ^ (*key++ - ' ');
|
||||
h %= PRIME2;
|
||||
|
||||
return (h);
|
||||
return h;
|
||||
}
|
||||
|
||||
|
||||
@@ -240,5 +240,5 @@ hashtext(struct varlena * key)
|
||||
} while (--loop);
|
||||
}
|
||||
}
|
||||
return (n);
|
||||
return n;
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.13 1998/06/15 19:27:48 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.14 1998/09/01 03:20:56 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -85,7 +85,7 @@ _hash_doinsert(Relation rel, HashItem hitem)
|
||||
/* be tidy */
|
||||
_hash_freeskey(itup_scankey);
|
||||
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -206,7 +206,7 @@ _hash_insertonpg(Relation rel,
|
||||
> metap->hashm_ffactor)
|
||||
_hash_expandtable(rel, metabuf);
|
||||
_hash_relbuf(rel, metabuf, HASH_READ);
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -236,5 +236,5 @@ _hash_pgaddtup(Relation rel,
|
||||
/* write the buffer, but hold our lock */
|
||||
_hash_wrtnorelbuf(rel, buf);
|
||||
|
||||
return (itup_off);
|
||||
return itup_off;
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.16 1998/06/15 19:27:49 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.17 1998/09/01 03:20:57 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Overflow pages look like ordinary relation pages.
|
||||
@@ -84,7 +84,7 @@ _hash_addovflpage(Relation rel, Buffer *metabufp, Buffer buf)
|
||||
/* logically chain overflow page to previous page */
|
||||
pageopaque->hasho_nextblkno = ovflblkno;
|
||||
_hash_wrtnorelbuf(rel, buf);
|
||||
return (ovflbuf);
|
||||
return ovflbuf;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -227,7 +227,7 @@ _hash_getovfladdr(Relation rel, Buffer *metabufp)
|
||||
/* Calculate address of the new overflow page */
|
||||
oaddr = OADDR_OF(splitnum, offset);
|
||||
_hash_chgbufaccess(rel, metabufp, HASH_WRITE, HASH_READ);
|
||||
return (oaddr);
|
||||
return oaddr;
|
||||
|
||||
found:
|
||||
bit = bit + _hash_firstfreebit(freep[j]);
|
||||
@@ -254,7 +254,7 @@ found:
|
||||
/* initialize this page */
|
||||
oaddr = OADDR_OF(i, offset);
|
||||
_hash_chgbufaccess(rel, metabufp, HASH_WRITE, HASH_READ);
|
||||
return (oaddr);
|
||||
return oaddr;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -275,10 +275,10 @@ _hash_firstfreebit(uint32 map)
|
||||
for (i = 0; i < BITS_PER_MAP; i++)
|
||||
{
|
||||
if (!(mask & map))
|
||||
return (i);
|
||||
return i;
|
||||
mask = mask << 1;
|
||||
}
|
||||
return (i);
|
||||
return i;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -387,9 +387,9 @@ _hash_freeovflpage(Relation rel, Buffer ovflbuf)
|
||||
* return that buffer with a write lock.
|
||||
*/
|
||||
if (BlockNumberIsValid(nextblkno))
|
||||
return (_hash_getbuf(rel, nextblkno, HASH_WRITE));
|
||||
return _hash_getbuf(rel, nextblkno, HASH_WRITE);
|
||||
else
|
||||
return (InvalidBuffer);
|
||||
return InvalidBuffer;
|
||||
}
|
||||
|
||||
|
||||
@@ -455,7 +455,7 @@ _hash_initbitmap(Relation rel,
|
||||
/* write out the new bitmap page (releasing its locks) */
|
||||
_hash_wrtbuf(rel, buf);
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.16 1998/06/15 19:27:49 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.17 1998/09/01 03:20:58 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Postgres hash pages look like ordinary relation pages. The opaque
|
||||
@@ -204,7 +204,7 @@ _hash_getbuf(Relation rel, BlockNumber blkno, int access)
|
||||
buf = ReadBuffer(rel, blkno);
|
||||
|
||||
/* ref count and lock type are correct */
|
||||
return (buf);
|
||||
return buf;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -288,7 +288,7 @@ _hash_chgbufaccess(Relation rel,
|
||||
break;
|
||||
}
|
||||
*bufp = _hash_getbuf(rel, blkno, to_access);
|
||||
return (BufferGetPage(*bufp));
|
||||
return BufferGetPage(*bufp);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -604,7 +604,7 @@ _hash_splitpage(Relation rel,
|
||||
/* hash on the tuple */
|
||||
hitem = (HashItem) PageGetItem(opage, PageGetItemId(opage, ooffnum));
|
||||
itup = &(hitem->hash_itup);
|
||||
itupdesc = RelationGetTupleDescriptor(rel);
|
||||
itupdesc = RelationGetDescr(rel);
|
||||
datum = index_getattr(itup, 1, itupdesc, &null);
|
||||
bucket = _hash_call(rel, metap, datum);
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.15 1998/08/19 02:01:04 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.16 1998/09/01 03:20:59 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Because we can be doing an index scan on a relation while we
|
||||
@@ -153,13 +153,13 @@ _hash_scantouched(IndexScanDesc scan,
|
||||
if (ItemPointerIsValid(current)
|
||||
&& ItemPointerGetBlockNumber(current) == blkno
|
||||
&& ItemPointerGetOffsetNumber(current) >= offno)
|
||||
return (true);
|
||||
return true;
|
||||
|
||||
current = &(scan->currentMarkData);
|
||||
if (ItemPointerIsValid(current)
|
||||
&& ItemPointerGetBlockNumber(current) == blkno
|
||||
&& ItemPointerGetOffsetNumber(current) >= offno)
|
||||
return (true);
|
||||
return true;
|
||||
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashsearch.c,v 1.15 1998/06/15 19:27:50 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashsearch.c,v 1.16 1998/09/01 03:21:01 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -107,7 +107,7 @@ _hash_next(IndexScanDesc scan, ScanDirection dir)
|
||||
* next tuple, we come back with a lock on that buffer.
|
||||
*/
|
||||
if (!_hash_step(scan, &buf, dir, metabuf))
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
|
||||
/* if we're here, _hash_step found a valid tuple */
|
||||
current = &(scan->currentItemData);
|
||||
@@ -118,7 +118,7 @@ _hash_next(IndexScanDesc scan, ScanDirection dir)
|
||||
itup = &hitem->hash_itup;
|
||||
res = FormRetrieveIndexResult(current, &(itup->t_tid));
|
||||
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -236,7 +236,7 @@ _hash_first(IndexScanDesc scan, ScanDirection dir)
|
||||
{
|
||||
_hash_relbuf(rel, buf, HASH_READ);
|
||||
_hash_relbuf(rel, metabuf, HASH_READ);
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -247,7 +247,7 @@ _hash_first(IndexScanDesc scan, ScanDirection dir)
|
||||
}
|
||||
|
||||
if (!_hash_step(scan, &buf, dir, metabuf))
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
|
||||
/* if we're here, _hash_step found a valid tuple */
|
||||
current = &(scan->currentItemData);
|
||||
@@ -258,7 +258,7 @@ _hash_first(IndexScanDesc scan, ScanDirection dir)
|
||||
itup = &hitem->hash_itup;
|
||||
res = FormRetrieveIndexResult(current, &(itup->t_tid));
|
||||
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -432,7 +432,7 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir, Buffer metabuf)
|
||||
_hash_relbuf(rel, metabuf, HASH_READ);
|
||||
*bufP = so->hashso_curbuf = InvalidBuffer;
|
||||
ItemPointerSetInvalid(current);
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* get ready to check this tuple */
|
||||
@@ -445,5 +445,5 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir, Buffer metabuf)
|
||||
blkno = BufferGetBlockNumber(buf);
|
||||
*bufP = so->hashso_curbuf = buf;
|
||||
ItemPointerSet(current, blkno, offnum);
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/Attic/hashstrat.c,v 1.11 1997/09/08 02:20:21 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/Attic/hashstrat.c,v 1.12 1998/09/01 03:21:02 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -63,7 +63,7 @@ _hash_getstrat(Relation rel,
|
||||
|
||||
Assert(StrategyNumberIsValid(strat));
|
||||
|
||||
return (strat);
|
||||
return strat;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashutil.c,v 1.13 1998/01/07 21:01:16 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashutil.c,v 1.14 1998/09/01 03:21:03 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -37,7 +37,7 @@ _hash_mkscankey(Relation rel, IndexTuple itup, HashMetaPage metap)
|
||||
bool null;
|
||||
|
||||
natts = rel->rd_rel->relnatts;
|
||||
itupdesc = RelationGetTupleDescriptor(rel);
|
||||
itupdesc = RelationGetDescr(rel);
|
||||
|
||||
skey = (ScanKey) palloc(natts * sizeof(ScanKeyData));
|
||||
|
||||
@@ -49,7 +49,7 @@ _hash_mkscankey(Relation rel, IndexTuple itup, HashMetaPage metap)
|
||||
0x0, (AttrNumber) (i + 1), proc, arg);
|
||||
}
|
||||
|
||||
return (skey);
|
||||
return skey;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -64,10 +64,10 @@ _hash_checkqual(IndexScanDesc scan, IndexTuple itup)
|
||||
{
|
||||
if (scan->numberOfKeys > 0)
|
||||
return (index_keytest(itup,
|
||||
RelationGetTupleDescriptor(scan->relation),
|
||||
RelationGetDescr(scan->relation),
|
||||
scan->numberOfKeys, scan->keyData));
|
||||
else
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
HashItem
|
||||
@@ -89,7 +89,7 @@ _hash_formitem(IndexTuple itup)
|
||||
hitem = (HashItem) palloc(nbytes_hitem);
|
||||
memmove((char *) &(hitem->hash_itup), (char *) itup, tuplen);
|
||||
|
||||
return (hitem);
|
||||
return hitem;
|
||||
}
|
||||
|
||||
Bucket
|
||||
@@ -104,7 +104,7 @@ _hash_call(Relation rel, HashMetaPage metap, Datum key)
|
||||
bucket = n & metap->hashm_highmask;
|
||||
if (bucket > metap->hashm_maxbucket)
|
||||
bucket = bucket & metap->hashm_lowmask;
|
||||
return (bucket);
|
||||
return bucket;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -119,7 +119,7 @@ _hash_log2(uint32 num)
|
||||
limit = 1;
|
||||
for (i = 0; limit < num; limit = limit << 1, i++)
|
||||
;
|
||||
return (i);
|
||||
return i;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.33 1998/08/20 22:07:30 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.34 1998/09/01 03:21:05 momjian Exp $
|
||||
*
|
||||
*
|
||||
* INTERFACE ROUTINES
|
||||
@@ -194,7 +194,7 @@ unpinscan(HeapScanDesc scan)
|
||||
static int
|
||||
nextpage(int page, int dir)
|
||||
{
|
||||
return ((dir < 0) ? page - 1 : page + 1);
|
||||
return (dir < 0) ? page - 1 : page + 1;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@@ -268,7 +268,7 @@ heapgettup(Relation relation,
|
||||
* ----------------
|
||||
*/
|
||||
if (!(pages = relation->rd_nblocks))
|
||||
return (NULL);
|
||||
return NULL;
|
||||
|
||||
/* ----------------
|
||||
* calculate next starting lineoff, given scan direction
|
||||
@@ -284,7 +284,7 @@ heapgettup(Relation relation,
|
||||
if (ItemPointerIsValid(tid) == false)
|
||||
{
|
||||
*buf= InvalidBuffer;
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
*buf = RelationGetBufferWithBuffer(relation,
|
||||
ItemPointerGetBlockNumber(tid),
|
||||
@@ -300,7 +300,7 @@ heapgettup(Relation relation,
|
||||
lpp = PageGetItemId(dp, lineoff);
|
||||
|
||||
rtup = (HeapTuple) PageGetItem((Page) dp, lpp);
|
||||
return (rtup);
|
||||
return rtup;
|
||||
|
||||
}
|
||||
else if (dir < 0)
|
||||
@@ -322,7 +322,7 @@ heapgettup(Relation relation,
|
||||
if (page < 0)
|
||||
{
|
||||
*buf = InvalidBuffer;
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*buf = RelationGetBufferWithBuffer(relation, page, *buf);
|
||||
@@ -366,7 +366,7 @@ heapgettup(Relation relation,
|
||||
if (page >= pages)
|
||||
{
|
||||
*buf = InvalidBuffer;
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
/* page and lineoff now reference the physically next tid */
|
||||
|
||||
@@ -420,7 +420,7 @@ heapgettup(Relation relation,
|
||||
*/
|
||||
ItemPointerSetBlockNumber(iptr, page);
|
||||
}
|
||||
return (rtup);
|
||||
return rtup;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@@ -455,7 +455,7 @@ heapgettup(Relation relation,
|
||||
if (BufferIsValid(*buf))
|
||||
ReleaseBuffer(*buf);
|
||||
*buf = InvalidBuffer;
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*buf = ReleaseAndReadBuffer(*buf, relation, page);
|
||||
@@ -526,7 +526,7 @@ heap_open(Oid relationId)
|
||||
if (RelationIsValid(r) && r->rd_rel->relkind == RELKIND_INDEX)
|
||||
elog(ERROR, "%s is an index relation", r->rd_rel->relname.data);
|
||||
|
||||
return (r);
|
||||
return r;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@@ -553,7 +553,7 @@ heap_openr(char *relationName)
|
||||
if (RelationIsValid(r) && r->rd_rel->relkind == RELKIND_INDEX)
|
||||
elog(ERROR, "%s is an index relation", r->rd_rel->relname.data);
|
||||
|
||||
return (r);
|
||||
return r;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@@ -646,7 +646,7 @@ heap_beginscan(Relation relation,
|
||||
scan->rs_snapshot = snapshot;
|
||||
scan->rs_nkeys = (short) nkeys;
|
||||
|
||||
return (scan);
|
||||
return scan;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@@ -806,7 +806,7 @@ heap_getnext(HeapScanDesc scandesc, int backw)
|
||||
{
|
||||
if (BufferIsValid(scan->rs_nbuf))
|
||||
ReleaseBuffer(scan->rs_nbuf);
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -871,7 +871,7 @@ heap_getnext(HeapScanDesc scandesc, int backw)
|
||||
ReleaseBuffer(scan->rs_nbuf);
|
||||
scan->rs_ntup = NULL;
|
||||
scan->rs_nbuf = InvalidBuffer;
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (BufferIsValid(scan->rs_pbuf))
|
||||
@@ -892,7 +892,7 @@ heap_getnext(HeapScanDesc scandesc, int backw)
|
||||
if (BufferIsValid(scan->rs_pbuf))
|
||||
ReleaseBuffer(scan->rs_pbuf);
|
||||
HEAPDEBUG_3; /* heap_getnext returns NULL at end */
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -959,7 +959,7 @@ heap_getnext(HeapScanDesc scandesc, int backw)
|
||||
scan->rs_ptup = NULL;
|
||||
scan->rs_pbuf = InvalidBuffer;
|
||||
HEAPDEBUG_6; /* heap_getnext returning EOS */
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (BufferIsValid(scan->rs_nbuf))
|
||||
@@ -1064,7 +1064,7 @@ heap_fetch(Relation relation,
|
||||
if (tuple == NULL)
|
||||
{
|
||||
ReleaseBuffer(buffer);
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@@ -1076,7 +1076,7 @@ heap_fetch(Relation relation,
|
||||
|
||||
*userbuf = buffer; /* user is required to ReleaseBuffer() this */
|
||||
|
||||
return (tuple);
|
||||
return tuple;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@@ -1150,7 +1150,7 @@ heap_insert(Relation relation, HeapTuple tup)
|
||||
SetRefreshWhenInvalidate((bool) !ImmediateInvalidation);
|
||||
}
|
||||
|
||||
return (tup->t_oid);
|
||||
return tup->t_oid;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@@ -1213,7 +1213,7 @@ heap_delete(Relation relation, ItemPointer tid)
|
||||
if (IsSystemRelationName(RelationGetRelationName(relation)->data))
|
||||
RelationUnsetLockForWrite(relation);
|
||||
ReleaseBuffer(buf);
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
/* ----------------
|
||||
* check that we're deleteing a valid item
|
||||
@@ -1256,7 +1256,7 @@ heap_delete(Relation relation, ItemPointer tid)
|
||||
if (IsSystemRelationName(RelationGetRelationName(relation)->data))
|
||||
RelationUnsetLockForWrite(relation);
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@@ -1339,7 +1339,7 @@ heap_replace(Relation relation, ItemPointer otid, HeapTuple replace_tuple)
|
||||
if (IsSystemRelationName(RelationGetRelationName(relation)->data))
|
||||
RelationUnsetLockForWrite(relation);
|
||||
ReleaseBuffer(buffer);
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@@ -1411,7 +1411,7 @@ heap_replace(Relation relation, ItemPointer otid, HeapTuple replace_tuple)
|
||||
if (IsSystemRelationName(RelationGetRelationName(relation)->data))
|
||||
RelationUnsetLockForWrite(relation);
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/index/genam.c,v 1.13 1998/08/19 02:01:09 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/index/genam.c,v 1.14 1998/09/01 03:21:07 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* many of the old access method routines have been turned into
|
||||
@@ -123,7 +123,7 @@ RelationGetIndexScan(Relation relation,
|
||||
|
||||
index_rescan(scan, scanFromEnd, key);
|
||||
|
||||
return (scan);
|
||||
return scan;
|
||||
}
|
||||
|
||||
#ifdef NOT_USED
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.23 1998/08/19 02:01:10 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.24 1998/09/01 03:21:09 momjian Exp $
|
||||
*
|
||||
* INTERFACE ROUTINES
|
||||
* index_open - open an index relation by relationId
|
||||
@@ -207,7 +207,7 @@ index_insert(Relation relation,
|
||||
* ----------------
|
||||
*/
|
||||
|
||||
return (specificResult);
|
||||
return specificResult;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@@ -366,14 +366,14 @@ index_getprocid(Relation irel,
|
||||
|
||||
Assert(loc != NULL);
|
||||
|
||||
return (loc[(natts * (procnum - 1)) + (attnum - 1)]);
|
||||
return loc[(natts * (procnum - 1)) + (attnum - 1)];
|
||||
}
|
||||
|
||||
Datum
|
||||
GetIndexValue(HeapTuple tuple,
|
||||
TupleDesc hTupDesc,
|
||||
int attOff,
|
||||
AttrNumber attrNums[],
|
||||
AttrNumber *attrNums,
|
||||
FuncIndexInfo *fInfo,
|
||||
bool *attNull)
|
||||
{
|
||||
|
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.26 1998/08/19 02:01:11 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.27 1998/09/01 03:21:10 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -74,7 +74,7 @@ StrategyMapGetScanKeyEntry(StrategyMap map,
|
||||
{
|
||||
Assert(StrategyMapIsValid(map));
|
||||
Assert(StrategyNumberIsValid(strategyNumber));
|
||||
return (&map->entry[strategyNumber - 1]);
|
||||
return &map->entry[strategyNumber - 1];
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -515,7 +515,7 @@ OperatorRelationFillScanKeyEntry(Relation operatorRelation,
|
||||
}
|
||||
|
||||
entry->sk_flags = 0;
|
||||
entry->sk_procedure = ((OperatorTupleForm) GETSTRUCT(tuple))->oprcode;
|
||||
entry->sk_procedure = ((Form_pg_operator) GETSTRUCT(tuple))->oprcode;
|
||||
fmgr_info(entry->sk_procedure, &entry->sk_func);
|
||||
entry->sk_nargs = entry->sk_func.fn_nargs;
|
||||
|
||||
@@ -578,13 +578,13 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
|
||||
|
||||
/*
|
||||
* XXX note that the following assumes the INDEX tuple is well formed
|
||||
* and that the key[] and class[] are 0 terminated.
|
||||
* and that the *key and *class are 0 terminated.
|
||||
*/
|
||||
for (attributeIndex = 0; attributeIndex < maxAttributeNumber; attributeIndex++)
|
||||
{
|
||||
IndexTupleForm iform;
|
||||
Form_pg_index iform;
|
||||
|
||||
iform = (IndexTupleForm) GETSTRUCT(tuple);
|
||||
iform = (Form_pg_index) GETSTRUCT(tuple);
|
||||
|
||||
if (!OidIsValid(iform->indkey[attributeIndex]))
|
||||
{
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.17 1998/08/19 02:01:13 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.18 1998/09/01 03:21:12 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* These functions are stored in pg_amproc. For each operator class
|
||||
@@ -85,7 +85,7 @@ btoidcmp(Oid a, Oid b)
|
||||
}
|
||||
|
||||
int32
|
||||
btoid8cmp(Oid a[], Oid b[])
|
||||
btoid8cmp(Oid *a, Oid *b)
|
||||
{
|
||||
int i;
|
||||
for (i=0; i < 8; i++)
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.28 1998/08/19 02:01:15 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.29 1998/09/01 03:21:13 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -104,7 +104,7 @@ _bt_doinsert(Relation rel, BTItem btitem, bool index_is_unique, Relation heapRel
|
||||
Buffer nbuf;
|
||||
BlockNumber blkno;
|
||||
|
||||
itupdesc = RelationGetTupleDescriptor(rel);
|
||||
itupdesc = RelationGetDescr(rel);
|
||||
nbuf = InvalidBuffer;
|
||||
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
|
||||
|
||||
@@ -182,7 +182,7 @@ _bt_doinsert(Relation rel, BTItem btitem, bool index_is_unique, Relation heapRel
|
||||
_bt_freestack(stack);
|
||||
_bt_freeskey(itup_scankey);
|
||||
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -301,7 +301,7 @@ _bt_insertonpg(Relation rel,
|
||||
keysz, scankey, stack->bts_btitem,
|
||||
NULL);
|
||||
ItemPointerSet(&(res->pointerData), itup_blkno, itup_off);
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -780,7 +780,7 @@ _bt_insertonpg(Relation rel,
|
||||
res = (InsertIndexResult) palloc(sizeof(InsertIndexResultData));
|
||||
ItemPointerSet(&(res->pointerData), itup_blkno, itup_off);
|
||||
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -961,7 +961,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright)
|
||||
}
|
||||
|
||||
/* split's done */
|
||||
return (rbuf);
|
||||
return rbuf;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1045,7 +1045,7 @@ _bt_findsplitloc(Relation rel,
|
||||
if (saferight == maxoff && (maxoff - start) > 1)
|
||||
saferight = start + (maxoff - start) / 2;
|
||||
|
||||
return (saferight);
|
||||
return saferight;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1193,7 +1193,7 @@ _bt_pgaddtup(Relation rel,
|
||||
/* write the buffer, but hold our lock */
|
||||
_bt_wrtnorelbuf(rel, buf);
|
||||
|
||||
return (itup_off);
|
||||
return itup_off;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1227,7 +1227,7 @@ _bt_goesonpg(Relation rel,
|
||||
/* no right neighbor? */
|
||||
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
|
||||
if (P_RIGHTMOST(opaque))
|
||||
return (true);
|
||||
return true;
|
||||
|
||||
/*
|
||||
* this is a non-rightmost page, so it must have a high key item.
|
||||
@@ -1237,7 +1237,7 @@ _bt_goesonpg(Relation rel,
|
||||
*/
|
||||
hikey = PageGetItemId(page, P_HIKEY);
|
||||
if (_bt_skeycmp(rel, keysz, scankey, page, hikey, BTLessStrategyNumber))
|
||||
return (true);
|
||||
return true;
|
||||
|
||||
/*
|
||||
* If the scan key is > the high key, then it for sure doesn't belong
|
||||
@@ -1245,7 +1245,7 @@ _bt_goesonpg(Relation rel,
|
||||
*/
|
||||
|
||||
if (_bt_skeycmp(rel, keysz, scankey, page, hikey, BTGreaterStrategyNumber))
|
||||
return (false);
|
||||
return false;
|
||||
|
||||
/*
|
||||
* If we have no adjacency information, and the item is equal to the
|
||||
@@ -1258,14 +1258,14 @@ _bt_goesonpg(Relation rel,
|
||||
if (afteritem == (BTItem) NULL)
|
||||
{
|
||||
if (opaque->btpo_flags & BTP_LEAF)
|
||||
return (false);
|
||||
return false;
|
||||
if (opaque->btpo_flags & BTP_CHAIN)
|
||||
return (true);
|
||||
return true;
|
||||
if (_bt_skeycmp(rel, keysz, scankey, page,
|
||||
PageGetItemId(page, P_FIRSTKEY),
|
||||
BTEqualStrategyNumber))
|
||||
return (true);
|
||||
return (false);
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* damn, have to work for it. i hate that. */
|
||||
@@ -1293,7 +1293,7 @@ _bt_goesonpg(Relation rel,
|
||||
}
|
||||
}
|
||||
|
||||
return (found);
|
||||
return found;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1330,7 +1330,7 @@ _bt_itemcmp(Relation rel,
|
||||
strat = BTGreaterStrategyNumber;
|
||||
}
|
||||
|
||||
tupDes = RelationGetTupleDescriptor(rel);
|
||||
tupDes = RelationGetDescr(rel);
|
||||
indexTuple1 = &(item1->bti_itup);
|
||||
indexTuple2 = &(item2->bti_itup);
|
||||
|
||||
@@ -1357,13 +1357,13 @@ _bt_itemcmp(Relation rel,
|
||||
if (compare) /* true for one of ">, <, =" */
|
||||
{
|
||||
if (strat != BTEqualStrategyNumber)
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
/* false for one of ">, <, =" */
|
||||
{
|
||||
if (strat == BTEqualStrategyNumber)
|
||||
return (false);
|
||||
return false;
|
||||
|
||||
/*
|
||||
* if original strat was "<=, >=" OR "<, >" but some
|
||||
@@ -1379,10 +1379,10 @@ _bt_itemcmp(Relation rel,
|
||||
if (compare) /* item1' and item2' attributes are equal */
|
||||
continue; /* - try to compare next attributes */
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1475,15 +1475,15 @@ _bt_isequal(TupleDesc itupdesc, Page page, OffsetNumber offnum,
|
||||
|
||||
/* NULLs are not equal */
|
||||
if (entry->sk_flags & SK_ISNULL || null)
|
||||
return (false);
|
||||
return false;
|
||||
|
||||
result = (long) FMGR_PTR2(&entry->sk_func, entry->sk_argument, datum);
|
||||
if (result != 0)
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* by here, the keys are equal */
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef NOT_USED
|
||||
@@ -1621,7 +1621,7 @@ _bt_shift(Relation rel, Buffer buf, BTStack stack, int keysz,
|
||||
|
||||
ItemPointerSet(&(res->pointerData), nbknum, P_HIKEY);
|
||||
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.15 1998/01/07 21:01:53 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.16 1998/09/01 03:21:14 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Postgres btree pages look like ordinary relation pages. The opaque
|
||||
@@ -274,7 +274,7 @@ _bt_getroot(Relation rel, int access)
|
||||
*/
|
||||
|
||||
_bt_relbuf(rel, metabuf, BT_WRITE);
|
||||
return (_bt_getroot(rel, access));
|
||||
return _bt_getroot(rel, access);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -298,7 +298,7 @@ _bt_getroot(Relation rel, int access)
|
||||
|
||||
/* it happened, try again */
|
||||
_bt_relbuf(rel, rootbuf, access);
|
||||
return (_bt_getroot(rel, access));
|
||||
return _bt_getroot(rel, access);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -307,7 +307,7 @@ _bt_getroot(Relation rel, int access)
|
||||
* Return the root block.
|
||||
*/
|
||||
|
||||
return (rootbuf);
|
||||
return rootbuf;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -350,7 +350,7 @@ _bt_getbuf(Relation rel, BlockNumber blkno, int access)
|
||||
}
|
||||
|
||||
/* ref count and lock type are correct */
|
||||
return (buf);
|
||||
return buf;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -505,7 +505,7 @@ _bt_getstackbuf(Relation rel, BTStack stack, int access)
|
||||
item_save = (BTItem) palloc(item_nbytes);
|
||||
memmove((char *) item_save, (char *) item, item_nbytes);
|
||||
stack->bts_btitem = item_save;
|
||||
return (buf);
|
||||
return buf;
|
||||
}
|
||||
|
||||
/* if the item has just moved right on this page, we're done */
|
||||
@@ -525,7 +525,7 @@ _bt_getstackbuf(Relation rel, BTStack stack, int access)
|
||||
item_save = (BTItem) palloc(item_nbytes);
|
||||
memmove((char *) item_save, (char *) item, item_nbytes);
|
||||
stack->bts_btitem = item_save;
|
||||
return (buf);
|
||||
return buf;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -562,7 +562,7 @@ _bt_getstackbuf(Relation rel, BTStack stack, int access)
|
||||
item_save = (BTItem) palloc(item_nbytes);
|
||||
memmove((char *) item_save, (char *) item, item_nbytes);
|
||||
stack->bts_btitem = item_save;
|
||||
return (buf);
|
||||
return buf;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.30 1998/08/25 21:33:56 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.31 1998/09/01 03:21:16 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* This file contains only the public interface routines.
|
||||
@@ -119,8 +119,8 @@ btbuild(Relation heap,
|
||||
_bt_metapinit(index);
|
||||
|
||||
/* get tuple descriptors for heap and index relations */
|
||||
htupdesc = RelationGetTupleDescriptor(heap);
|
||||
itupdesc = RelationGetTupleDescriptor(index);
|
||||
htupdesc = RelationGetDescr(heap);
|
||||
itupdesc = RelationGetDescr(index);
|
||||
|
||||
/* get space for data items that'll appear in the index tuple */
|
||||
attdata = (Datum *) palloc(natts * sizeof(Datum));
|
||||
@@ -355,13 +355,14 @@ btinsert(Relation rel, Datum *datum, char *nulls, ItemPointer ht_ctid, Relation
|
||||
InsertIndexResult res;
|
||||
|
||||
/* generate an index tuple */
|
||||
itup = index_formtuple(RelationGetTupleDescriptor(rel), datum, nulls);
|
||||
itup = index_formtuple(RelationGetDescr(rel), datum, nulls);
|
||||
itup->t_tid = *ht_ctid;
|
||||
|
||||
/*
|
||||
* See comments in btbuild.
|
||||
*
|
||||
* if (itup->t_info & INDEX_NULL_MASK) return ((InsertIndexResult) NULL);
|
||||
* if (itup->t_info & INDEX_NULL_MASK)
|
||||
return (InsertIndexResult) NULL;
|
||||
*/
|
||||
|
||||
btitem = _bt_formitem(itup);
|
||||
@@ -377,7 +378,7 @@ btinsert(Relation rel, Datum *datum, char *nulls, ItemPointer ht_ctid, Relation
|
||||
_bt_adjscans(rel, &(res->pointerData), BT_INSERT);
|
||||
#endif
|
||||
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -417,7 +418,7 @@ btgettuple(IndexScanDesc scan, ScanDirection dir)
|
||||
if (res)
|
||||
((BTScanOpaque)scan->opaque)->curHeapIptr = res->heap_iptr;
|
||||
|
||||
return ((char *) res);
|
||||
return (char *) res;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -434,7 +435,7 @@ btbeginscan(Relation rel, bool fromEnd, uint16 keysz, ScanKey scankey)
|
||||
/* register scan in case we change pages it's using */
|
||||
_bt_regscan(scan);
|
||||
|
||||
return ((char *) scan);
|
||||
return (char *) scan;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.16 1998/08/19 02:01:17 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.17 1998/09/01 03:21:17 momjian Exp $
|
||||
*
|
||||
*
|
||||
* NOTES
|
||||
@@ -231,13 +231,13 @@ _bt_scantouched(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno)
|
||||
if (ItemPointerIsValid(current)
|
||||
&& ItemPointerGetBlockNumber(current) == blkno
|
||||
&& ItemPointerGetOffsetNumber(current) >= offno)
|
||||
return (true);
|
||||
return true;
|
||||
|
||||
current = &(scan->currentMarkData);
|
||||
if (ItemPointerIsValid(current)
|
||||
&& ItemPointerGetBlockNumber(current) == blkno
|
||||
&& ItemPointerGetOffsetNumber(current) >= offno)
|
||||
return (true);
|
||||
return true;
|
||||
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.36 1998/06/15 19:27:58 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.37 1998/09/01 03:21:18 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -52,7 +52,7 @@ BTStack
|
||||
_bt_search(Relation rel, int keysz, ScanKey scankey, Buffer *bufP)
|
||||
{
|
||||
*bufP = _bt_getroot(rel, BT_READ);
|
||||
return (_bt_searchr(rel, keysz, scankey, bufP, (BTStack) NULL));
|
||||
return _bt_searchr(rel, keysz, scankey, bufP, (BTStack) NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -81,7 +81,7 @@ _bt_searchr(Relation rel,
|
||||
page = BufferGetPage(*bufP);
|
||||
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
|
||||
if (opaque->btpo_flags & BTP_LEAF)
|
||||
return (stack_in);
|
||||
return stack_in;
|
||||
|
||||
/*
|
||||
* Find the appropriate item on the internal page, and get the child
|
||||
@@ -127,7 +127,7 @@ _bt_searchr(Relation rel,
|
||||
*bufP = _bt_moveright(rel, *bufP, keysz, scankey, BT_READ);
|
||||
|
||||
/* okay, all set to move down a level */
|
||||
return (_bt_searchr(rel, keysz, scankey, bufP, stack));
|
||||
return _bt_searchr(rel, keysz, scankey, bufP, stack);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -166,7 +166,7 @@ _bt_moveright(Relation rel,
|
||||
|
||||
/* if we're on a rightmost page, we don't need to move right */
|
||||
if (P_RIGHTMOST(opaque))
|
||||
return (buf);
|
||||
return buf;
|
||||
|
||||
/* by convention, item 0 on non-rightmost pages is the high key */
|
||||
hikey = PageGetItemId(page, P_HIKEY);
|
||||
@@ -252,7 +252,7 @@ _bt_moveright(Relation rel,
|
||||
&& _bt_skeycmp(rel, keysz, scankey, page, hikey,
|
||||
BTGreaterEqualStrategyNumber));
|
||||
}
|
||||
return (buf);
|
||||
return buf;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -300,7 +300,7 @@ _bt_skeycmp(Relation rel,
|
||||
item = (BTItem) PageGetItem(page, itemid);
|
||||
indexTuple = &(item->bti_itup);
|
||||
|
||||
tupDes = RelationGetTupleDescriptor(rel);
|
||||
tupDes = RelationGetDescr(rel);
|
||||
|
||||
/* see if the comparison is true for all of the key attributes */
|
||||
for (i = 1; i <= keysz; i++)
|
||||
@@ -338,13 +338,13 @@ _bt_skeycmp(Relation rel,
|
||||
if (compare) /* true for one of ">, <, =" */
|
||||
{
|
||||
if (strat != BTEqualStrategyNumber)
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
/* false for one of ">, <, =" */
|
||||
{
|
||||
if (strat == BTEqualStrategyNumber)
|
||||
return (false);
|
||||
return false;
|
||||
|
||||
/*
|
||||
* if original strat was "<=, >=" OR "<, >" but some
|
||||
@@ -360,11 +360,11 @@ _bt_skeycmp(Relation rel,
|
||||
if (compare) /* key' and item' attributes are equal */
|
||||
continue; /* - try to compare next attributes */
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -397,7 +397,7 @@ _bt_binsrch(Relation rel,
|
||||
int natts = rel->rd_rel->relnatts;
|
||||
int result;
|
||||
|
||||
itupdesc = RelationGetTupleDescriptor(rel);
|
||||
itupdesc = RelationGetDescr(rel);
|
||||
page = BufferGetPage(buf);
|
||||
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
|
||||
|
||||
@@ -416,17 +416,17 @@ _bt_binsrch(Relation rel,
|
||||
*/
|
||||
|
||||
if (PageIsEmpty(page))
|
||||
return (low);
|
||||
return low;
|
||||
if ((!P_RIGHTMOST(opaque) && high <= low))
|
||||
{
|
||||
if (high < low ||
|
||||
(srchtype == BT_DESCENT && !(opaque->btpo_flags & BTP_LEAF)))
|
||||
return (low);
|
||||
return low;
|
||||
/* It's insertion and high == low == 2 */
|
||||
result = _bt_compare(rel, itupdesc, page, keysz, scankey, low);
|
||||
if (result > 0)
|
||||
return (OffsetNumberNext(low));
|
||||
return (low);
|
||||
return OffsetNumberNext(low);
|
||||
return low;
|
||||
}
|
||||
|
||||
while ((high - low) > 1)
|
||||
@@ -454,11 +454,11 @@ _bt_binsrch(Relation rel,
|
||||
* code (natts == keysz). - vadim 04/15/97
|
||||
*/
|
||||
if (natts == keysz || opaque->btpo_flags & BTP_LEAF)
|
||||
return (mid);
|
||||
return mid;
|
||||
low = P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY;
|
||||
if (mid == low)
|
||||
return (mid);
|
||||
return (OffsetNumberPrev(mid));
|
||||
return mid;
|
||||
return OffsetNumberPrev(mid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -490,33 +490,33 @@ _bt_binsrch(Relation rel,
|
||||
* comments above for multi-column indices.
|
||||
*/
|
||||
if (natts == keysz)
|
||||
return (mid);
|
||||
return mid;
|
||||
low = P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY;
|
||||
if (mid == low)
|
||||
return (mid);
|
||||
return (OffsetNumberPrev(mid));
|
||||
return mid;
|
||||
return OffsetNumberPrev(mid);
|
||||
}
|
||||
else if (result > 0)
|
||||
return (high);
|
||||
return high;
|
||||
else
|
||||
return (low);
|
||||
return low;
|
||||
}
|
||||
else
|
||||
/* we want the first key >= the scan key */
|
||||
{
|
||||
result = _bt_compare(rel, itupdesc, page, keysz, scankey, low);
|
||||
if (result <= 0)
|
||||
return (low);
|
||||
return low;
|
||||
else
|
||||
{
|
||||
if (low == high)
|
||||
return (OffsetNumberNext(low));
|
||||
return OffsetNumberNext(low);
|
||||
|
||||
result = _bt_compare(rel, itupdesc, page, keysz, scankey, high);
|
||||
if (result <= 0)
|
||||
return (high);
|
||||
return high;
|
||||
else
|
||||
return (OffsetNumberNext(high));
|
||||
return OffsetNumberNext(high);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -543,7 +543,7 @@ _bt_firsteq(Relation rel,
|
||||
keysz, scankey, OffsetNumberPrev(offnum)) == 0)
|
||||
offnum = OffsetNumberPrev(offnum);
|
||||
|
||||
return (offnum);
|
||||
return offnum;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -630,8 +630,8 @@ _bt_compare(Relation rel,
|
||||
|
||||
if (_bt_skeycmp(rel, keysz, scankey, page, itemid,
|
||||
BTEqualStrategyNumber))
|
||||
return (0);
|
||||
return (1);
|
||||
return 0;
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -675,11 +675,11 @@ _bt_compare(Relation rel,
|
||||
|
||||
/* if the keys are unequal, return the difference */
|
||||
if (result != 0)
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* by here, the keys are equal */
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -726,7 +726,7 @@ _bt_next(IndexScanDesc scan, ScanDirection dir)
|
||||
{
|
||||
/* step one tuple in the appropriate direction */
|
||||
if (!_bt_step(scan, &buf, dir))
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
|
||||
/* by here, current is the tuple we want to return */
|
||||
offnum = ItemPointerGetOffsetNumber(current);
|
||||
@@ -741,7 +741,7 @@ _bt_next(IndexScanDesc scan, ScanDirection dir)
|
||||
|
||||
/* remember which buffer we have pinned and locked */
|
||||
so->btso_curbuf = buf;
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
} while (keysok >= so->numberOfFirstKeys);
|
||||
@@ -750,7 +750,7 @@ _bt_next(IndexScanDesc scan, ScanDirection dir)
|
||||
so->btso_curbuf = InvalidBuffer;
|
||||
_bt_relbuf(rel, buf, BT_READ);
|
||||
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -812,13 +812,13 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
|
||||
scan->scanFromEnd = true;
|
||||
|
||||
if (so->qual_ok == 0)
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
|
||||
/* if we just need to walk down one edge of the tree, do that */
|
||||
if (scan->scanFromEnd)
|
||||
return (_bt_endpoint(scan, dir));
|
||||
return _bt_endpoint(scan, dir);
|
||||
|
||||
itupdesc = RelationGetTupleDescriptor(rel);
|
||||
itupdesc = RelationGetDescr(rel);
|
||||
current = &(scan->currentItemData);
|
||||
|
||||
/*
|
||||
@@ -831,7 +831,7 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
|
||||
if (so->keyData[0].sk_flags & SK_ISNULL)
|
||||
{
|
||||
elog(ERROR, "_bt_first: btree doesn't support is(not)null, yet");
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
}
|
||||
proc = index_getprocid(rel, 1, BTORDER_PROC);
|
||||
ScanKeyEntryInitialize(&skdata, so->keyData[0].sk_flags, 1, proc,
|
||||
@@ -855,7 +855,7 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
|
||||
ItemPointerSetInvalid(current);
|
||||
so->btso_curbuf = InvalidBuffer;
|
||||
_bt_relbuf(rel, buf, BT_READ);
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
}
|
||||
maxoff = PageGetMaxOffsetNumber(page);
|
||||
pop = (BTPageOpaque) PageGetSpecialPointer(page);
|
||||
@@ -881,7 +881,7 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
|
||||
ItemPointerSetInvalid(current);
|
||||
so->btso_curbuf = InvalidBuffer;
|
||||
_bt_relbuf(rel, buf, BT_READ);
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
}
|
||||
maxoff = PageGetMaxOffsetNumber(page);
|
||||
pop = (BTPageOpaque) PageGetSpecialPointer(page);
|
||||
@@ -955,7 +955,7 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
|
||||
_bt_relbuf(scan->relation, buf, BT_READ);
|
||||
so->btso_curbuf = InvalidBuffer;
|
||||
ItemPointerSetInvalid(&(scan->currentItemData));
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -970,7 +970,7 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
|
||||
_bt_relbuf(scan->relation, buf, BT_READ);
|
||||
so->btso_curbuf = InvalidBuffer;
|
||||
ItemPointerSetInvalid(&(scan->currentItemData));
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
}
|
||||
}
|
||||
else if (result > 0)
|
||||
@@ -1035,7 +1035,7 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
|
||||
else if (keysok >= so->numberOfFirstKeys)
|
||||
{
|
||||
so->btso_curbuf = buf;
|
||||
return (_bt_next(scan, dir));
|
||||
return _bt_next(scan, dir);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1045,7 +1045,7 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
|
||||
res = (RetrieveIndexResult) NULL;
|
||||
}
|
||||
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1093,7 +1093,7 @@ _bt_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
|
||||
_bt_relbuf(rel, *bufP, BT_READ);
|
||||
ItemPointerSetInvalid(current);
|
||||
*bufP = so->btso_curbuf = InvalidBuffer;
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1118,7 +1118,7 @@ _bt_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
|
||||
{
|
||||
*bufP = so->btso_curbuf = InvalidBuffer;
|
||||
ItemPointerSetInvalid(current);
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1144,7 +1144,7 @@ _bt_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
|
||||
_bt_relbuf(rel, *bufP, BT_READ);
|
||||
*bufP = so->btso_curbuf = InvalidBuffer;
|
||||
ItemPointerSetInvalid(current);
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1192,7 +1192,7 @@ _bt_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
|
||||
{
|
||||
*bufP = so->btso_curbuf = InvalidBuffer;
|
||||
ItemPointerSetInvalid(current);
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1204,7 +1204,7 @@ _bt_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
|
||||
so->btso_curbuf = *bufP;
|
||||
ItemPointerSet(current, blkno, offnum);
|
||||
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1252,19 +1252,19 @@ _bt_twostep(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
|
||||
if (ScanDirectionIsForward(dir) && offnum < maxoff)
|
||||
{ /* XXX PageIsEmpty? */
|
||||
ItemPointerSet(current, blkno, OffsetNumberNext(offnum));
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
else if (ScanDirectionIsBackward(dir) && offnum > start)
|
||||
{
|
||||
ItemPointerSet(current, blkno, OffsetNumberPrev(offnum));
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* if we've hit end of scan we don't have to do any work */
|
||||
if (ScanDirectionIsForward(dir) && P_RIGHTMOST(opaque))
|
||||
return (false);
|
||||
return false;
|
||||
else if (ScanDirectionIsBackward(dir) && P_LEFTMOST(opaque))
|
||||
return (false);
|
||||
return false;
|
||||
|
||||
/*
|
||||
* Okay, it's off the page; let _bt_step() do the hard work, and we'll
|
||||
@@ -1283,7 +1283,7 @@ _bt_twostep(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
|
||||
if (_bt_step(scan, bufP, dir))
|
||||
{
|
||||
pfree(svitem);
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* try to find our place again */
|
||||
@@ -1299,7 +1299,7 @@ _bt_twostep(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
|
||||
{
|
||||
pfree(svitem);
|
||||
ItemPointerSet(current, blkno, offnum);
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1312,7 +1312,7 @@ _bt_twostep(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
|
||||
|
||||
elog(ERROR, "btree synchronization error: concurrent update botched scan");
|
||||
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1406,7 +1406,7 @@ _bt_endpoint(IndexScanDesc scan, ScanDirection dir)
|
||||
{
|
||||
ItemPointerSet(current, blkno, maxoff);
|
||||
if (!_bt_step(scan, &buf, BackwardScanDirection))
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
|
||||
start = ItemPointerGetOffsetNumber(current);
|
||||
page = BufferGetPage(buf);
|
||||
@@ -1424,13 +1424,13 @@ _bt_endpoint(IndexScanDesc scan, ScanDirection dir)
|
||||
_bt_relbuf(rel, buf, BT_READ);
|
||||
ItemPointerSetInvalid(current);
|
||||
so->btso_curbuf = InvalidBuffer;
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
}
|
||||
if (start > maxoff) /* start == 2 && maxoff == 1 */
|
||||
{
|
||||
ItemPointerSet(current, blkno, maxoff);
|
||||
if (!_bt_step(scan, &buf, ForwardScanDirection))
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
|
||||
start = ItemPointerGetOffsetNumber(current);
|
||||
page = BufferGetPage(buf);
|
||||
@@ -1452,7 +1452,7 @@ _bt_endpoint(IndexScanDesc scan, ScanDirection dir)
|
||||
{
|
||||
ItemPointerSet(current, blkno, FirstOffsetNumber);
|
||||
if (!_bt_step(scan, &buf, ForwardScanDirection))
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
|
||||
start = ItemPointerGetOffsetNumber(current);
|
||||
page = BufferGetPage(buf);
|
||||
@@ -1466,12 +1466,12 @@ _bt_endpoint(IndexScanDesc scan, ScanDirection dir)
|
||||
_bt_relbuf(rel, buf, BT_READ);
|
||||
ItemPointerSetInvalid(current);
|
||||
so->btso_curbuf = InvalidBuffer;
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
}
|
||||
/* Go back ! */
|
||||
ItemPointerSet(current, blkno, FirstOffsetNumber);
|
||||
if (!_bt_step(scan, &buf, BackwardScanDirection))
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
|
||||
start = ItemPointerGetOffsetNumber(current);
|
||||
page = BufferGetPage(buf);
|
||||
@@ -1500,7 +1500,7 @@ _bt_endpoint(IndexScanDesc scan, ScanDirection dir)
|
||||
else if (keysok >= so->numberOfFirstKeys)
|
||||
{
|
||||
so->btso_curbuf = buf;
|
||||
return (_bt_next(scan, dir));
|
||||
return _bt_next(scan, dir);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1510,5 +1510,5 @@ _bt_endpoint(IndexScanDesc scan, ScanDirection dir)
|
||||
res = (RetrieveIndexResult) NULL;
|
||||
}
|
||||
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Id: nbtsort.c,v 1.31 1998/08/25 21:33:57 scrappy Exp $
|
||||
* $Id: nbtsort.c,v 1.32 1998/09/01 03:21:19 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
*
|
||||
@@ -180,11 +180,11 @@ _bt_isortcmp(BTSortKey *k1, BTSortKey *k2)
|
||||
if (k1->btsk_item == (BTItem) NULL)
|
||||
{
|
||||
if (k2->btsk_item == (BTItem) NULL)
|
||||
return (0); /* 1 = 2 */
|
||||
return (1); /* 1 > 2 */
|
||||
return 0; /* 1 = 2 */
|
||||
return 1; /* 1 > 2 */
|
||||
}
|
||||
else if (k2->btsk_item == (BTItem) NULL)
|
||||
return (-1); /* 1 < 2 */
|
||||
return -1; /* 1 < 2 */
|
||||
|
||||
for (i = 0; i < _bt_nattr; i++)
|
||||
{
|
||||
@@ -195,17 +195,17 @@ _bt_isortcmp(BTSortKey *k1, BTSortKey *k2)
|
||||
equal_isnull = true;
|
||||
continue;
|
||||
}
|
||||
return (1); /* NULL ">" NOT_NULL */
|
||||
return 1; /* NULL ">" NOT_NULL */
|
||||
}
|
||||
else if (k2_nulls[i] != ' ') /* k2 attr is NULL */
|
||||
return (-1); /* NOT_NULL "<" NULL */
|
||||
return -1; /* NOT_NULL "<" NULL */
|
||||
|
||||
if (_bt_invokestrat(_bt_sortrel, i + 1, BTGreaterStrategyNumber,
|
||||
k1_datum[i], k2_datum[i]))
|
||||
return (1); /* 1 > 2 */
|
||||
return 1; /* 1 > 2 */
|
||||
else if (_bt_invokestrat(_bt_sortrel, i + 1, BTGreaterStrategyNumber,
|
||||
k2_datum[i], k1_datum[i]))
|
||||
return (-1); /* 1 < 2 */
|
||||
return -1; /* 1 < 2 */
|
||||
}
|
||||
|
||||
if (_bt_inspool->isunique && !equal_isnull)
|
||||
@@ -213,7 +213,7 @@ _bt_isortcmp(BTSortKey *k1, BTSortKey *k2)
|
||||
_bt_spooldestroy((void *) _bt_inspool);
|
||||
elog(ERROR, "Cannot create unique index. Table contains non-unique values");
|
||||
}
|
||||
return (0); /* 1 = 2 */
|
||||
return 0; /* 1 = 2 */
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -307,17 +307,17 @@ _bt_pqnext(BTPriQueue *q, BTPriQueueElem *e)
|
||||
{
|
||||
if (q->btpq_nelem < 1)
|
||||
{ /* already empty */
|
||||
return (-1);
|
||||
return -1;
|
||||
}
|
||||
*e = q->btpq_queue[0]; /* struct = */
|
||||
|
||||
if (--q->btpq_nelem < 1)
|
||||
{ /* now empty, don't sift */
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
q->btpq_queue[0] = q->btpq_queue[q->btpq_nelem]; /* struct = */
|
||||
_bt_pqsift(q, 0);
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -426,7 +426,7 @@ _bt_tapecreate(char *fname)
|
||||
/* initialize the buffer */
|
||||
_bt_tapereset(tape);
|
||||
|
||||
return (tape);
|
||||
return tape;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -468,7 +468,7 @@ _bt_taperead(BTTapeBlock *tape)
|
||||
|
||||
if (tape->bttb_eor)
|
||||
{
|
||||
return (0); /* we are already at End-Of-Run */
|
||||
return 0; /* we are already at End-Of-Run */
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -482,11 +482,11 @@ _bt_taperead(BTTapeBlock *tape)
|
||||
if (nread != TAPEBLCKSZ)
|
||||
{
|
||||
Assert(nread == 0); /* we are at EOF */
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
Assert(tape->bttb_magic == BTTAPEMAGIC);
|
||||
NDirectFileRead += TAPEBLCKSZ / BLCKSZ;
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -506,11 +506,11 @@ _bt_tapenext(BTTapeBlock *tape, char **pos)
|
||||
BTItem bti;
|
||||
|
||||
if (*pos >= tape->bttb_data + tape->bttb_top)
|
||||
return ((BTItem) NULL);
|
||||
return (BTItem) NULL;
|
||||
bti = (BTItem) *pos;
|
||||
itemsz = BTITEMSZ(bti);
|
||||
*pos += DOUBLEALIGN(itemsz);
|
||||
return (bti);
|
||||
return bti;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -574,7 +574,7 @@ _bt_spoolinit(Relation index, int ntapes, bool isunique)
|
||||
|
||||
_bt_isortcmpinit(index, btspool);
|
||||
|
||||
return ((void *) btspool);
|
||||
return (void *) btspool;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -838,7 +838,7 @@ _bt_pagestate(Relation index, int flags, int level, bool doupper)
|
||||
state->btps_level = level;
|
||||
state->btps_doupper = doupper;
|
||||
|
||||
return ((void *) state);
|
||||
return (void *) state;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -859,7 +859,7 @@ _bt_minitem(Page opage, BlockNumber oblkno, int atend)
|
||||
nbti = _bt_formitem(&(obti->bti_itup));
|
||||
ItemPointerSet(&(nbti->bti_itup.t_tid), oblkno, P_HIKEY);
|
||||
|
||||
return (nbti);
|
||||
return nbti;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1074,7 +1074,7 @@ _bt_buildadd(Relation index, void *pstate, BTItem bti, int flags)
|
||||
state->btps_lastoff = last_off;
|
||||
state->btps_firstoff = first_off;
|
||||
|
||||
return (last_bti);
|
||||
return last_bti;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtstrat.c,v 1.6 1997/09/08 02:20:59 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtstrat.c,v 1.7 1998/09/01 03:21:21 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -115,7 +115,7 @@ _bt_getstrat(Relation rel,
|
||||
|
||||
Assert(StrategyNumberIsValid(strat));
|
||||
|
||||
return (strat);
|
||||
return strat;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtutils.c,v 1.21 1998/08/19 02:01:18 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtutils.c,v 1.22 1998/09/01 03:21:23 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -44,7 +44,7 @@ _bt_mkscankey(Relation rel, IndexTuple itup)
|
||||
bits16 flag;
|
||||
|
||||
natts = rel->rd_rel->relnatts;
|
||||
itupdesc = RelationGetTupleDescriptor(rel);
|
||||
itupdesc = RelationGetDescr(rel);
|
||||
|
||||
skey = (ScanKey) palloc(natts * sizeof(ScanKeyData));
|
||||
|
||||
@@ -64,7 +64,7 @@ _bt_mkscankey(Relation rel, IndexTuple itup)
|
||||
ScanKeyEntryInitialize(&skey[i], flag, (AttrNumber) (i + 1), proc, arg);
|
||||
}
|
||||
|
||||
return (skey);
|
||||
return skey;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -306,7 +306,7 @@ _bt_formitem(IndexTuple itup)
|
||||
#ifndef BTREE_VERSION_1
|
||||
btitem->bti_oid = newoid();
|
||||
#endif
|
||||
return (btitem);
|
||||
return btitem;
|
||||
}
|
||||
|
||||
#ifdef NOT_USED
|
||||
@@ -317,10 +317,10 @@ _bt_checkqual(IndexScanDesc scan, IndexTuple itup)
|
||||
|
||||
so = (BTScanOpaque) scan->opaque;
|
||||
if (so->numberOfKeys > 0)
|
||||
return (index_keytest(itup, RelationGetTupleDescriptor(scan->relation),
|
||||
return (index_keytest(itup, RelationGetDescr(scan->relation),
|
||||
so->numberOfKeys, so->keyData));
|
||||
else
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -333,10 +333,10 @@ _bt_checkforkeys(IndexScanDesc scan, IndexTuple itup, Size keysz)
|
||||
|
||||
so = (BTScanOpaque) scan->opaque;
|
||||
if (keysz > 0 && so->numberOfKeys >= keysz)
|
||||
return (index_keytest(itup, RelationGetTupleDescriptor(scan->relation),
|
||||
return (index_keytest(itup, RelationGetDescr(scan->relation),
|
||||
keysz, so->keyData));
|
||||
else
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -354,10 +354,10 @@ _bt_checkkeys(IndexScanDesc scan, IndexTuple tuple, Size *keysok)
|
||||
|
||||
*keysok = 0;
|
||||
if (keysz == 0)
|
||||
return (true);
|
||||
return true;
|
||||
|
||||
key = so->keyData;
|
||||
tupdesc = RelationGetTupleDescriptor(scan->relation);
|
||||
tupdesc = RelationGetDescr(scan->relation);
|
||||
|
||||
IncrIndexProcessed();
|
||||
|
||||
@@ -370,7 +370,7 @@ _bt_checkkeys(IndexScanDesc scan, IndexTuple tuple, Size *keysok)
|
||||
|
||||
/* btree doesn't support 'A is null' clauses, yet */
|
||||
if (isNull || key[0].sk_flags & SK_ISNULL)
|
||||
return (false);
|
||||
return false;
|
||||
|
||||
if (key[0].sk_flags & SK_COMMUTE)
|
||||
{
|
||||
@@ -386,12 +386,12 @@ _bt_checkkeys(IndexScanDesc scan, IndexTuple tuple, Size *keysok)
|
||||
}
|
||||
|
||||
if (!test == !(key[0].sk_flags & SK_NEGATE))
|
||||
return (false);
|
||||
return false;
|
||||
|
||||
keysz -= 1;
|
||||
key++;
|
||||
(*keysok)++;
|
||||
}
|
||||
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtget.c,v 1.10 1998/06/15 19:28:00 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtget.c,v 1.11 1998/09/01 03:21:24 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -43,14 +43,14 @@ rtgettuple(IndexScanDesc s, ScanDirection dir)
|
||||
|
||||
/* if we have it cached in the scan desc, just return the value */
|
||||
if ((res = rtscancache(s, dir)) != (RetrieveIndexResult) NULL)
|
||||
return (res);
|
||||
return res;
|
||||
|
||||
/* not cached, so we'll have to do some work */
|
||||
if (ItemPointerIsValid(&(s->currentItemData)))
|
||||
res = rtnext(s, dir);
|
||||
else
|
||||
res = rtfirst(s, dir);
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
static RetrieveIndexResult
|
||||
@@ -85,7 +85,7 @@ rtfirst(IndexScanDesc s, ScanDirection dir)
|
||||
|
||||
ReleaseBuffer(b);
|
||||
if (so->s_stack == (RTSTACK *) NULL)
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
|
||||
stk = so->s_stack;
|
||||
b = ReadBuffer(s->relation, stk->rts_blk);
|
||||
@@ -111,7 +111,7 @@ rtfirst(IndexScanDesc s, ScanDirection dir)
|
||||
res = FormRetrieveIndexResult(&(s->currentItemData), &(it->t_tid));
|
||||
|
||||
ReleaseBuffer(b);
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -169,7 +169,7 @@ rtnext(IndexScanDesc s, ScanDirection dir)
|
||||
|
||||
ReleaseBuffer(b);
|
||||
if (so->s_stack == (RTSTACK *) NULL)
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
|
||||
stk = so->s_stack;
|
||||
b = ReadBuffer(s->relation, stk->rts_blk);
|
||||
@@ -195,7 +195,7 @@ rtnext(IndexScanDesc s, ScanDirection dir)
|
||||
res = FormRetrieveIndexResult(&(s->currentItemData), &(it->t_tid));
|
||||
|
||||
ReleaseBuffer(b);
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -250,14 +250,14 @@ findnext(IndexScanDesc s, Page p, OffsetNumber n, ScanDirection dir)
|
||||
if (po->flags & F_LEAF)
|
||||
{
|
||||
if (index_keytest(it,
|
||||
RelationGetTupleDescriptor(s->relation),
|
||||
RelationGetDescr(s->relation),
|
||||
s->numberOfKeys, s->keyData))
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (index_keytest(it,
|
||||
RelationGetTupleDescriptor(s->relation),
|
||||
RelationGetDescr(s->relation),
|
||||
so->s_internalNKey, so->s_internalKey))
|
||||
break;
|
||||
}
|
||||
@@ -268,7 +268,7 @@ findnext(IndexScanDesc s, Page p, OffsetNumber n, ScanDirection dir)
|
||||
n = OffsetNumberNext(n);
|
||||
}
|
||||
|
||||
return (n);
|
||||
return n;
|
||||
}
|
||||
|
||||
static RetrieveIndexResult
|
||||
@@ -281,7 +281,7 @@ rtscancache(IndexScanDesc s, ScanDirection dir)
|
||||
&& ItemPointerIsValid(&(s->currentItemData))))
|
||||
{
|
||||
|
||||
return ((RetrieveIndexResult) NULL);
|
||||
return (RetrieveIndexResult) NULL;
|
||||
}
|
||||
|
||||
ip = rtheapptr(s->relation, &(s->currentItemData));
|
||||
@@ -293,7 +293,7 @@ rtscancache(IndexScanDesc s, ScanDirection dir)
|
||||
|
||||
pfree(ip);
|
||||
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -323,5 +323,5 @@ rtheapptr(Relation r, ItemPointer itemp)
|
||||
else
|
||||
ItemPointerSetInvalid(ip);
|
||||
|
||||
return (ip);
|
||||
return ip;
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.16 1998/02/26 04:30:06 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.17 1998/09/01 03:21:26 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -36,7 +36,7 @@ rt_box_union(BOX *a, BOX *b)
|
||||
n->low.x = Min(a->low.x, b->low.x);
|
||||
n->low.y = Min(a->low.y, b->low.y);
|
||||
|
||||
return (n);
|
||||
return n;
|
||||
}
|
||||
|
||||
BOX *
|
||||
@@ -55,10 +55,10 @@ rt_box_inter(BOX *a, BOX *b)
|
||||
if (n->high.x < n->low.x || n->high.y < n->low.y)
|
||||
{
|
||||
pfree(n);
|
||||
return ((BOX *) NULL);
|
||||
return (BOX *) NULL;
|
||||
}
|
||||
|
||||
return (n);
|
||||
return n;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -149,8 +149,8 @@ rt_poly_inter(POLYGON *a, POLYGON *b)
|
||||
if (p->boundbox.high.x < p->boundbox.low.x || p->boundbox.high.y < p->boundbox.low.y)
|
||||
{
|
||||
pfree(p);
|
||||
return ((POLYGON *) NULL);
|
||||
return (POLYGON *) NULL;
|
||||
}
|
||||
|
||||
return (p);
|
||||
return p;
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.26 1998/08/19 02:01:20 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.27 1998/09/01 03:21:27 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -136,8 +136,8 @@ rtbuild(Relation heap,
|
||||
}
|
||||
|
||||
/* init the tuple descriptors and get set for a heap scan */
|
||||
hd = RelationGetTupleDescriptor(heap);
|
||||
id = RelationGetTupleDescriptor(index);
|
||||
hd = RelationGetDescr(heap);
|
||||
id = RelationGetDescr(index);
|
||||
d = (Datum *) palloc(natts * sizeof(*d));
|
||||
nulls = (bool *) palloc(natts * sizeof(*nulls));
|
||||
|
||||
@@ -310,7 +310,7 @@ rtinsert(Relation r, Datum *datum, char *nulls, ItemPointer ht_ctid, Relation he
|
||||
RTSTATE rtState;
|
||||
|
||||
/* generate an index tuple */
|
||||
itup = index_formtuple(RelationGetTupleDescriptor(r), datum, nulls);
|
||||
itup = index_formtuple(RelationGetDescr(r), datum, nulls);
|
||||
itup->t_tid = *ht_ctid;
|
||||
initRtstate(&rtState, r);
|
||||
|
||||
@@ -318,7 +318,7 @@ rtinsert(Relation r, Datum *datum, char *nulls, ItemPointer ht_ctid, Relation he
|
||||
res = rtdoinsert(r, itup, &rtState);
|
||||
|
||||
/* XXX two-phase locking -- don't unlock the relation until EOT */
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
static InsertIndexResult
|
||||
@@ -372,7 +372,7 @@ rtdoinsert(Relation r, IndexTuple itup, RTSTATE *rtstate)
|
||||
res = dosplit(r, buffer, stack, itup, rtstate);
|
||||
freestack(stack);
|
||||
WriteBuffer(buffer); /* don't forget to release buffer! */
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
/* add the item and write the buffer */
|
||||
@@ -402,7 +402,7 @@ rtdoinsert(Relation r, IndexTuple itup, RTSTATE *rtstate)
|
||||
res = (InsertIndexResult) palloc(sizeof(InsertIndexResultData));
|
||||
ItemPointerSet(&(res->pointerData), blk, l);
|
||||
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -435,7 +435,7 @@ rttighten(Relation r,
|
||||
|
||||
if (newd_size != old_size)
|
||||
{
|
||||
TupleDesc td = RelationGetTupleDescriptor(r);
|
||||
TupleDesc td = RelationGetDescr(r);
|
||||
|
||||
if (td->attrs[0]->attlen < 0)
|
||||
{
|
||||
@@ -620,7 +620,7 @@ dosplit(Relation r,
|
||||
pfree(ltup);
|
||||
pfree(rtup);
|
||||
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -922,13 +922,13 @@ choose(Relation r, Page p, IndexTuple it, RTSTATE *rtstate)
|
||||
}
|
||||
}
|
||||
|
||||
return (which);
|
||||
return which;
|
||||
}
|
||||
|
||||
static int
|
||||
nospace(Page p, IndexTuple it)
|
||||
{
|
||||
return (PageGetFreeSpace(p) < IndexTupleSize(it));
|
||||
return PageGetFreeSpace(p) < IndexTupleSize(it);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -970,7 +970,7 @@ rtdelete(Relation r, ItemPointer tid)
|
||||
WriteBuffer(buf);
|
||||
|
||||
/* XXX -- two-phase locking, don't release the write lock */
|
||||
return ((char *) NULL);
|
||||
return (char *) NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.17 1998/08/19 02:01:21 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.18 1998/09/01 03:21:28 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -73,7 +73,7 @@ rtbeginscan(Relation r,
|
||||
s = RelationGetIndexScan(r, fromEnd, nkeys, key);
|
||||
rtregscan(s);
|
||||
|
||||
return (s);
|
||||
return s;
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtstrat.c,v 1.8 1997/09/08 02:21:11 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtstrat.c,v 1.9 1998/09/01 03:21:30 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -209,7 +209,7 @@ RelationGetRTStrategy(Relation r,
|
||||
AttrNumber attnum,
|
||||
RegProcedure proc)
|
||||
{
|
||||
return (RelationGetStrategy(r, attnum, &RTEvaluationData, proc));
|
||||
return RelationGetStrategy(r, attnum, &RTEvaluationData, proc);
|
||||
}
|
||||
|
||||
#ifdef NOT_USED
|
||||
@@ -239,5 +239,5 @@ RTMapOperator(Relation r,
|
||||
RTNStrategies,
|
||||
attnum);
|
||||
|
||||
return (strategyMap->entry[RTOperMap[procstrat - 1] - 1].sk_procedure);
|
||||
return strategyMap->entry[RTOperMap[procstrat - 1] - 1].sk_procedure;
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.17 1998/02/26 04:30:18 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.18 1998/09/01 03:21:31 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* This file contains the high level access-method interface to the
|
||||
@@ -188,7 +188,7 @@ TransactionLogTest(TransactionId transactionId, /* transaction id to test */
|
||||
/*
|
||||
* so lint is happy...
|
||||
*/
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* --------------------------------
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.21 1998/07/21 04:17:21 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.22 1998/09/01 03:21:33 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Transaction aborts can now occur two ways:
|
||||
@@ -295,7 +295,7 @@ IsTransactionState(void)
|
||||
/*
|
||||
* Shouldn't get here, but lint is not happy with this...
|
||||
*/
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* --------------------------------
|
||||
@@ -863,7 +863,7 @@ StartTransaction()
|
||||
bool
|
||||
CurrentXactInProgress()
|
||||
{
|
||||
return (CurrentTransactionState->state == TRANS_INPROGRESS);
|
||||
return CurrentTransactionState->state == TRANS_INPROGRESS;
|
||||
}
|
||||
|
||||
/* --------------------------------
|
||||
@@ -1462,7 +1462,7 @@ IsTransactionBlock()
|
||||
|
||||
if (s->blockState == TBLOCK_INPROGRESS
|
||||
|| s->blockState == TBLOCK_ENDABORT)
|
||||
return (true);
|
||||
return true;
|
||||
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/xid.c,v 1.16 1998/04/26 04:05:34 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/xid.c,v 1.17 1998/09/01 03:21:34 momjian Exp $
|
||||
*
|
||||
* OLD COMMENTS
|
||||
* XXX WARNING
|
||||
@@ -34,7 +34,7 @@ extern TransactionId FirstTransactionId;
|
||||
TransactionId
|
||||
xidin(char *representation)
|
||||
{
|
||||
return (atol(representation));
|
||||
return atol(representation);
|
||||
}
|
||||
|
||||
/* XXX name for catalogs */
|
||||
@@ -49,7 +49,7 @@ xidout(TransactionId transactionId)
|
||||
|
||||
sprintf(representation, "%u", transactionId);
|
||||
|
||||
return (representation);
|
||||
return representation;
|
||||
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ xidout(TransactionId transactionId)
|
||||
bool
|
||||
TransactionIdIsLessThan(TransactionId id1, TransactionId id2)
|
||||
{
|
||||
return ((bool) (id1 < id2));
|
||||
return (bool) (id1 < id2);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
@@ -75,7 +75,7 @@ TransactionIdIsLessThan(TransactionId id1, TransactionId id2)
|
||||
bool
|
||||
xideq(TransactionId xid1, TransactionId xid2)
|
||||
{
|
||||
return ((bool) (xid1 == xid2));
|
||||
return (bool) (xid1 == xid2);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user