1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Renaming cleanup, no pgindent yet.

This commit is contained in:
Bruce Momjian
1998-09-01 03:29:17 +00:00
parent 2aa080fc93
commit af74855a60
329 changed files with 4380 additions and 4388 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.38 1998/08/30 21:04:43 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.39 1998/09/01 03:21:50 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -189,7 +189,7 @@ Async_Notify(char *relname)
PointerGetDatum(notifyName));
lRel = heap_openr(ListenerRelationName);
tdesc = RelationGetTupleDescriptor(lRel);
tdesc = RelationGetDescr(lRel);
RelationSetLockForWrite(lRel);
sRel = heap_beginscan(lRel, 0, SnapshotNow, 1, &key);
@@ -281,7 +281,7 @@ Async_NotifyAtCommit()
lRel = heap_openr(ListenerRelationName);
RelationSetLockForWrite(lRel);
sRel = heap_beginscan(lRel, 0, SnapshotNow, 1, &key);
tdesc = RelationGetTupleDescriptor(lRel);
tdesc = RelationGetDescr(lRel);
while (HeapTupleIsValid(lTuple = heap_getnext(sRel, 0)))
{
@@ -445,7 +445,7 @@ Async_Listen(char *relname, int pid)
RelationSetLockForWrite(lDesc);
/* is someone already listening. One listener per relation */
tdesc = RelationGetTupleDescriptor(lDesc);
tdesc = RelationGetDescr(lDesc);
scan = heap_beginscan(lDesc, 0, SnapshotNow, 0, (ScanKey) NULL);
while (HeapTupleIsValid(tuple = heap_getnext(scan, 0)))
{
@@ -571,7 +571,7 @@ Async_UnlistenAll()
Int32GetDatum(MyProcPid));
lRel = heap_openr(ListenerRelationName);
RelationSetLockForWrite(lRel);
tdesc = RelationGetTupleDescriptor(lRel);
tdesc = RelationGetDescr(lRel);
sRel = heap_beginscan(lRel, 0, SnapshotNow, 1, key);
while (HeapTupleIsValid(lTuple = heap_getnext(sRel, 0)))
@@ -672,7 +672,7 @@ Async_NotifyFrontEnd_Aux()
Int32GetDatum(MyProcPid));
lRel = heap_openr(ListenerRelationName);
RelationSetLockForWrite(lRel);
tdesc = RelationGetTupleDescriptor(lRel);
tdesc = RelationGetDescr(lRel);
sRel = heap_beginscan(lRel, 0, SnapshotNow, 2, key);
nulls[0] = nulls[1] = nulls[2] = ' ';

View File

@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.29 1998/08/20 22:24:10 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.30 1998/09/01 03:21:52 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -80,7 +80,7 @@ static void rebuildheap(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex);
*
*/
void
cluster(char oldrelname[], char oldindexname[])
cluster(char *oldrelname, char *oldindexname)
{
Oid OIDOldHeap,
OIDOldIndex,
@@ -209,7 +209,7 @@ copy_heap(Oid OIDOldHeap)
sprintf(NewName, "temp_%x", OIDOldHeap);
OldHeap = heap_open(OIDOldHeap);
OldHeapDesc = RelationGetTupleDescriptor(OldHeap);
OldHeapDesc = RelationGetDescr(OldHeap);
/*
* Need to make a copy of the tuple descriptor,
@@ -239,7 +239,7 @@ copy_index(Oid OIDOldIndex, Oid OIDNewHeap)
HeapTuple Old_pg_index_Tuple,
Old_pg_index_relation_Tuple,
pg_proc_Tuple;
IndexTupleForm Old_pg_index_Form;
Form_pg_index Old_pg_index_Form;
Form_pg_class Old_pg_index_relation_Form;
Form_pg_proc pg_proc_Form;
char *NewIndexName;
@@ -261,7 +261,7 @@ copy_index(Oid OIDOldIndex, Oid OIDNewHeap)
0, 0, 0);
Assert(Old_pg_index_Tuple);
Old_pg_index_Form = (IndexTupleForm) GETSTRUCT(Old_pg_index_Tuple);
Old_pg_index_Form = (Form_pg_index) GETSTRUCT(Old_pg_index_Tuple);
Old_pg_index_relation_Tuple =
SearchSysCacheTuple(RELOID,

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.30 1998/08/19 02:01:42 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.31 1998/09/01 03:21:53 momjian Exp $
*
* NOTES
* The PortalExecutorHeapMemory crap needs to be eliminated
@@ -270,11 +270,11 @@ PerformAddAttribute(char *relationName,
bool inherits,
ColumnDef *colDef)
{
Relation relrdesc,
Relation rel,
attrdesc;
HeapTuple reltup;
HeapTuple attributeTuple;
AttributeTupleForm attribute;
Form_pg_attribute attribute;
FormData_pg_attribute attributeD;
int i;
int minattnum,
@@ -325,14 +325,14 @@ PerformAddAttribute(char *relationName,
List *child,
*children;
relrdesc = heap_openr(relationName);
if (!RelationIsValid(relrdesc))
rel = heap_openr(relationName);
if (!RelationIsValid(rel))
{
elog(ERROR, "PerformAddAttribute: unknown relation: \"%s\"",
relationName);
}
myrelid = RelationGetRelid(relrdesc);
heap_close(relrdesc);
myrelid = RelationGetRelid(rel);
heap_close(rel);
/* this routine is actually in the planner */
children = find_all_inheritors(lconsi(myrelid, NIL), NIL);
@@ -347,20 +347,20 @@ PerformAddAttribute(char *relationName,
childrelid = lfirsti(child);
if (childrelid == myrelid)
continue;
relrdesc = heap_open(childrelid);
if (!RelationIsValid(relrdesc))
rel = heap_open(childrelid);
if (!RelationIsValid(rel))
{
elog(ERROR, "PerformAddAttribute: can't find catalog entry for inheriting class with oid %d",
childrelid);
}
PerformAddAttribute((relrdesc->rd_rel->relname).data,
PerformAddAttribute((rel->rd_rel->relname).data,
userName, false, colDef);
heap_close(relrdesc);
heap_close(rel);
}
}
}
relrdesc = heap_openr(RelationRelationName);
rel = heap_openr(RelationRelationName);
reltup = SearchSysCacheTupleCopy(RELNAME,
PointerGetDatum(relationName),
@@ -368,7 +368,7 @@ PerformAddAttribute(char *relationName,
if (!HeapTupleIsValid(reltup))
{
heap_close(relrdesc);
heap_close(rel);
elog(ERROR, "PerformAddAttribute: relation \"%s\" not found",
relationName);
}
@@ -388,7 +388,7 @@ PerformAddAttribute(char *relationName,
if (maxatts > MaxHeapAttributeNumber)
{
pfree(reltup);
heap_close(relrdesc);
heap_close(rel);
elog(ERROR, "PerformAddAttribute: relations limited to %d attributes",
MaxHeapAttributeNumber);
}
@@ -396,12 +396,12 @@ PerformAddAttribute(char *relationName,
attrdesc = heap_openr(AttributeRelationName);
Assert(attrdesc);
Assert(RelationGetRelationTupleForm(attrdesc));
Assert(RelationGetForm(attrdesc));
/*
* Open all (if any) pg_attribute indices
*/
hasindex = RelationGetRelationTupleForm(attrdesc)->relhasindex;
hasindex = RelationGetForm(attrdesc)->relhasindex;
if (hasindex)
CatalogOpenIndices(Num_pg_attr_indices, Name_pg_attr_indices, idescs);
@@ -411,13 +411,13 @@ PerformAddAttribute(char *relationName,
sizeof attributeD,
(char *) &attributeD);
attribute = (AttributeTupleForm) GETSTRUCT(attributeTuple);
attribute = (Form_pg_attribute) GETSTRUCT(attributeTuple);
i = 1 + minattnum;
{
HeapTuple typeTuple;
TypeTupleForm form;
Form_pg_type form;
char *typename;
int attnelems;
@@ -429,7 +429,7 @@ PerformAddAttribute(char *relationName,
if (HeapTupleIsValid(tup))
{
heap_close(attrdesc);
heap_close(relrdesc);
heap_close(rel);
elog(ERROR, "PerformAddAttribute: attribute \"%s\" already exists in class \"%s\"",
colDef->colname, relationName);
}
@@ -451,7 +451,7 @@ PerformAddAttribute(char *relationName,
typeTuple = SearchSysCacheTuple(TYPNAME,
PointerGetDatum(typename),
0, 0, 0);
form = (TypeTupleForm) GETSTRUCT(typeTuple);
form = (Form_pg_type) GETSTRUCT(typeTuple);
if (!HeapTupleIsValid(typeTuple))
elog(ERROR, "Add: type \"%s\" nonexistent", typename);
@@ -482,13 +482,13 @@ PerformAddAttribute(char *relationName,
heap_close(attrdesc);
((Form_pg_class) GETSTRUCT(reltup))->relnatts = maxatts;
heap_replace(relrdesc, &reltup->t_ctid, reltup);
heap_replace(rel, &reltup->t_ctid, reltup);
/* keep catalog indices current */
CatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices, ridescs);
CatalogIndexInsert(ridescs, Num_pg_class_indices, relrdesc, reltup);
CatalogIndexInsert(ridescs, Num_pg_class_indices, rel, reltup);
CatalogCloseIndices(Num_pg_class_indices, ridescs);
pfree(reltup);
heap_close(relrdesc);
heap_close(rel);
}

View File

@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.57 1998/08/29 18:19:59 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.58 1998/09/01 03:21:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -217,7 +217,7 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
int32 attr_count,
i;
AttributeTupleForm *attr;
Form_pg_attribute *attr;
FmgrInfo *out_functions;
Oid out_func_oid;
Oid *elements;
@@ -371,7 +371,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
{
HeapTuple tuple;
AttrNumber attr_count;
AttributeTupleForm *attr;
Form_pg_attribute *attr;
FmgrInfo *in_functions;
int i;
Oid in_func_oid;
@@ -397,7 +397,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
**finfoP = NULL;
TupleDesc *itupdescArr;
HeapTuple pgIndexTup;
IndexTupleForm *pgIndexP = NULL;
Form_pg_index *pgIndexP = NULL;
int *indexNatts = NULL;
char *predString;
Node **indexPred = NULL;
@@ -418,7 +418,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
Oid loaded_oid;
bool skip_tuple = false;
tupDesc = RelationGetTupleDescriptor(rel);
tupDesc = RelationGetDescr(rel);
attr = tupDesc->attrs;
attr_count = tupDesc->natts;
@@ -438,7 +438,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
itupdescArr =
(TupleDesc *) palloc(n_indices * sizeof(TupleDesc));
pgIndexP =
(IndexTupleForm *) palloc(n_indices * sizeof(IndexTupleForm));
(Form_pg_index *) palloc(n_indices * sizeof(Form_pg_index));
indexNatts = (int *) palloc(n_indices * sizeof(int));
finfo = (FuncIndexInfo *) palloc(n_indices * sizeof(FuncIndexInfo));
finfoP = (FuncIndexInfo **) palloc(n_indices * sizeof(FuncIndexInfo *));
@@ -446,13 +446,13 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
econtext = NULL;
for (i = 0; i < n_indices; i++)
{
itupdescArr[i] = RelationGetTupleDescriptor(index_rels[i]);
itupdescArr[i] = RelationGetDescr(index_rels[i]);
pgIndexTup =
SearchSysCacheTuple(INDEXRELID,
ObjectIdGetDatum(RelationGetRelid(index_rels[i])),
0, 0, 0);
Assert(pgIndexTup);
pgIndexP[i] = (IndexTupleForm) GETSTRUCT(pgIndexTup);
pgIndexP[i] = (Form_pg_index) GETSTRUCT(pgIndexTup);
for (attnumP = &(pgIndexP[i]->indkey[0]), natts = 0;
*attnumP != InvalidAttrNumber;
attnumP++, natts++);
@@ -480,7 +480,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
slot = ExecAllocTableSlot(tupleTable);
econtext = makeNode(ExprContext);
econtext->ecxt_scantuple = slot;
rtupdesc = RelationGetTupleDescriptor(rel);
rtupdesc = RelationGetDescr(rel);
slot->ttc_tupleDescriptor = rtupdesc;
/*
@@ -831,10 +831,10 @@ GetOutputFunction(Oid type)
0, 0, 0);
if (HeapTupleIsValid(typeTuple))
return ((int) ((TypeTupleForm) GETSTRUCT(typeTuple))->typoutput);
return (int) ((Form_pg_type) GETSTRUCT(typeTuple))->typoutput;
elog(ERROR, "GetOutputFunction: Cache lookup of type %d failed", type);
return (InvalidOid);
return InvalidOid;
}
static Oid
@@ -847,10 +847,10 @@ GetTypeElement(Oid type)
0, 0, 0);
if (HeapTupleIsValid(typeTuple))
return ((int) ((TypeTupleForm) GETSTRUCT(typeTuple))->typelem);
return (int) ((Form_pg_type) GETSTRUCT(typeTuple))->typelem;
elog(ERROR, "GetOutputFunction: Cache lookup of type %d failed", type);
return (InvalidOid);
return InvalidOid;
}
static Oid
@@ -863,10 +863,10 @@ GetInputFunction(Oid type)
0, 0, 0);
if (HeapTupleIsValid(typeTuple))
return ((int) ((TypeTupleForm) GETSTRUCT(typeTuple))->typinput);
return (int) ((Form_pg_type) GETSTRUCT(typeTuple))->typinput;
elog(ERROR, "GetInputFunction: Cache lookup of type %d failed", type);
return (InvalidOid);
return InvalidOid;
}
static Oid
@@ -879,11 +879,11 @@ IsTypeByVal(Oid type)
0, 0, 0);
if (HeapTupleIsValid(typeTuple))
return ((int) ((TypeTupleForm) GETSTRUCT(typeTuple))->typbyval);
return (int) ((Form_pg_type) GETSTRUCT(typeTuple))->typbyval;
elog(ERROR, "GetInputFunction: Cache lookup of type %d failed", type);
return (InvalidOid);
return InvalidOid;
}
/*
@@ -917,7 +917,7 @@ GetIndexRelations(Oid main_relation_oid,
pg_index_rel = heap_openr(IndexRelationName);
scandesc = heap_beginscan(pg_index_rel, 0, SnapshotNow, 0, NULL);
tupDesc = RelationGetTupleDescriptor(pg_index_rel);
tupDesc = RelationGetDescr(pg_index_rel);
*n_indices = 0;
@@ -1039,25 +1039,25 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
if (*newline)
{
*isnull = (bool) true;
return (NULL);
return NULL;
}
#endif
*isnull = (bool) false; /* set default */
if (feof(fp))
return (NULL);
return NULL;
while (!done)
{
c = getc(fp);
if (feof(fp))
return (NULL);
return NULL;
else if (c == '\\')
{
c = getc(fp);
if (feof(fp))
return (NULL);
return NULL;
switch (c)
{
case '0':
@@ -1082,14 +1082,14 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
else
{
if (feof(fp))
return (NULL);
return NULL;
ungetc(c, fp);
}
}
else
{
if (feof(fp))
return (NULL);
return NULL;
ungetc(c, fp);
}
c = val & 0377;
@@ -1121,7 +1121,7 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
c = getc(fp);
if (c != '\n')
elog(ERROR, "CopyReadAttribute - end of record marker corrupted. line: %d", lineno);
return (NULL);
return NULL;
break;
}
}
@@ -1142,7 +1142,7 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
for(j=0;j<mblen;j++) {
c = getc(fp);
if (feof(fp))
return (NULL);
return NULL;
attribute[i++] = c;
}
#endif
@@ -1153,7 +1153,7 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
#ifdef MULTIBYTE
return(pg_client_to_server((unsigned char*)attribute, strlen(attribute)));
#else
return (&attribute[0]);
return &attribute[0];
#endif
}
@@ -1233,5 +1233,5 @@ CountTuples(Relation relation)
while (HeapTupleIsValid(tuple = heap_getnext(scandesc, 0)))
i++;
heap_endscan(scandesc);
return (i);
return i;
}

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.32 1998/08/19 02:01:45 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.33 1998/09/01 03:21:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -258,12 +258,12 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
}
if (relation->rd_rel->relkind == 'S')
elog(ERROR, "MergeAttr: Can't inherit from sequence superclass '%s'", name);
tupleDesc = RelationGetTupleDescriptor(relation);
tupleDesc = RelationGetDescr(relation);
constr = tupleDesc->constr;
for (attrno = relation->rd_rel->relnatts - 1; attrno >= 0; attrno--)
{
AttributeTupleForm attribute = tupleDesc->attrs[attrno];
Form_pg_attribute attribute = tupleDesc->attrs[attrno];
char *attributeName;
char *attributeType;
HeapTuple tuple;
@@ -280,7 +280,7 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
0, 0, 0);
AssertState(HeapTupleIsValid(tuple));
attributeType =
(((TypeTupleForm) GETSTRUCT(tuple))->typname).data;
(((Form_pg_type) GETSTRUCT(tuple))->typname).data;
/*
* check validity
@@ -363,7 +363,7 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
*/
schema = nconc(inhSchema, schema);
*supconstr = constraints;
return (schema);
return schema;
}
/*
@@ -394,7 +394,7 @@ StoreCatalogInheritance(Oid relationId, List *supers)
* ----------------
*/
relation = heap_openr(InheritsRelationName);
desc = RelationGetTupleDescriptor(relation);
desc = RelationGetDescr(relation);
seqNumber = 1;
idList = NIL;
@@ -469,7 +469,7 @@ StoreCatalogInheritance(Oid relationId, List *supers)
break;
lnext(current) =
lconsi(((InheritsTupleForm)
lconsi(((Form_pg_inherits)
GETSTRUCT(tuple))->inhparent,
NIL);
@@ -519,7 +519,7 @@ again:
* ----------------
*/
relation = heap_openr(InheritancePrecidenceListRelationName);
desc = RelationGetTupleDescriptor(relation);
desc = RelationGetDescr(relation);
seqNumber = 1;

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.22 1998/08/29 04:09:24 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.23 1998/09/01 03:21:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -171,7 +171,7 @@ get_pg_dbtup(char *command, char *dbname, Relation dbrel)
dbtup = tup;
heap_endscan(scan);
return (dbtup);
return dbtup;
}
/*
@@ -250,12 +250,12 @@ check_permissions(char *command,
{
dbowner = (int4) heap_getattr(dbtup,
Anum_pg_database_datdba,
RelationGetTupleDescriptor(dbrel),
RelationGetDescr(dbrel),
(char *) NULL);
*dbIdP = dbtup->t_oid;
dbtext = (text *) heap_getattr(dbtup,
Anum_pg_database_datpath,
RelationGetTupleDescriptor(dbrel),
RelationGetDescr(dbrel),
(char *) NULL);
strncpy(path, VARDATA(dbtext), (VARSIZE(dbtext) - VARHDRSZ));

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.24 1998/08/26 16:43:41 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.25 1998/09/01 03:21:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -234,7 +234,7 @@ ExtendIndex(char *indexRelationName, Expr *predicate, List *rangetable)
HeapTuple tuple;
FuncIndexInfo fInfo;
FuncIndexInfo *funcInfo = NULL;
IndexTupleForm index;
Form_pg_index index;
Node *oldPred = NULL;
List *cnfPred = NULL;
PredInfo *predInfo;
@@ -271,7 +271,7 @@ ExtendIndex(char *indexRelationName, Expr *predicate, List *rangetable)
/*
* Extract info from the pg_index tuple
*/
index = (IndexTupleForm) GETSTRUCT(tuple);
index = (Form_pg_index) GETSTRUCT(tuple);
Assert(index->indexrelid == indexId);
relationId = index->indrelid;
indproc = index->indproc;
@@ -421,7 +421,7 @@ FuncIndexArgs(IndexElem *funcIndex,
{
List *rest;
HeapTuple tuple;
AttributeTupleForm att;
Form_pg_attribute att;
tuple = SearchSysCacheTuple(CLANAME,
PointerGetDatum(funcIndex->class),
@@ -455,7 +455,7 @@ FuncIndexArgs(IndexElem *funcIndex,
"DefineIndex: attribute \"%s\" not found",
arg);
}
att = (AttributeTupleForm) GETSTRUCT(tuple);
att = (Form_pg_attribute) GETSTRUCT(tuple);
*attNumP++ = att->attnum;
*argTypes++ = att->atttypid;
}
@@ -477,7 +477,7 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */
for (rest = attList; rest != NIL; rest = lnext(rest))
{
IndexElem *attribute;
AttributeTupleForm attform;
Form_pg_attribute attform;
attribute = lfirst(rest);
@@ -495,7 +495,7 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */
attribute->name);
}
attform = (AttributeTupleForm) GETSTRUCT(atttuple);
attform = (Form_pg_attribute) GETSTRUCT(atttuple);
*attNumP++ = attform->attnum;
/* we want the type so we can set the proper alignment, etc. */
@@ -509,7 +509,7 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */
attribute->name);
/* we just set the type name because that is all we need */
attribute->typename = makeNode(TypeName);
attribute->typename->name = nameout(&((TypeTupleForm) GETSTRUCT(tuple))->typname);
attribute->typename->name = nameout(&((Form_pg_type) GETSTRUCT(tuple))->typname);
}
if (attribute->class == NULL)

View File

@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.25 1998/06/15 19:28:15 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.26 1998/09/01 03:22:00 momjian Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
@@ -182,7 +182,7 @@ compute_full_attributes(const List *parameters, int32 *byte_pct_p,
static void
interpret_AS_clause(const char languageName[], const char as[],
interpret_AS_clause(const char *languageName, const char *as,
char **prosrc_str_p, char **probin_str_p)
{
@@ -710,14 +710,14 @@ defGetString(DefElem *def)
{
if (nodeTag(def->arg) != T_String)
elog(ERROR, "Define: \"%s\" = what?", def->defname);
return (strVal(def->arg));
return strVal(def->arg);
}
static int
defGetTypeLength(DefElem *def)
{
if (nodeTag(def->arg) == T_Integer)
return (intVal(def->arg));
return intVal(def->arg);
else if (nodeTag(def->arg) == T_String &&
!strcasecmp(strVal(def->arg), "variable"))
return -1; /* variable length */

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.22 1998/08/06 05:12:26 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.23 1998/09/01 03:22:01 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -692,7 +692,7 @@ tg_rewriteParamsInExpr(Node *expression, QueryTreeList *inputQlist)
this code is very similar to ProcedureDefine() in pg_proc.c
*/
static int
getParamTypes(TgElement * elem, Oid typev[])
getParamTypes(TgElement * elem, Oid *typev)
{
/* this code is similar to ProcedureDefine() */
int16 parameterCount;

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.27 1998/08/19 02:01:50 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.28 1998/09/01 03:22:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -201,7 +201,7 @@ AttributeAndRelationRemove(Oid typeOid)
scan = heap_beginscan(rel, 0, SnapshotNow, 1, key);
while (HeapTupleIsValid(tup = heap_getnext(scan, 0)))
{
optr->reloid = ((AttributeTupleForm) GETSTRUCT(tup))->attrelid;
optr->reloid = ((Form_pg_attribute) GETSTRUCT(tup))->attrelid;
optr->next = (struct oidlist *) palloc(sizeof(*oidptr));
optr = optr->next;
}

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.15 1998/08/24 01:13:42 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.16 1998/09/01 03:22:04 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -164,7 +164,7 @@ renameatt(char *relname,
if (!HeapTupleIsValid(oldatttup))
elog(ERROR, "renameatt: attribute \"%s\" nonexistent", oldattname);
if (((AttributeTupleForm) GETSTRUCT(oldatttup))->attnum < 0)
if (((Form_pg_attribute) GETSTRUCT(oldatttup))->attnum < 0)
elog(ERROR, "renameatt: system attribute \"%s\" not renamed", oldattname);
newatttup = SearchSysCacheTuple(ATTNAME,
@@ -178,7 +178,7 @@ renameatt(char *relname,
elog(ERROR, "renameatt: attribute \"%s\" exists", newattname);
}
StrNCpy((((AttributeTupleForm) (GETSTRUCT(oldatttup)))->attname.data),
StrNCpy((((Form_pg_attribute) (GETSTRUCT(oldatttup)))->attname.data),
newattname, NAMEDATALEN);
attrelation = heap_openr(AttributeRelationName);

View File

@@ -38,7 +38,7 @@ typedef struct FormData_pg_sequence
char is_called;
} FormData_pg_sequence;
typedef FormData_pg_sequence *SequenceTupleForm;
typedef FormData_pg_sequence *Form_pg_sequence;
typedef struct sequence_magic
{
@@ -61,8 +61,8 @@ typedef SeqTableData *SeqTable;
static SeqTable seqtab = NULL;
static SeqTable init_sequence(char *caller, char *name);
static SequenceTupleForm read_info(char *caller, SeqTable elm, Buffer *buf);
static void init_params(CreateSeqStmt *seq, SequenceTupleForm new);
static Form_pg_sequence read_info(char *caller, SeqTable elm, Buffer *buf);
static void init_params(CreateSeqStmt *seq, Form_pg_sequence new);
static int get_param(DefElem *def);
/*
@@ -91,7 +91,7 @@ DefineSequence(CreateSeqStmt *seq)
init_params(seq, &new);
/*
* Create relation (and fill null[] & value[])
* Create relation (and fill *null & *value)
*/
stmt->tableElts = NIL;
for (i = SEQ_COL_FIRSTCOL; i <= SEQ_COL_LASTCOL; i++)
@@ -164,7 +164,7 @@ DefineSequence(CreateSeqStmt *seq)
RelationSetLockForWrite(rel);
tupDesc = RelationGetTupleDescriptor(rel);
tupDesc = RelationGetDescr(rel);
Assert(RelationGetNumberOfBlocks(rel) == 0);
buf = ReadBuffer(rel, P_NEW);
@@ -199,7 +199,7 @@ nextval(struct varlena * seqin)
char *seqname = textout(seqin);
SeqTable elm;
Buffer buf;
SequenceTupleForm seq;
Form_pg_sequence seq;
ItemPointerData iptr;
int4 incby,
maxv,
@@ -216,7 +216,7 @@ nextval(struct varlena * seqin)
if (elm->last != elm->cached) /* some numbers were cached */
{
elm->last += elm->increment;
return (elm->last);
return elm->last;
}
seq = read_info("nextval", elm, &buf); /* lock page and read
@@ -288,7 +288,7 @@ nextval(struct varlena * seqin)
ItemPointerSet(&iptr, 0, FirstOffsetNumber);
RelationUnsetSingleWLockPage(elm->rel, &iptr);
return (result);
return result;
}
@@ -309,7 +309,7 @@ currval(struct varlena * seqin)
result = elm->last;
return (result);
return result;
}
@@ -319,7 +319,7 @@ setval(struct varlena * seqin, int4 next)
char *seqname = textout(seqin);
SeqTable elm;
Buffer buf;
SequenceTupleForm seq;
Form_pg_sequence seq;
ItemPointerData iptr;
#ifndef NO_SECURITY
@@ -356,10 +356,10 @@ setval(struct varlena * seqin, int4 next)
ItemPointerSet(&iptr, 0, FirstOffsetNumber);
RelationUnsetSingleWLockPage (elm->rel, &iptr);
return (next);
return next;
}
static SequenceTupleForm
static Form_pg_sequence
read_info(char *caller, SeqTable elm, Buffer *buf)
{
ItemPointerData iptr;
@@ -367,7 +367,7 @@ read_info(char *caller, SeqTable elm, Buffer *buf)
ItemId lp;
HeapTuple tuple;
sequence_magic *sm;
SequenceTupleForm seq;
Form_pg_sequence seq;
ItemPointerSet(&iptr, 0, FirstOffsetNumber);
RelationSetSingleWLockPage(elm->rel, &iptr);
@@ -390,11 +390,11 @@ read_info(char *caller, SeqTable elm, Buffer *buf)
Assert(ItemIdIsUsed(lp));
tuple = (HeapTuple) PageGetItem((Page) page, lp);
seq = (SequenceTupleForm) GETSTRUCT(tuple);
seq = (Form_pg_sequence) GETSTRUCT(tuple);
elm->increment = seq->increment_by;
return (seq);
return seq;
}
@@ -427,7 +427,7 @@ init_sequence(char *caller, char *name)
/* found */
{
if (elm->rel != (Relation) NULL) /* already opened */
return (elm);
return elm;
temp = elm;
}
@@ -461,7 +461,7 @@ init_sequence(char *caller, char *name)
priv->next = elm;
}
return (elm);
return elm;
}
@@ -494,7 +494,7 @@ CloseSequences(void)
static void
init_params(CreateSeqStmt *seq, SequenceTupleForm new)
init_params(CreateSeqStmt *seq, Form_pg_sequence new)
{
DefElem *last_value = NULL;
DefElem *increment_by = NULL;
@@ -591,8 +591,8 @@ get_param(DefElem *def)
elog(ERROR, "DefineSequence: \"%s\" value unspecified", def->defname);
if (nodeTag(def->arg) == T_Integer)
return (intVal(def->arg));
return intVal(def->arg);
elog(ERROR, "DefineSequence: \"%s\" is to be integer", def->defname);
return (-1);
return -1;
}

View File

@@ -57,7 +57,7 @@ CreateTrigger(CreateTrigStmt *stmt)
Relation tgrel;
HeapScanDesc tgscan;
ScanKeyData key;
Relation relrdesc;
Relation pgrel;
HeapTuple tuple;
Relation idescs[Num_pg_trigger_indices];
Relation ridescs[Num_pg_class_indices];
@@ -225,15 +225,15 @@ CreateTrigger(CreateTrigStmt *stmt)
if (!HeapTupleIsValid(tuple))
elog(ERROR, "CreateTrigger: relation %s not found in pg_class", stmt->relname);
relrdesc = heap_openr(RelationRelationName);
pgrel = heap_openr(RelationRelationName);
((Form_pg_class) GETSTRUCT(tuple))->reltriggers = found + 1;
RelationInvalidateHeapTuple(relrdesc, tuple);
heap_replace(relrdesc, &tuple->t_ctid, tuple);
RelationInvalidateHeapTuple(pgrel, tuple);
heap_replace(pgrel, &tuple->t_ctid, tuple);
CatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices, ridescs);
CatalogIndexInsert(ridescs, Num_pg_class_indices, relrdesc, tuple);
CatalogIndexInsert(ridescs, Num_pg_class_indices, pgrel, tuple);
CatalogCloseIndices(Num_pg_class_indices, ridescs);
pfree(tuple);
heap_close(relrdesc);
heap_close(pgrel);
CommandCounterIncrement();
oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
@@ -252,7 +252,7 @@ DropTrigger(DropTrigStmt *stmt)
Relation tgrel;
HeapScanDesc tgscan;
ScanKeyData key;
Relation relrdesc;
Relation pgrel;
HeapTuple tuple;
Relation ridescs[Num_pg_class_indices];
MemoryContext oldcxt;
@@ -304,15 +304,15 @@ DropTrigger(DropTrigStmt *stmt)
elog(ERROR, "DropTrigger: relation %s not found in pg_class", stmt->relname);
/* update pg_class */
relrdesc = heap_openr(RelationRelationName);
pgrel = heap_openr(RelationRelationName);
((Form_pg_class) GETSTRUCT(tuple))->reltriggers = found;
RelationInvalidateHeapTuple(relrdesc, tuple);
heap_replace(relrdesc, &tuple->t_ctid, tuple);
RelationInvalidateHeapTuple(pgrel, tuple);
heap_replace(pgrel, &tuple->t_ctid, tuple);
CatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices, ridescs);
CatalogIndexInsert(ridescs, Num_pg_class_indices, relrdesc, tuple);
CatalogIndexInsert(ridescs, Num_pg_class_indices, pgrel, tuple);
CatalogCloseIndices(Num_pg_class_indices, ridescs);
pfree(tuple);
heap_close(relrdesc);
heap_close(pgrel);
CommandCounterIncrement();
oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
@@ -631,7 +631,7 @@ ExecBRInsertTriggers(Relation rel, HeapTuple trigtuple)
}
CurrentTriggerData = NULL;
pfree(SaveTriggerData);
return (newtuple);
return newtuple;
}
void
@@ -670,7 +670,7 @@ ExecBRDeleteTriggers(Relation rel, ItemPointer tupleid)
trigtuple = GetTupleForTrigger(rel, tupleid, true);
if (trigtuple == NULL)
return (false);
return false;
SaveTriggerData = (TriggerData *) palloc(sizeof(TriggerData));
SaveTriggerData->tg_event =
@@ -690,7 +690,7 @@ ExecBRDeleteTriggers(Relation rel, ItemPointer tupleid)
pfree(SaveTriggerData);
pfree(trigtuple);
return ((newtuple == NULL) ? false : true);
return (newtuple == NULL) ? false : true;
}
void
@@ -736,7 +736,7 @@ ExecBRUpdateTriggers(Relation rel, ItemPointer tupleid, HeapTuple newtuple)
trigtuple = GetTupleForTrigger(rel, tupleid, true);
if (trigtuple == NULL)
return (NULL);
return NULL;
SaveTriggerData = (TriggerData *) palloc(sizeof(TriggerData));
SaveTriggerData->tg_event =
@@ -757,7 +757,7 @@ ExecBRUpdateTriggers(Relation rel, ItemPointer tupleid, HeapTuple newtuple)
CurrentTriggerData = NULL;
pfree(SaveTriggerData);
pfree(trigtuple);
return (newtuple);
return newtuple;
}
void
@@ -816,7 +816,7 @@ GetTupleForTrigger(Relation relation, ItemPointer tid, bool before)
{
elog(NOTICE, "GetTupleForTrigger: Non-functional delete/update");
ReleaseBuffer(b);
return (NULL);
return NULL;
}
HeapTupleSatisfies(lp, relation, b, dp,
@@ -831,5 +831,5 @@ GetTupleForTrigger(Relation relation, ItemPointer tid, bool before)
tuple = heap_copytuple(tuple);
ReleaseBuffer(b);
return (tuple);
return tuple;
}

View File

@@ -125,7 +125,7 @@ DefineUser(CreateUserStmt *stmt)
* exist.
*/
pg_shadow_rel = heap_openr(ShadowRelationName);
pg_shadow_dsc = RelationGetTupleDescriptor(pg_shadow_rel);
pg_shadow_dsc = RelationGetDescr(pg_shadow_rel);
/*
* Secure a write lock on pg_shadow so we can be sure of what the next
@@ -247,7 +247,7 @@ AlterUser(AlterUserStmt *stmt)
* Scan the pg_shadow relation to be certain the user exists.
*/
pg_shadow_rel = heap_openr(ShadowRelationName);
pg_shadow_dsc = RelationGetTupleDescriptor(pg_shadow_rel);
pg_shadow_dsc = RelationGetDescr(pg_shadow_rel);
/*
* Secure a write lock on pg_shadow so we can be sure that when the
@@ -363,7 +363,7 @@ RemoveUser(char *user)
* message.
*/
pg_shadow_rel = heap_openr(ShadowRelationName);
pg_dsc = RelationGetTupleDescriptor(pg_shadow_rel);
pg_dsc = RelationGetDescr(pg_shadow_rel);
/*
* Secure a write lock on pg_shadow so we can be sure that when the
@@ -390,7 +390,7 @@ RemoveUser(char *user)
* owned by usesysid. Then drop them.
*/
pg_rel = heap_openr(DatabaseRelationName);
pg_dsc = RelationGetTupleDescriptor(pg_rel);
pg_dsc = RelationGetDescr(pg_rel);
scan = heap_beginscan(pg_rel, false, SnapshotNow, 0, NULL);
while (HeapTupleIsValid(tuple = heap_getnext(scan, 0)))

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.78 1998/08/28 04:57:21 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.79 1998/09/01 03:22:08 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -87,7 +87,7 @@ static void vc_vacpage(Page page, VPageDescr vpd);
static void vc_vaconeind(VPageList vpl, Relation indrel, int num_tuples);
static void vc_scanoneind(Relation indrel, int num_tuples);
static void vc_attrstats(Relation onerel, VRelStats *vacrelstats, HeapTuple tuple);
static void vc_bucketcpy(AttributeTupleForm attr, Datum value, Datum *bucket, int16 *bucket_len);
static void vc_bucketcpy(Form_pg_attribute attr, Datum value, Datum *bucket, int16 *bucket_len);
static void vc_updstats(Oid relid, int num_pages, int num_tuples, bool hasindex, VRelStats *vacrelstats);
static void vc_delhilowstats(Oid relid, int attcnt, int *attnums);
static void vc_setpagelock(Relation rel, BlockNumber blkno);
@@ -295,7 +295,7 @@ vc_getrels(NameData *VacRelP)
vrl = cur = (VRelList) NULL;
rel = heap_openr(RelationRelationName);
tupdesc = RelationGetTupleDescriptor(rel);
tupdesc = RelationGetDescr(rel);
scan = heap_beginscan(rel, false, SnapshotNow, 1, &key);
@@ -354,7 +354,7 @@ vc_getrels(NameData *VacRelP)
CommitTransactionCommand();
return (vrl);
return vrl;
}
/*
@@ -390,7 +390,7 @@ vc_vacone(Oid relid, bool analyze, List *va_cols)
StartTransactionCommand();
rel = heap_openr(RelationRelationName);
tupdesc = RelationGetTupleDescriptor(rel);
tupdesc = RelationGetDescr(rel);
/*
* Race condition -- if the pg_class tuple has gone away since the
@@ -417,7 +417,7 @@ vc_vacone(Oid relid, bool analyze, List *va_cols)
{
int attr_cnt,
*attnums = NULL;
AttributeTupleForm *attr;
Form_pg_attribute *attr;
attr_cnt = onerel->rd_att->natts;
attr = onerel->rd_att->attrs;
@@ -457,7 +457,7 @@ vc_vacone(Oid relid, bool analyze, List *va_cols)
for (i = 0; i < attr_cnt; i++)
{
Operator func_operator;
OperatorTupleForm pgopform;
Form_pg_operator pgopform;
VacAttrStats *stats;
stats = &vacrelstats->vacattrstats[i];
@@ -474,7 +474,7 @@ vc_vacone(Oid relid, bool analyze, List *va_cols)
func_operator = oper("=", stats->attr->atttypid, stats->attr->atttypid, true);
if (func_operator != NULL)
{
pgopform = (OperatorTupleForm) GETSTRUCT(func_operator);
pgopform = (Form_pg_operator) GETSTRUCT(func_operator);
fmgr_info(pgopform->oprcode, &(stats->f_cmpeq));
}
else
@@ -483,7 +483,7 @@ vc_vacone(Oid relid, bool analyze, List *va_cols)
func_operator = oper("<", stats->attr->atttypid, stats->attr->atttypid, true);
if (func_operator != NULL)
{
pgopform = (OperatorTupleForm) GETSTRUCT(func_operator);
pgopform = (Form_pg_operator) GETSTRUCT(func_operator);
fmgr_info(pgopform->oprcode, &(stats->f_cmplt));
}
else
@@ -492,7 +492,7 @@ vc_vacone(Oid relid, bool analyze, List *va_cols)
func_operator = oper(">", stats->attr->atttypid, stats->attr->atttypid, true);
if (func_operator != NULL)
{
pgopform = (OperatorTupleForm) GETSTRUCT(func_operator);
pgopform = (Form_pg_operator) GETSTRUCT(func_operator);
fmgr_info(pgopform->oprcode, &(stats->f_cmpgt));
}
else
@@ -502,7 +502,7 @@ vc_vacone(Oid relid, bool analyze, List *va_cols)
ObjectIdGetDatum(stats->attr->atttypid),
0, 0, 0);
if (HeapTupleIsValid(typetuple))
stats->outfunc = ((TypeTupleForm) GETSTRUCT(typetuple))->typoutput;
stats->outfunc = ((Form_pg_type) GETSTRUCT(typetuple))->typoutput;
else
stats->outfunc = InvalidOid;
}
@@ -975,7 +975,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
if (Irel != (Relation *) NULL) /* preparation for index' inserts */
{
vc_mkindesc(onerel, nindices, Irel, &Idesc);
tupdesc = RelationGetTupleDescriptor(onerel);
tupdesc = RelationGetDescr(onerel);
idatum = (Datum *) palloc(INDEX_MAX_KEYS * sizeof(*idatum));
inulls = (char *) palloc(INDEX_MAX_KEYS * sizeof(*inulls));
}
@@ -1559,14 +1559,14 @@ vc_tidreapped(ItemPointer itemptr, VPageList vpl)
vc_cmp_blk);
if (vpp == (VPageDescr *) NULL)
return ((VPageDescr) NULL);
return (VPageDescr) NULL;
vp = *vpp;
/* ok - we are on true page */
if (vp->vpd_offsets_free == 0)
{ /* this is EmptyPage !!! */
return (vp);
return vp;
}
voff = (OffsetNumber *) vc_find_eq((char *) (vp->vpd_offsets),
@@ -1574,9 +1574,9 @@ vc_tidreapped(ItemPointer itemptr, VPageList vpl)
vc_cmp_offno);
if (voff == (OffsetNumber *) NULL)
return ((VPageDescr) NULL);
return (VPageDescr) NULL;
return (vp);
return vp;
} /* vc_tidreapped */
@@ -1702,7 +1702,7 @@ vc_attrstats(Relation onerel, VRelStats *vacrelstats, HeapTuple tuple)
*
*/
static void
vc_bucketcpy(AttributeTupleForm attr, Datum value, Datum *bucket, int16 *bucket_len)
vc_bucketcpy(Form_pg_attribute attr, Datum value, Datum *bucket, int16 *bucket_len)
{
if (attr->attbyval && attr->attlen != -1)
*bucket = value;
@@ -1744,7 +1744,7 @@ vc_updstats(Oid relid, int num_pages, int num_tuples, bool hasindex, VRelStats *
stup;
Form_pg_class pgcform;
ScanKeyData askey;
AttributeTupleForm attp;
Form_pg_attribute attp;
Buffer buffer;
/*
@@ -1790,7 +1790,7 @@ vc_updstats(Oid relid, int num_pages, int num_tuples, bool hasindex, VRelStats *
Datum values[Natts_pg_statistic];
char nulls[Natts_pg_statistic];
attp = (AttributeTupleForm) GETSTRUCT(atup);
attp = (Form_pg_attribute) GETSTRUCT(atup);
if (attp->attnum <= 0) /* skip system attributes for now, */
/* they are unique anyway */
continue;
@@ -2040,27 +2040,27 @@ vc_find_eq(char *bot, int nelem, int size, char *elm, int (*compar) (char *, cha
{
res = compar(bot, elm);
if (res > 0)
return (NULL);
return NULL;
if (res == 0)
return (bot);
return bot;
first_move = false;
}
if (last_move == true)
{
res = compar(elm, bot + last * size);
if (res > 0)
return (NULL);
return NULL;
if (res == 0)
return (bot + last * size);
return bot + last * size;
last_move = false;
}
res = compar(elm, bot + celm * size);
if (res == 0)
return (bot + celm * size);
return bot + celm * size;
if (res < 0)
{
if (celm == 0)
return (NULL);
return NULL;
last = celm - 1;
celm = celm / 2;
last_move = true;
@@ -2068,7 +2068,7 @@ vc_find_eq(char *bot, int nelem, int size, char *elm, int (*compar) (char *, cha
}
if (celm == last)
return (NULL);
return NULL;
last = last - celm - 1;
bot = bot + (celm + 1) * size;
@@ -2088,10 +2088,10 @@ vc_cmp_blk(char *left, char *right)
rblk = (*((VPageDescr *) right))->vpd_blkno;
if (lblk < rblk)
return (-1);
return -1;
if (lblk == rblk)
return (0);
return (1);
return 0;
return 1;
} /* vc_cmp_blk */
@@ -2100,10 +2100,10 @@ vc_cmp_offno(char *left, char *right)
{
if (*(OffsetNumber *) left < *(OffsetNumber *) right)
return (-1);
return -1;
if (*(OffsetNumber *) left == *(OffsetNumber *) right)
return (0);
return (1);
return 0;
return 1;
} /* vc_cmp_offno */
@@ -2129,7 +2129,7 @@ vc_getindices(Oid relid, int *nindices, Relation **Irel)
/* prepare a heap scan on the pg_index relation */
pgindex = heap_openr(IndexRelationName);
tupdesc = RelationGetTupleDescriptor(pgindex);
tupdesc = RelationGetDescr(pgindex);
ScanKeyEntryInitialize(&key, 0x0, Anum_pg_index_indrelid,
F_OIDEQ,
@@ -2217,7 +2217,7 @@ vc_mkindesc(Relation onerel, int nindices, Relation *Irel, IndDesc **Idesc)
0, 0, 0);
Assert(cachetuple);
/* we never free the copy we make, because Idesc needs it for later */
idcur->tform = (IndexTupleForm) GETSTRUCT(cachetuple);
idcur->tform = (Form_pg_index) GETSTRUCT(cachetuple);
for (attnumP = &(idcur->tform->indkey[0]), natts = 0;
*attnumP != InvalidAttrNumber && natts != INDEX_MAX_KEYS;
attnumP++, natts++);
@@ -2245,15 +2245,15 @@ vc_enough_space(VPageDescr vpd, Size len)
len = DOUBLEALIGN(len);
if (len > vpd->vpd_free)
return (false);
return false;
if (vpd->vpd_offsets_used < vpd->vpd_offsets_free) /* there are free itemid(s) */
return (true); /* and len <= free_space */
return true; /* and len <= free_space */
/* ok. noff_usd >= noff_free and so we'll have to allocate new itemid */
if (len <= vpd->vpd_free - sizeof(ItemIdData))
return (true);
return true;
return (false);
return false;
} /* vc_enough_space */

View File

@@ -2,7 +2,7 @@
* Routines for handling of 'SET var TO',
* 'SHOW var' and 'RESET var' statements.
*
* $Id: variable.c,v 1.10 1998/07/26 04:30:26 scrappy Exp $
* $Id: variable.c,v 1.11 1998/09/01 03:22:10 momjian Exp $
*
*/
@@ -73,13 +73,13 @@ get_token(char **tok, char **val, const char *str)
/* end of string? */
if (!(*str))
{
return (str);
return str;
/* delimiter? */
}
else if (*str == ',')
{
return (++str);
return ++str;
}
else if ((val == NULL) || (*str != '='))
@@ -117,9 +117,9 @@ get_token(char **tok, char **val, const char *str)
str++;
if (!(*str))
return (NULL);
return NULL;
if (*str == ',')
return (++str);
return ++str;
elog(ERROR, "Syntax error near (%s)", str);