Commit 0686d49d authored by Bruce Momjian's avatar Bruce Momjian

Remove dashes in comments that don't need them, rewrap with pgindent.

parent 9e155260
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
* pg_dumplo * pg_dumplo
* *
* $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/lo_export.c,v 1.6 2001/03/22 03:59:10 momjian Exp $ * $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/lo_export.c,v 1.7 2001/03/22 06:16:06 momjian Exp $
* *
* Karel Zak 1999-2000 * Karel Zak 1999-2000
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
...@@ -32,7 +32,7 @@ load_lolist(LODumpMaster * pgLO) ...@@ -32,7 +32,7 @@ load_lolist(LODumpMaster * pgLO)
int i; int i;
int n; int n;
/* ---------- /*
* Now find any candidate tables who have columns of type oid. * Now find any candidate tables who have columns of type oid.
* *
* NOTE: System tables including pg_largeobject will be ignored. * NOTE: System tables including pg_largeobject will be ignored.
...@@ -40,7 +40,6 @@ load_lolist(LODumpMaster * pgLO) ...@@ -40,7 +40,6 @@ load_lolist(LODumpMaster * pgLO)
* *
* NOTE: the system oid column is ignored, as it has attnum < 1. * NOTE: the system oid column is ignored, as it has attnum < 1.
* This shouldn't matter for correctness, but it saves time. * This shouldn't matter for correctness, but it saves time.
* ----------
*/ */
pgLO->res = PQexec(pgLO->conn, pgLO->res = PQexec(pgLO->conn,
"SELECT c.relname, a.attname " "SELECT c.relname, a.attname "
...@@ -109,9 +108,8 @@ pglo_export(LODumpMaster * pgLO) ...@@ -109,9 +108,8 @@ pglo_export(LODumpMaster * pgLO)
for (ll = pgLO->lolist; ll->lo_table != NULL; ll++) for (ll = pgLO->lolist; ll->lo_table != NULL; ll++)
{ {
/* ---------- /*
* Query: find the LOs referenced by this column * Query: find the LOs referenced by this column
* ----------
*/ */
sprintf(Qbuff, "SELECT DISTINCT l.loid FROM \"%s\" x, pg_largeobject l WHERE x.\"%s\" = l.loid", sprintf(Qbuff, "SELECT DISTINCT l.loid FROM \"%s\" x, pg_largeobject l WHERE x.\"%s\" = l.loid",
ll->lo_table, ll->lo_attr); ll->lo_table, ll->lo_attr);
...@@ -137,9 +135,8 @@ pglo_export(LODumpMaster * pgLO) ...@@ -137,9 +135,8 @@ pglo_export(LODumpMaster * pgLO)
int t; int t;
char *val; char *val;
/* ---------- /*
* Create DIR/FILE * Create DIR/FILE
* ----------
*/ */
if (pgLO->action != ACTION_SHOW) if (pgLO->action != ACTION_SHOW)
{ {
......
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
* pg_dumplo * pg_dumplo
* *
* $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/lo_import.c,v 1.4 2001/03/22 03:59:10 momjian Exp $ * $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/lo_import.c,v 1.5 2001/03/22 06:16:06 momjian Exp $
* *
* Karel Zak 1999-2000 * Karel Zak 1999-2000
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
...@@ -50,9 +50,8 @@ pglo_import(LODumpMaster * pgLO) ...@@ -50,9 +50,8 @@ pglo_import(LODumpMaster * pgLO)
sprintf(lo_path, "%s/%s", pgLO->space, path); sprintf(lo_path, "%s/%s", pgLO->space, path);
/* ---------- /*
* Import LO * Import LO
* ----------
*/ */
if ((new_oid = lo_import(pgLO->conn, lo_path)) == 0) if ((new_oid = lo_import(pgLO->conn, lo_path)) == 0)
{ {
...@@ -79,9 +78,8 @@ pglo_import(LODumpMaster * pgLO) ...@@ -79,9 +78,8 @@ pglo_import(LODumpMaster * pgLO)
pgLO->counter++; pgLO->counter++;
/* ---------- /*
* UPDATE oid in tab * UPDATE oid in tab
* ----------
*/ */
sprintf(Qbuff, "UPDATE \"%s\" SET \"%s\"=%u WHERE \"%s\"=%u", sprintf(Qbuff, "UPDATE \"%s\" SET \"%s\"=%u WHERE \"%s\"=%u",
loa.lo_table, loa.lo_attr, new_oid, loa.lo_attr, loa.lo_oid); loa.lo_table, loa.lo_attr, new_oid, loa.lo_attr, loa.lo_oid);
......
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
* pg_dumplo * pg_dumplo
* *
* $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/main.c,v 1.7 2001/03/22 03:59:10 momjian Exp $ * $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/main.c,v 1.8 2001/03/22 06:16:06 momjian Exp $
* *
* Karel Zak 1999-2000 * Karel Zak 1999-2000
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
...@@ -65,9 +65,8 @@ main(int argc, char **argv) ...@@ -65,9 +65,8 @@ main(int argc, char **argv)
progname = argv[0]; progname = argv[0];
/* ---------- /*
* Parse ARGV * Parse ARGV
* ----------
*/ */
if (argc > 1) if (argc > 1)
{ {
...@@ -153,9 +152,8 @@ main(int argc, char **argv) ...@@ -153,9 +152,8 @@ main(int argc, char **argv)
exit(RE_ERROR); exit(RE_ERROR);
} }
/* ---------- /*
* Check space * Check space
* ----------
*/ */
if (!pgLO->space && !pgLO->action == ACTION_SHOW) if (!pgLO->space && !pgLO->action == ACTION_SHOW)
{ {
...@@ -172,9 +170,8 @@ main(int argc, char **argv) ...@@ -172,9 +170,8 @@ main(int argc, char **argv)
exit(RE_ERROR); exit(RE_ERROR);
} }
/* ---------- /*
* Make connection * Make connection
* ----------
*/ */
pgLO->conn = PQsetdbLogin(pgLO->host, NULL, NULL, NULL, pgLO->db, pgLO->conn = PQsetdbLogin(pgLO->host, NULL, NULL, NULL, pgLO->db,
pgLO->user, pwd); pgLO->user, pwd);
...@@ -189,9 +186,8 @@ main(int argc, char **argv) ...@@ -189,9 +186,8 @@ main(int argc, char **argv)
pgLO->user = PQuser(pgLO->conn); pgLO->user = PQuser(pgLO->conn);
/* ---------- /*
* Init index file * Init index file
* ----------
*/ */
if (pgLO->action != ACTION_SHOW) if (pgLO->action != ACTION_SHOW)
index_file(pgLO); index_file(pgLO);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.70 2001/03/22 03:59:11 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.71 2001/03/22 06:16:06 momjian Exp $
* *
* NOTES * NOTES
* The old interface functions have been converted to macros * The old interface functions have been converted to macros
...@@ -246,9 +246,8 @@ nocachegetattr(HeapTuple tuple, ...@@ -246,9 +246,8 @@ nocachegetattr(HeapTuple tuple,
* there's a null somewhere in the tuple * there's a null somewhere in the tuple
*/ */
/* ---------------- /*
* check to see if desired att is null * check to see if desired att is null
* ----------------
*/ */
#ifdef IN_MACRO #ifdef IN_MACRO
...@@ -261,9 +260,8 @@ nocachegetattr(HeapTuple tuple, ...@@ -261,9 +260,8 @@ nocachegetattr(HeapTuple tuple,
} }
#endif #endif
/* ---------------- /*
* Now check to see if any preceding bits are null... * Now check to see if any preceding bits are null...
* ----------------
*/ */
{ {
int byte = attnum >> 3; int byte = attnum >> 3;
...@@ -658,9 +656,8 @@ heap_modifytuple(HeapTuple tuple, ...@@ -658,9 +656,8 @@ heap_modifytuple(HeapTuple tuple,
HeapTuple newTuple; HeapTuple newTuple;
uint8 infomask; uint8 infomask;
/* ---------------- /*
* sanity checks * sanity checks
* ----------------
*/ */
Assert(HeapTupleIsValid(tuple)); Assert(HeapTupleIsValid(tuple));
Assert(RelationIsValid(relation)); Assert(RelationIsValid(relation));
...@@ -670,10 +667,9 @@ heap_modifytuple(HeapTuple tuple, ...@@ -670,10 +667,9 @@ heap_modifytuple(HeapTuple tuple,
numberOfAttributes = RelationGetForm(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 tuple or the repl information, as appropriate. * the repl information, as appropriate.
* ----------------
*/ */
value = (Datum *) palloc(numberOfAttributes * sizeof *value); value = (Datum *) palloc(numberOfAttributes * sizeof *value);
nulls = (char *) palloc(numberOfAttributes * sizeof *nulls); nulls = (char *) palloc(numberOfAttributes * sizeof *nulls);
...@@ -701,17 +697,16 @@ heap_modifytuple(HeapTuple tuple, ...@@ -701,17 +697,16 @@ 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(RelationGetDescr(relation), newTuple = heap_formtuple(RelationGetDescr(relation),
value, value,
nulls); nulls);
/* ---------------- /*
* copy the header except for t_len, t_natts, t_hoff, t_bits, t_infomask * copy the header except for t_len, t_natts, t_hoff, t_bits,
* ---------------- * t_infomask
*/ */
infomask = newTuple->t_data->t_infomask; infomask = newTuple->t_data->t_infomask;
memmove((char *) &newTuple->t_data->t_oid, /* XXX */ memmove((char *) &newTuple->t_data->t_oid, /* XXX */
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.53 2001/03/22 03:59:11 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.54 2001/03/22 06:16:06 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -165,9 +165,8 @@ index_formtuple(TupleDesc tupleDescriptor, ...@@ -165,9 +165,8 @@ index_formtuple(TupleDesc tupleDescriptor,
infomask |= size; infomask |= size;
/* ---------------- /*
* initialize metadata * initialize metadata
* ----------------
*/ */
tuple->t_info = infomask; tuple->t_info = infomask;
return tuple; return tuple;
...@@ -205,9 +204,9 @@ nocache_index_getattr(IndexTuple tup, ...@@ -205,9 +204,9 @@ nocache_index_getattr(IndexTuple tup,
int data_off; /* tuple data offset */ int data_off; /* tuple data offset */
(void) isnull; /* not used */ (void) isnull; /* not used */
/* ----------------
* sanity checks /*
* ---------------- * sanity checks
*/ */
/* ---------------- /* ----------------
...@@ -246,9 +245,9 @@ nocache_index_getattr(IndexTuple tup, ...@@ -246,9 +245,9 @@ nocache_index_getattr(IndexTuple tup,
} }
else else
{ /* there's a null somewhere in the tuple */ { /* there's a null somewhere in the tuple */
/* ----------------
* check to see if desired att is null /*
* ---------------- * check to see if desired att is null
*/ */
/* XXX "knows" t_bits are just after fixed tuple header! */ /* XXX "knows" t_bits are just after fixed tuple header! */
...@@ -264,9 +263,8 @@ nocache_index_getattr(IndexTuple tup, ...@@ -264,9 +263,8 @@ nocache_index_getattr(IndexTuple tup,
} }
#endif #endif
/* ---------------- /*
* Now check to see if any preceding bits are null... * Now check to see if any preceding bits are null...
* ----------------
*/ */
{ {
int byte = attnum >> 3; int byte = attnum >> 3;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.58 2001/03/22 03:59:11 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.59 2001/03/22 06:16:06 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -155,16 +155,14 @@ printtup(HeapTuple tuple, TupleDesc typeinfo, DestReceiver *self) ...@@ -155,16 +155,14 @@ printtup(HeapTuple tuple, TupleDesc typeinfo, DestReceiver *self)
if (myState->attrinfo != typeinfo || myState->nattrs != natts) if (myState->attrinfo != typeinfo || myState->nattrs != natts)
printtup_prepare_info(myState, typeinfo, natts); printtup_prepare_info(myState, typeinfo, natts);
/* ---------------- /*
* tell the frontend to expect new tuple data (in ASCII style) * tell the frontend to expect new tuple data (in ASCII style)
* ----------------
*/ */
pq_beginmessage(&buf); pq_beginmessage(&buf);
pq_sendbyte(&buf, 'D'); pq_sendbyte(&buf, 'D');
/* ---------------- /*
* send a bitmap of which attributes are not null * send a bitmap of which attributes are not null
* ----------------
*/ */
j = 0; j = 0;
k = 1 << 7; k = 1 << 7;
...@@ -183,9 +181,8 @@ printtup(HeapTuple tuple, TupleDesc typeinfo, DestReceiver *self) ...@@ -183,9 +181,8 @@ printtup(HeapTuple tuple, TupleDesc typeinfo, DestReceiver *self)
if (k != (1 << 7)) /* flush last partial byte */ if (k != (1 << 7)) /* flush last partial byte */
pq_sendint(&buf, j, 1); pq_sendint(&buf, j, 1);
/* ---------------- /*
* send the attributes of this tuple * send the attributes of this tuple
* ----------------
*/ */
for (i = 0; i < natts; ++i) for (i = 0; i < natts; ++i)
{ {
...@@ -357,16 +354,14 @@ printtup_internal(HeapTuple tuple, TupleDesc typeinfo, DestReceiver *self) ...@@ -357,16 +354,14 @@ printtup_internal(HeapTuple tuple, TupleDesc typeinfo, DestReceiver *self)
if (myState->attrinfo != typeinfo || myState->nattrs != natts) if (myState->attrinfo != typeinfo || myState->nattrs != natts)
printtup_prepare_info(myState, typeinfo, natts); printtup_prepare_info(myState, typeinfo, natts);
/* ---------------- /*
* tell the frontend to expect new tuple data (in binary style) * tell the frontend to expect new tuple data (in binary style)
* ----------------
*/ */
pq_beginmessage(&buf); pq_beginmessage(&buf);
pq_sendbyte(&buf, 'B'); pq_sendbyte(&buf, 'B');
/* ---------------- /*
* send a bitmap of which attributes are not null * send a bitmap of which attributes are not null
* ----------------
*/ */
j = 0; j = 0;
k = 1 << 7; k = 1 << 7;
...@@ -385,9 +380,8 @@ printtup_internal(HeapTuple tuple, TupleDesc typeinfo, DestReceiver *self) ...@@ -385,9 +380,8 @@ printtup_internal(HeapTuple tuple, TupleDesc typeinfo, DestReceiver *self)
if (k != (1 << 7)) /* flush last partial byte */ if (k != (1 << 7)) /* flush last partial byte */
pq_sendint(&buf, j, 1); pq_sendint(&buf, j, 1);
/* ---------------- /*
* send the attributes of this tuple * send the attributes of this tuple
* ----------------
*/ */
#ifdef IPORTAL_DEBUG #ifdef IPORTAL_DEBUG
fprintf(stderr, "sending tuple with %d atts\n", natts); fprintf(stderr, "sending tuple with %d atts\n", natts);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.72 2001/03/22 03:59:11 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.73 2001/03/22 06:16:06 momjian Exp $
* *
* NOTES * NOTES
* some of the executor utility code such as "ExecTypeFromTL" should be * some of the executor utility code such as "ExecTypeFromTL" should be
...@@ -37,17 +37,15 @@ CreateTemplateTupleDesc(int natts) ...@@ -37,17 +37,15 @@ CreateTemplateTupleDesc(int natts)
uint32 size; uint32 size;
TupleDesc desc; TupleDesc desc;
/* ---------------- /*
* sanity checks * sanity checks
* ----------------
*/ */
AssertArg(natts >= 1); AssertArg(natts >= 1);
/* ---------------- /*
* allocate enough memory for the tuple descriptor and * allocate enough memory for the tuple descriptor and zero it as
* zero it as TupleDescInitEntry assumes that the descriptor * TupleDescInitEntry assumes that the descriptor is filled with NULL
* is filled with NULL pointers. * pointers.
* ----------------
*/ */
size = natts * sizeof(Form_pg_attribute); size = natts * sizeof(Form_pg_attribute);
desc = (TupleDesc) palloc(sizeof(struct tupleDesc)); desc = (TupleDesc) palloc(sizeof(struct tupleDesc));
...@@ -71,9 +69,8 @@ CreateTupleDesc(int natts, Form_pg_attribute *attrs) ...@@ -71,9 +69,8 @@ CreateTupleDesc(int natts, Form_pg_attribute *attrs)
{ {
TupleDesc desc; TupleDesc desc;
/* ---------------- /*
* sanity checks * sanity checks
* ----------------
*/ */
AssertArg(natts >= 1); AssertArg(natts >= 1);
...@@ -337,9 +334,8 @@ TupleDescInitEntry(TupleDesc desc, ...@@ -337,9 +334,8 @@ TupleDescInitEntry(TupleDesc desc,
Form_pg_type typeForm; Form_pg_type typeForm;
Form_pg_attribute att; Form_pg_attribute att;
/* ---------------- /*
* sanity checks * sanity checks
* ----------------
*/ */
AssertArg(PointerIsValid(desc)); AssertArg(PointerIsValid(desc));
AssertArg(attributeNumber >= 1); AssertArg(attributeNumber >= 1);
...@@ -352,17 +348,15 @@ TupleDescInitEntry(TupleDesc desc, ...@@ -352,17 +348,15 @@ TupleDescInitEntry(TupleDesc desc,
AssertArg(!PointerIsValid(desc->attrs[attributeNumber - 1])); AssertArg(!PointerIsValid(desc->attrs[attributeNumber - 1]));
/* ---------------- /*
* allocate storage for this attribute * allocate storage for this attribute
* ----------------
*/ */
att = (Form_pg_attribute) palloc(ATTRIBUTE_TUPLE_SIZE); att = (Form_pg_attribute) palloc(ATTRIBUTE_TUPLE_SIZE);
desc->attrs[attributeNumber - 1] = att; desc->attrs[attributeNumber - 1] = att;
/* ---------------- /*
* initialize the attribute fields * initialize the attribute fields
* ----------------
*/ */
att->attrelid = 0; /* dummy value */ att->attrelid = 0; /* dummy value */
...@@ -404,10 +398,10 @@ TupleDescInitEntry(TupleDesc desc, ...@@ -404,10 +398,10 @@ TupleDescInitEntry(TupleDesc desc,
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(tuple)) if (!HeapTupleIsValid(tuple))
{ {
/* ----------------
* here type info does not exist yet so we just fill /*
* the attribute with dummy information and return false. * here type info does not exist yet so we just fill the attribute
* ---------------- * with dummy information and return false.
*/ */
att->atttypid = InvalidOid; att->atttypid = InvalidOid;
att->attlen = (int16) 0; att->attlen = (int16) 0;
...@@ -417,32 +411,30 @@ TupleDescInitEntry(TupleDesc desc, ...@@ -417,32 +411,30 @@ TupleDescInitEntry(TupleDesc desc,
return false; return false;
} }
/* ---------------- /*
* type info exists so we initialize our attribute * type info exists so we initialize our attribute information from
* information from the type tuple we found.. * the type tuple we found..
* ----------------
*/ */
typeForm = (Form_pg_type) GETSTRUCT(tuple); typeForm = (Form_pg_type) GETSTRUCT(tuple);
att->atttypid = tuple->t_data->t_oid; att->atttypid = tuple->t_data->t_oid;
/*------------------------ /*
* There are a couple of cases where we must override the information * There are a couple of cases where we must override the information
* stored in pg_type. * stored in pg_type.
* *
* First: if this attribute is a set, what is really stored in the * First: if this attribute is a set, what is really stored in the
* attribute is the OID of a tuple in the pg_proc catalog. * attribute is the OID of a tuple in the pg_proc catalog. The pg_proc
* The pg_proc tuple contains the query string which defines * tuple contains the query string which defines this set - i.e., the
* this set - i.e., the query to run to get the set. * query to run to get the set. So the atttypid (just assigned above)
* So the atttypid (just assigned above) refers to the type returned * refers to the type returned by this query, but the actual length of
* by this query, but the actual length of this attribute is the * this attribute is the length (size) of an OID.
* length (size) of an OID.
* *
* (Why not just make the atttypid point to the OID type, instead * (Why not just make the atttypid point to the OID type, instead of the
* of the type the query returns? Because the executor uses the atttypid * type the query returns? Because the executor uses the atttypid to
* to tell the front end what type will be returned (in BeginCommand), * tell the front end what type will be returned (in BeginCommand),
* and in the end the type returned will be the result of the query, not * and in the end the type returned will be the result of the query,
* an OID.) * not an OID.)
* *
* (Why not wait until the return type of the set is known (i.e., the * (Why not wait until the return type of the set is known (i.e., the
* recursive call to the executor to execute the set has returned) * recursive call to the executor to execute the set has returned)
...@@ -460,7 +452,6 @@ TupleDescInitEntry(TupleDesc desc, ...@@ -460,7 +452,6 @@ TupleDescInitEntry(TupleDesc desc,
* *
* A set of complex type is first and foremost a set, so its * A set of complex type is first and foremost a set, so its
* representation is Oid not pointer. So, test that case first. * representation is Oid not pointer. So, test that case first.
*-----------------------------------------
*/ */
if (attisset) if (attisset)
{ {
...@@ -550,9 +541,8 @@ BuildDescForRelation(List *schema, char *relname) ...@@ -550,9 +541,8 @@ BuildDescForRelation(List *schema, char *relname)
int ndef = 0; int ndef = 0;
bool attisset; bool attisset;
/* ---------------- /*
* allocate a new tuple descriptor * allocate a new tuple descriptor
* ----------------
*/ */
natts = length(schema); natts = length(schema);
desc = CreateTemplateTupleDesc(natts); desc = CreateTemplateTupleDesc(natts);
...@@ -565,11 +555,10 @@ BuildDescForRelation(List *schema, char *relname) ...@@ -565,11 +555,10 @@ BuildDescForRelation(List *schema, char *relname)
ColumnDef *entry = lfirst(p); ColumnDef *entry = lfirst(p);
List *arry; List *arry;
/* ---------------- /*
* for each entry in the list, get the name and type * for each entry in the list, get the name and type information
* information from the list and have TupleDescInitEntry * from the list and have TupleDescInitEntry fill in the attribute
* fill in the attribute information we need. * information we need.
* ----------------
*/ */
attnum++; attnum++;
...@@ -595,12 +584,12 @@ BuildDescForRelation(List *schema, char *relname) ...@@ -595,12 +584,12 @@ BuildDescForRelation(List *schema, char *relname)
typenameTypeId(typename), typenameTypeId(typename),
atttypmod, attdim, attisset)) atttypmod, attdim, attisset))
{ {
/* ----------------
* if TupleDescInitEntry() fails, it means there is /*
* no type in the system catalogs. So now we check if * if TupleDescInitEntry() fails, it means there is no type in
* the type name equals the relation name. If so we * the system catalogs. So now we check if the type name
* have a self reference, otherwise it's an error. * equals the relation name. If so we have a self reference,
* ---------------- * otherwise it's an error.
*/ */
if (strcmp(typename, relname) == 0) if (strcmp(typename, relname) == 0)
TupleDescMakeSelfReference(desc, attnum, relname); TupleDescMakeSelfReference(desc, attnum, relname);
......
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Id: hio.c,v 1.36 2001/03/22 03:59:13 momjian Exp $ * $Id: hio.c,v 1.37 2001/03/22 06:16:07 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -37,9 +37,8 @@ RelationPutHeapTuple(Relation relation, ...@@ -37,9 +37,8 @@ RelationPutHeapTuple(Relation relation,
ItemId itemId; ItemId itemId;
Item item; Item item;
/* ---------------- /*
* increment access statistics * increment access statistics
* ----------------
*/ */
IncrHeapAccessStat(local_RelationPutHeapTuple); IncrHeapAccessStat(local_RelationPutHeapTuple);
IncrHeapAccessStat(global_RelationPutHeapTuple); IncrHeapAccessStat(global_RelationPutHeapTuple);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/heap/Attic/stats.c,v 1.23 2001/01/24 19:42:48 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/heap/Attic/stats.c,v 1.24 2001/03/22 06:16:07 momjian Exp $
* *
* NOTES * NOTES
* initam should be moved someplace else. * initam should be moved someplace else.
...@@ -37,25 +37,22 @@ InitHeapAccessStatistics() ...@@ -37,25 +37,22 @@ InitHeapAccessStatistics()
MemoryContext oldContext; MemoryContext oldContext;
HeapAccessStatistics stats; HeapAccessStatistics stats;
/* ---------------- /*
* make sure we don't initialize things twice * make sure we don't initialize things twice
* ----------------
*/ */
if (heap_access_stats != NULL) if (heap_access_stats != NULL)
return; return;
/* ---------------- /*
* allocate statistics structure from the top memory context * allocate statistics structure from the top memory context
* ----------------
*/ */
oldContext = MemoryContextSwitchTo(TopMemoryContext); oldContext = MemoryContextSwitchTo(TopMemoryContext);
stats = (HeapAccessStatistics) stats = (HeapAccessStatistics)
palloc(sizeof(HeapAccessStatisticsData)); palloc(sizeof(HeapAccessStatisticsData));
/* ---------------- /*
* initialize fields to default values * initialize fields to default values
* ----------------
*/ */
stats->global_open = 0; stats->global_open = 0;
stats->global_openr = 0; stats->global_openr = 0;
...@@ -103,17 +100,15 @@ InitHeapAccessStatistics() ...@@ -103,17 +100,15 @@ InitHeapAccessStatistics()
stats->local_RelationNameGetRelation = 0; stats->local_RelationNameGetRelation = 0;
stats->global_RelationNameGetRelation = 0; stats->global_RelationNameGetRelation = 0;
/* ---------------- /*
* record init times * record init times
* ----------------
*/ */
time(&stats->init_global_timestamp); time(&stats->init_global_timestamp);
time(&stats->local_reset_timestamp); time(&stats->local_reset_timestamp);
time(&stats->last_request_timestamp); time(&stats->last_request_timestamp);
/* ---------------- /*
* return to old memory context * return to old memory context
* ----------------
*/ */
MemoryContextSwitchTo(oldContext); MemoryContextSwitchTo(oldContext);
...@@ -130,18 +125,16 @@ ResetHeapAccessStatistics() ...@@ -130,18 +125,16 @@ ResetHeapAccessStatistics()
{ {
HeapAccessStatistics stats; HeapAccessStatistics stats;
/* ---------------- /*
* do nothing if stats aren't initialized * do nothing if stats aren't initialized
* ----------------
*/ */
if (heap_access_stats == NULL) if (heap_access_stats == NULL)
return; return;
stats = heap_access_stats; stats = heap_access_stats;
/* ---------------- /*
* reset local counts * reset local counts
* ----------------
*/ */
stats->local_open = 0; stats->local_open = 0;
stats->local_openr = 0; stats->local_openr = 0;
...@@ -165,9 +158,8 @@ ResetHeapAccessStatistics() ...@@ -165,9 +158,8 @@ ResetHeapAccessStatistics()
stats->local_RelationPutHeapTuple = 0; stats->local_RelationPutHeapTuple = 0;
stats->local_RelationPutLongHeapTuple = 0; stats->local_RelationPutLongHeapTuple = 0;
/* ---------------- /*
* reset local timestamps * reset local timestamps
* ----------------
*/ */
time(&stats->local_reset_timestamp); time(&stats->local_reset_timestamp);
time(&stats->last_request_timestamp); time(&stats->last_request_timestamp);
...@@ -185,22 +177,19 @@ GetHeapAccessStatistics() ...@@ -185,22 +177,19 @@ GetHeapAccessStatistics()
{ {
HeapAccessStatistics stats; HeapAccessStatistics stats;
/* ---------------- /*
* return nothing if stats aren't initialized * return nothing if stats aren't initialized
* ----------------
*/ */
if (heap_access_stats == NULL) if (heap_access_stats == NULL)
return NULL; return NULL;
/* ---------------- /*
* record the current request time * record the current request time
* ----------------
*/ */
time(&heap_access_stats->last_request_timestamp); time(&heap_access_stats->last_request_timestamp);
/* ---------------- /*
* allocate a copy of the stats and return it to the caller. * allocate a copy of the stats and return it to the caller.
* ----------------
*/ */
stats = (HeapAccessStatistics) stats = (HeapAccessStatistics)
palloc(sizeof(HeapAccessStatisticsData)); palloc(sizeof(HeapAccessStatisticsData));
...@@ -222,9 +211,9 @@ GetHeapAccessStatistics() ...@@ -222,9 +211,9 @@ GetHeapAccessStatistics()
void void
PrintHeapAccessStatistics(HeapAccessStatistics stats) PrintHeapAccessStatistics(HeapAccessStatistics stats)
{ {
/* ----------------
* return nothing if stats aren't valid /*
* ---------------- * return nothing if stats aren't valid
*/ */
if (stats == NULL) if (stats == NULL)
return; return;
...@@ -342,9 +331,9 @@ PrintAndFreeHeapAccessStatistics(HeapAccessStatistics stats) ...@@ -342,9 +331,9 @@ PrintAndFreeHeapAccessStatistics(HeapAccessStatistics stats)
void void
initam(void) initam(void)
{ {
/* ----------------
* initialize heap statistics. /*
* ---------------- * initialize heap statistics.
*/ */
InitHeapAccessStatistics(); InitHeapAccessStatistics();
} }
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.47 2001/01/24 19:42:48 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.48 2001/03/22 06:16:07 momjian Exp $
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
* index_open - open an index relation by relationId * index_open - open an index relation by relationId
...@@ -190,9 +190,8 @@ index_insert(Relation relation, ...@@ -190,9 +190,8 @@ index_insert(Relation relation,
RELATION_CHECKS; RELATION_CHECKS;
GET_REL_PROCEDURE(insert, aminsert); GET_REL_PROCEDURE(insert, aminsert);
/* ---------------- /*
* have the am's insert proc do all the work. * have the am's insert proc do all the work.
* ----------------
*/ */
specificResult = (InsertIndexResult) specificResult = (InsertIndexResult)
DatumGetPointer(OidFunctionCall5(procedure, DatumGetPointer(OidFunctionCall5(procedure,
...@@ -241,13 +240,12 @@ index_beginscan(Relation relation, ...@@ -241,13 +240,12 @@ index_beginscan(Relation relation,
RelationIncrementReferenceCount(relation); RelationIncrementReferenceCount(relation);
/* ---------------- /*
* Acquire AccessShareLock for the duration of the scan * Acquire AccessShareLock for the duration of the scan
* *
* Note: we could get an SI inval message here and consequently have * Note: we could get an SI inval message here and consequently have to
* to rebuild the relcache entry. The refcount increment above * rebuild the relcache entry. The refcount increment above ensures
* ensures that we will rebuild it and not just flush it... * that we will rebuild it and not just flush it...
* ----------------
*/ */
LockRelation(relation, AccessShareLock); LockRelation(relation, AccessShareLock);
...@@ -347,9 +345,8 @@ index_getnext(IndexScanDesc scan, ...@@ -347,9 +345,8 @@ index_getnext(IndexScanDesc scan,
SCAN_CHECKS; SCAN_CHECKS;
/* ---------------- /*
* Look up the access procedure only once per scan. * Look up the access procedure only once per scan.
* ----------------
*/ */
if (scan->fn_getnext.fn_oid == InvalidOid) if (scan->fn_getnext.fn_oid == InvalidOid)
{ {
...@@ -359,9 +356,8 @@ index_getnext(IndexScanDesc scan, ...@@ -359,9 +356,8 @@ index_getnext(IndexScanDesc scan,
fmgr_info(procedure, &scan->fn_getnext); fmgr_info(procedure, &scan->fn_getnext);
} }
/* ---------------- /*
* have the am's gettuple proc do all the work. * have the am's gettuple proc do all the work.
* ----------------
*/ */
result = (RetrieveIndexResult) result = (RetrieveIndexResult)
DatumGetPointer(FunctionCall2(&scan->fn_getnext, DatumGetPointer(FunctionCall2(&scan->fn_getnext,
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.64 2001/03/22 03:59:15 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.65 2001/03/22 06:16:07 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -238,21 +238,19 @@ _bt_binsrch(Relation rel, ...@@ -238,21 +238,19 @@ _bt_binsrch(Relation rel,
high = mid; high = mid;
} }
/*-------------------- /*
* At this point we have high == low, but be careful: they could point * At this point we have high == low, but be careful: they could point
* past the last slot on the page. * past the last slot on the page.
* *
* On a leaf page, we always return the first key >= scan key * On a leaf page, we always return the first key >= scan key (which
* (which could be the last slot + 1). * could be the last slot + 1).
*--------------------
*/ */
if (P_ISLEAF(opaque)) if (P_ISLEAF(opaque))
return low; return low;
/*-------------------- /*
* On a non-leaf page, return the last key < scan key. * On a non-leaf page, return the last key < scan key. There must be
* There must be one if _bt_compare() is playing by the rules. * one if _bt_compare() is playing by the rules.
*--------------------
*/ */
Assert(low > P_FIRSTDATAKEY(opaque)); Assert(low > P_FIRSTDATAKEY(opaque));
...@@ -584,21 +582,20 @@ _bt_first(IndexScanDesc scan, ScanDirection dir) ...@@ -584,21 +582,20 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
ItemPointerSet(current, blkno, offnum); ItemPointerSet(current, blkno, offnum);
/*---------- /*
* At this point we are positioned at the first item >= scan key, * At this point we are positioned at the first item >= scan key, or
* or possibly at the end of a page on which all the existing items * possibly at the end of a page on which all the existing items are <
* are < scan key and we know that everything on later pages is * scan key and we know that everything on later pages is >= scan key.
* >= scan key. We could step forward in the latter case, but that'd * We could step forward in the latter case, but that'd be a waste of
* be a waste of time if we want to scan backwards. So, it's now time to * time if we want to scan backwards. So, it's now time to examine
* examine the scan strategy to find the exact place to start the scan. * the scan strategy to find the exact place to start the scan.
* *
* Note: if _bt_step fails (meaning we fell off the end of the index * Note: if _bt_step fails (meaning we fell off the end of the index in
* in one direction or the other), we either return NULL (no matches) or * one direction or the other), we either return NULL (no matches) or
* call _bt_endpoint() to set up a scan starting at that index endpoint, * call _bt_endpoint() to set up a scan starting at that index
* as appropriate for the desired scan type. * endpoint, as appropriate for the desired scan type.
* *
* it's yet other place to add some code later for is(not)null ... * it's yet other place to add some code later for is(not)null ...
*----------
*/ */
switch (strat_total) switch (strat_total)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.42 2001/03/22 03:59:17 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.43 2001/03/22 06:16:10 momjian Exp $
* *
* NOTES * NOTES
* This file contains the high level access-method interface to the * This file contains the high level access-method interface to the
...@@ -124,30 +124,25 @@ TransactionLogTest(TransactionId transactionId, /* transaction id to test */ ...@@ -124,30 +124,25 @@ TransactionLogTest(TransactionId transactionId, /* transaction id to test */
XidStatus xidstatus; /* recorded status of xid */ XidStatus xidstatus; /* recorded status of xid */
bool fail = false; /* success/failure */ bool fail = false; /* success/failure */
/* ---------------- /*
* during initialization consider all transactions * during initialization consider all transactions as having been
* as having been committed * committed
* ----------------
*/ */
if (!RelationIsValid(LogRelation)) if (!RelationIsValid(LogRelation))
return (bool) (status == XID_COMMIT); return (bool) (status == XID_COMMIT);
/* ---------------- /*
* before going to the buffer manager, check our single * before going to the buffer manager, check our single item cache to
* item cache to see if we didn't just check the transaction * see if we didn't just check the transaction status a moment ago.
* status a moment ago.
* ----------------
*/ */
if (TransactionIdEquals(transactionId, cachedTestXid)) if (TransactionIdEquals(transactionId, cachedTestXid))
return (bool) return (bool)
(status == cachedTestXidStatus); (status == cachedTestXidStatus);
/* ---------------- /*
* compute the item pointer corresponding to the * compute the item pointer corresponding to the page containing our
* page containing our transaction id. We save the item in * transaction id. We save the item in our cache to speed up things
* our cache to speed up things if we happen to ask for the * if we happen to ask for the same xid's status more than once.
* same xid's status more than once.
* ----------------
*/ */
TransComputeBlockNumber(LogRelation, transactionId, &blockNumber); TransComputeBlockNumber(LogRelation, transactionId, &blockNumber);
xidstatus = TransBlockNumberGetXidStatus(LogRelation, xidstatus = TransBlockNumberGetXidStatus(LogRelation,
...@@ -169,9 +164,8 @@ TransactionLogTest(TransactionId transactionId, /* transaction id to test */ ...@@ -169,9 +164,8 @@ TransactionLogTest(TransactionId transactionId, /* transaction id to test */
return (bool) (status == xidstatus); return (bool) (status == xidstatus);
} }
/* ---------------- /*
* here the block didn't contain the information we wanted * here the block didn't contain the information we wanted
* ----------------
*/ */
elog(ERROR, "TransactionLogTest: failed to get xidstatus"); elog(ERROR, "TransactionLogTest: failed to get xidstatus");
...@@ -192,16 +186,14 @@ TransactionLogUpdate(TransactionId transactionId, /* trans id to update */ ...@@ -192,16 +186,14 @@ TransactionLogUpdate(TransactionId transactionId, /* trans id to update */
BlockNumber blockNumber; BlockNumber blockNumber;
bool fail = false; /* success/failure */ bool fail = false; /* success/failure */
/* ---------------- /*
* during initialization we don't record any updates. * during initialization we don't record any updates.
* ----------------
*/ */
if (!RelationIsValid(LogRelation)) if (!RelationIsValid(LogRelation))
return; return;
/* ---------------- /*
* update the log relation * update the log relation
* ----------------
*/ */
TransComputeBlockNumber(LogRelation, transactionId, &blockNumber); TransComputeBlockNumber(LogRelation, transactionId, &blockNumber);
TransBlockNumberSetXidStatus(LogRelation, TransBlockNumberSetXidStatus(LogRelation,
...@@ -292,43 +284,38 @@ static void ...@@ -292,43 +284,38 @@ static void
TransRecover(Relation logRelation) TransRecover(Relation logRelation)
{ {
#ifdef NOT_USED #ifdef NOT_USED
/* ----------------
* first get the last recorded transaction in the log. /*
* ---------------- * first get the last recorded transaction in the log.
*/ */
TransGetLastRecordedTransaction(logRelation, logLastXid, &fail); TransGetLastRecordedTransaction(logRelation, logLastXid, &fail);
if (fail == true) if (fail == true)
elog(ERROR, "TransRecover: failed TransGetLastRecordedTransaction"); elog(ERROR, "TransRecover: failed TransGetLastRecordedTransaction");
/* ---------------- /*
* next get the "last" and "next" variables * next get the "last" and "next" variables
* ----------------
*/ */
VariableRelationGetLastXid(&varLastXid); VariableRelationGetLastXid(&varLastXid);
VariableRelationGetNextXid(&varNextXid); VariableRelationGetNextXid(&varNextXid);
/* ---------------- /*
* intregity test (1) * intregity test (1)
* ----------------
*/ */
if (TransactionIdIsLessThan(varNextXid, logLastXid)) if (TransactionIdIsLessThan(varNextXid, logLastXid))
elog(ERROR, "TransRecover: varNextXid < logLastXid"); elog(ERROR, "TransRecover: varNextXid < logLastXid");
/* ---------------- /*
* intregity test (2) * intregity test (2)
* ----------------
*/ */
/* ---------------- /*
* intregity test (3) * intregity test (3)
* ----------------
*/ */
/* ---------------- /*
* here we have a valid " * here we have a valid "
* *
* **** RESUME HERE **** **** RESUME HERE ****
* ----------------
*/ */
varNextXid = TransactionIdDup(varLastXid); varNextXid = TransactionIdDup(varLastXid);
TransactionIdIncrement(&varNextXid); TransactionIdIncrement(&varNextXid);
...@@ -375,51 +362,45 @@ InitializeTransactionLog(void) ...@@ -375,51 +362,45 @@ InitializeTransactionLog(void)
Relation logRelation; Relation logRelation;
MemoryContext oldContext; MemoryContext oldContext;
/* ---------------- /*
* don't do anything during bootstrapping * don't do anything during bootstrapping
* ----------------
*/ */
if (AMI_OVERRIDE) if (AMI_OVERRIDE)
return; return;
/* ---------------- /*
* disable the transaction system so the access methods * disable the transaction system so the access methods don't
* don't interfere during initialization. * interfere during initialization.
* ----------------
*/ */
OverrideTransactionSystem(true); OverrideTransactionSystem(true);
/* ---------------- /*
* make sure allocations occur within the top memory context * make sure allocations occur within the top memory context so that
* so that our log management structures are protected from * our log management structures are protected from garbage collection
* garbage collection at the end of every transaction. * at the end of every transaction.
* ----------------
*/ */
oldContext = MemoryContextSwitchTo(TopMemoryContext); oldContext = MemoryContextSwitchTo(TopMemoryContext);
/* ---------------- /*
* first open the log and time relations * first open the log and time relations (these are created by amiint
* (these are created by amiint so they are guaranteed to exist) * so they are guaranteed to exist)
* ----------------
*/ */
logRelation = heap_openr(LogRelationName, NoLock); logRelation = heap_openr(LogRelationName, NoLock);
VariableRelation = heap_openr(VariableRelationName, NoLock); VariableRelation = heap_openr(VariableRelationName, NoLock);
/* ---------------- /*
* XXX TransactionLogUpdate requires that LogRelation * XXX TransactionLogUpdate requires that LogRelation is valid so we
* is valid so we temporarily set it so we can initialize * temporarily set it so we can initialize things properly. This could
* things properly. This could be done cleaner. * be done cleaner.
* ----------------
*/ */
LogRelation = logRelation; LogRelation = logRelation;
/* ---------------- /*
* if we have a virgin database, we initialize the log * if we have a virgin database, we initialize the log relation by
* relation by committing the AmiTransactionId (id 512) and we * committing the AmiTransactionId (id 512) and we initialize the
* initialize the variable relation by setting the next available * variable relation by setting the next available transaction id to
* transaction id to FirstTransactionId (id 514). OID initialization * FirstTransactionId (id 514). OID initialization happens as a side
* happens as a side effect of bootstrapping in varsup.c. * effect of bootstrapping in varsup.c.
* ----------------
*/ */
SpinAcquire(OidGenLockId); SpinAcquire(OidGenLockId);
if (!TransactionIdDidCommit(AmiTransactionId)) if (!TransactionIdDidCommit(AmiTransactionId))
...@@ -433,33 +414,30 @@ InitializeTransactionLog(void) ...@@ -433,33 +414,30 @@ InitializeTransactionLog(void)
} }
else if (RecoveryCheckingEnabled()) else if (RecoveryCheckingEnabled())
{ {
/* ----------------
* if we have a pre-initialized database and if the /*
* perform recovery checking flag was passed then we * if we have a pre-initialized database and if the perform
* do our database integrity checking. * recovery checking flag was passed then we do our database
* ---------------- * integrity checking.
*/ */
TransRecover(logRelation); TransRecover(logRelation);
} }
LogRelation = (Relation) NULL; LogRelation = (Relation) NULL;
SpinRelease(OidGenLockId); SpinRelease(OidGenLockId);
/* ---------------- /*
* now re-enable the transaction system * now re-enable the transaction system
* ----------------
*/ */
OverrideTransactionSystem(false); OverrideTransactionSystem(false);
/* ---------------- /*
* instantiate the global variables * instantiate the global variables
* ----------------
*/ */
LogRelation = logRelation; LogRelation = logRelation;
/* ---------------- /*
* restore the memory context to the previous context * restore the memory context to the previous context before we return
* before we return from initialization. * from initialization.
* ----------------
*/ */
MemoryContextSwitchTo(oldContext); MemoryContextSwitchTo(oldContext);
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/transsup.c,v 1.29 2001/03/22 03:59:17 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/transsup.c,v 1.30 2001/03/22 06:16:10 momjian Exp $
* *
* NOTES * NOTES
* This file contains support functions for the high * This file contains support functions for the high
...@@ -56,11 +56,9 @@ TransComputeBlockNumber(Relation relation, /* relation to test */ ...@@ -56,11 +56,9 @@ TransComputeBlockNumber(Relation relation, /* relation to test */
{ {
long itemsPerBlock = 0; long itemsPerBlock = 0;
/* ---------------- /*
* we calculate the block number of our transaction * we calculate the block number of our transaction by dividing the
* by dividing the transaction id by the number of * transaction id by the number of transaction things per block.
* transaction things per block.
* ----------------
*/ */
if (relation == LogRelation) if (relation == LogRelation)
itemsPerBlock = TP_NumXidStatusPerBlock; itemsPerBlock = TP_NumXidStatusPerBlock;
...@@ -109,18 +107,16 @@ TransBlockGetLastTransactionIdStatus(Block tblock, ...@@ -109,18 +107,16 @@ TransBlockGetLastTransactionIdStatus(Block tblock,
BitIndex offset; BitIndex offset;
XidStatus xstatus; XidStatus xstatus;
/* ---------------- /*
* sanity check * sanity check
* ----------------
*/ */
Assert((tblock != NULL)); Assert((tblock != NULL));
/* ---------------- /*
* search downward from the top of the block data, looking * search downward from the top of the block data, looking for the
* for the first Non-in progress transaction status. Since we * first Non-in progress transaction status. Since we are scanning
* are scanning backward, this will be last recorded transaction * backward, this will be last recorded transaction status on the
* status on the block. * block.
* ----------------
*/ */
maxIndex = TP_NumXidStatusPerBlock; maxIndex = TP_NumXidStatusPerBlock;
for (index = maxIndex; index > 0; index--) for (index = maxIndex; index > 0; index--)
...@@ -131,11 +127,10 @@ TransBlockGetLastTransactionIdStatus(Block tblock, ...@@ -131,11 +127,10 @@ TransBlockGetLastTransactionIdStatus(Block tblock,
xstatus = (bit1 | bit2); xstatus = (bit1 | bit2);
/* ---------------- /*
* here we have the status of some transaction, so test * here we have the status of some transaction, so test if the
* if the status is recorded as "in progress". If so, then * status is recorded as "in progress". If so, then we save the
* we save the transaction id in the place specified by the caller. * transaction id in the place specified by the caller.
* ----------------
*/ */
if (xstatus != XID_INPROGRESS) if (xstatus != XID_INPROGRESS)
{ {
...@@ -148,12 +143,11 @@ TransBlockGetLastTransactionIdStatus(Block tblock, ...@@ -148,12 +143,11 @@ TransBlockGetLastTransactionIdStatus(Block tblock,
} }
} }
/* ---------------- /*
* if we get here and index is 0 it means we couldn't find * if we get here and index is 0 it means we couldn't find a
* a non-inprogress transaction on the block. For now we just * non-inprogress transaction on the block. For now we just return
* return this info to the user. They can check if the return * this info to the user. They can check if the return status is "in
* status is "in progress" to know this condition has arisen. * progress" to know this condition has arisen.
* ----------------
*/ */
if (index == 0) if (index == 0)
{ {
...@@ -161,9 +155,8 @@ TransBlockGetLastTransactionIdStatus(Block tblock, ...@@ -161,9 +155,8 @@ TransBlockGetLastTransactionIdStatus(Block tblock,
TransactionIdStore(baseXid, returnXidP); TransactionIdStore(baseXid, returnXidP);
} }
/* ---------------- /*
* return the status to the user * return the status to the user
* ----------------
*/ */
return xstatus; return xstatus;
} }
...@@ -200,17 +193,15 @@ TransBlockGetXidStatus(Block tblock, ...@@ -200,17 +193,15 @@ TransBlockGetXidStatus(Block tblock,
*/ */
index = transactionId % TP_NumXidStatusPerBlock; index = transactionId % TP_NumXidStatusPerBlock;
/* ---------------- /*
* get the data at the specified index * get the data at the specified index
* ----------------
*/ */
offset = BitIndexOf(index); offset = BitIndexOf(index);
bit1 = ((bits8) BitArrayBitIsSet((BitArray) tblock, offset++)) << 1; bit1 = ((bits8) BitArrayBitIsSet((BitArray) tblock, offset++)) << 1;
bit2 = (bits8) BitArrayBitIsSet((BitArray) tblock, offset); bit2 = (bits8) BitArrayBitIsSet((BitArray) tblock, offset);
/* ---------------- /*
* return the transaction status to the caller * return the transaction status to the caller
* ----------------
*/ */
return (XidStatus) (bit1 | bit2); return (XidStatus) (bit1 | bit2);
} }
...@@ -245,9 +236,8 @@ TransBlockSetXidStatus(Block tblock, ...@@ -245,9 +236,8 @@ TransBlockSetXidStatus(Block tblock,
offset = BitIndexOf(index); offset = BitIndexOf(index);
/* ---------------- /*
* store the transaction value at the specified offset * store the transaction value at the specified offset
* ----------------
*/ */
switch (xstatus) switch (xstatus)
{ {
...@@ -291,18 +281,16 @@ TransBlockNumberGetXidStatus(Relation relation, ...@@ -291,18 +281,16 @@ TransBlockNumberGetXidStatus(Relation relation,
XidStatus xstatus; /* recorded status of xid */ XidStatus xstatus; /* recorded status of xid */
bool localfail; /* bool used if failP = NULL */ bool localfail; /* bool used if failP = NULL */
/* ---------------- /*
* get the page containing the transaction information * get the page containing the transaction information
* ----------------
*/ */
buffer = ReadBuffer(relation, blockNumber); buffer = ReadBuffer(relation, blockNumber);
LockBuffer(buffer, BUFFER_LOCK_SHARE); LockBuffer(buffer, BUFFER_LOCK_SHARE);
block = BufferGetBlock(buffer); block = BufferGetBlock(buffer);
/* ---------------- /*
* get the status from the block. note, for now we always * get the status from the block. note, for now we always return
* return false in failP. * false in failP.
* ----------------
*/ */
if (failP == NULL) if (failP == NULL)
failP = &localfail; failP = &localfail;
...@@ -310,9 +298,8 @@ TransBlockNumberGetXidStatus(Relation relation, ...@@ -310,9 +298,8 @@ TransBlockNumberGetXidStatus(Relation relation,
xstatus = TransBlockGetXidStatus(block, xid); xstatus = TransBlockGetXidStatus(block, xid);
/* ---------------- /*
* release the buffer and return the status * release the buffer and return the status
* ----------------
*/ */
LockBuffer(buffer, BUFFER_LOCK_UNLOCK); LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
ReleaseBuffer(buffer); ReleaseBuffer(buffer);
...@@ -335,19 +322,17 @@ TransBlockNumberSetXidStatus(Relation relation, ...@@ -335,19 +322,17 @@ TransBlockNumberSetXidStatus(Relation relation,
Block block; /* block containing xstatus */ Block block; /* block containing xstatus */
bool localfail; /* bool used if failP = NULL */ bool localfail; /* bool used if failP = NULL */
/* ---------------- /*
* get the block containing the transaction status * get the block containing the transaction status
* ----------------
*/ */
buffer = ReadBuffer(relation, blockNumber); buffer = ReadBuffer(relation, blockNumber);
LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE); LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE);
block = BufferGetBlock(buffer); block = BufferGetBlock(buffer);
/* ---------------- /*
* attempt to update the status of the transaction on the block. * attempt to update the status of the transaction on the block. if we
* if we are successful, write the block. otherwise release the buffer. * are successful, write the block. otherwise release the buffer.
* note, for now we always return false in failP. * note, for now we always return false in failP.
* ----------------
*/ */
if (failP == NULL) if (failP == NULL)
failP = &localfail; failP = &localfail;
...@@ -381,22 +366,20 @@ TransGetLastRecordedTransaction(Relation relation, ...@@ -381,22 +366,20 @@ TransGetLastRecordedTransaction(Relation relation,
(*failP) = false; (*failP) = false;
/* ---------------- /*
* SOMEDAY gain exclusive access to the log relation * SOMEDAY gain exclusive access to the log relation
* *
* That someday is today 5 Aug. 1991 -mer * That someday is today 5 Aug. 1991 -mer It looks to me like we only
* It looks to me like we only need to set a read lock here, despite * need to set a read lock here, despite the above comment about
* the above comment about exclusive access. The block is never * exclusive access. The block is never actually written into, we
* actually written into, we only check status bits. * only check status bits.
* ----------------
*/ */
RelationSetLockForRead(relation); RelationSetLockForRead(relation);
/* ---------------- /*
* we assume the last block of the log contains the last * we assume the last block of the log contains the last recorded
* recorded transaction. If the relation is empty we return * transaction. If the relation is empty we return failure to the
* failure to the user. * user.
* ----------------
*/ */
n = RelationGetNumberOfBlocks(relation); n = RelationGetNumberOfBlocks(relation);
if (n == 0) if (n == 0)
...@@ -405,17 +388,15 @@ TransGetLastRecordedTransaction(Relation relation, ...@@ -405,17 +388,15 @@ TransGetLastRecordedTransaction(Relation relation,
return; return;
} }
/* ---------------- /*
* get the block containing the transaction information * get the block containing the transaction information
* ----------------
*/ */
blockNumber = n - 1; blockNumber = n - 1;
buffer = ReadBuffer(relation, blockNumber); buffer = ReadBuffer(relation, blockNumber);
block = BufferGetBlock(buffer); block = BufferGetBlock(buffer);
/* ---------------- /*
* get the last xid on the block * get the last xid on the block
* ----------------
*/ */
baseXid = blockNumber * TP_NumXidStatusPerBlock; baseXid = blockNumber * TP_NumXidStatusPerBlock;
...@@ -424,9 +405,8 @@ TransGetLastRecordedTransaction(Relation relation, ...@@ -424,9 +405,8 @@ TransGetLastRecordedTransaction(Relation relation,
ReleaseBuffer(buffer); ReleaseBuffer(buffer);
/* ---------------- /*
* SOMEDAY release our lock on the log relation * SOMEDAY release our lock on the log relation
* ----------------
*/ */
RelationUnsetLockForRead(relation); RelationUnsetLockForRead(relation);
} }
......
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.105 2001/03/13 01:17:05 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.106 2001/03/22 06:16:10 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -141,7 +141,7 @@ int numattr; /* number of attributes for cur. rel */ ...@@ -141,7 +141,7 @@ int numattr; /* number of attributes for cur. rel */
int DebugMode; int DebugMode;
static MemoryContext nogc = NULL; /* special no-gc mem context */ static MemoryContext nogc = NULL; /* special no-gc mem context */
extern int optind; extern int optind;
extern char *optarg; extern char *optarg;
...@@ -216,11 +216,10 @@ BootstrapMain(int argc, char *argv[]) ...@@ -216,11 +216,10 @@ BootstrapMain(int argc, char *argv[])
char *dbName; char *dbName;
int flag; int flag;
int xlogop = BS_XLOG_NOP; int xlogop = BS_XLOG_NOP;
char *potential_DataDir = NULL; char *potential_DataDir = NULL;
/* -------------------- /*
* initialize globals * initialize globals
* -------------------
*/ */
MyProcPid = getpid(); MyProcPid = getpid();
...@@ -236,9 +235,8 @@ BootstrapMain(int argc, char *argv[]) ...@@ -236,9 +235,8 @@ BootstrapMain(int argc, char *argv[])
MemoryContextInit(); MemoryContextInit();
} }
/* ---------------- /*
* process command arguments * process command arguments
* ----------------
*/ */
/* Set defaults, to be overriden by explicit options below */ /* Set defaults, to be overriden by explicit options below */
...@@ -248,7 +246,8 @@ BootstrapMain(int argc, char *argv[]) ...@@ -248,7 +246,8 @@ BootstrapMain(int argc, char *argv[])
if (!IsUnderPostmaster) if (!IsUnderPostmaster)
{ {
ResetAllOptions(); ResetAllOptions();
potential_DataDir = getenv("PGDATA"); /* Null if no PGDATA variable */ potential_DataDir = getenv("PGDATA"); /* Null if no PGDATA
* variable */
} }
while ((flag = getopt(argc, argv, "D:dCQx:pB:F")) != EOF) while ((flag = getopt(argc, argv, "D:dCQx:pB:F")) != EOF)
...@@ -307,9 +306,9 @@ BootstrapMain(int argc, char *argv[]) ...@@ -307,9 +306,9 @@ BootstrapMain(int argc, char *argv[])
if (!potential_DataDir) if (!potential_DataDir)
{ {
fprintf(stderr, "%s does not know where to find the database system " fprintf(stderr, "%s does not know where to find the database system "
"data. You must specify the directory that contains the " "data. You must specify the directory that contains the "
"database system either by specifying the -D invocation " "database system either by specifying the -D invocation "
"option or by setting the PGDATA environment variable.\n\n", "option or by setting the PGDATA environment variable.\n\n",
argv[0]); argv[0]);
proc_exit(1); proc_exit(1);
} }
...@@ -319,15 +318,17 @@ BootstrapMain(int argc, char *argv[]) ...@@ -319,15 +318,17 @@ BootstrapMain(int argc, char *argv[])
if (IsUnderPostmaster) if (IsUnderPostmaster)
{ {
/* /*
* Properly accept or ignore signals the postmaster might send us * Properly accept or ignore signals the postmaster might send us
*/ */
pqsignal(SIGHUP, SIG_IGN); pqsignal(SIGHUP, SIG_IGN);
pqsignal(SIGINT, SIG_IGN); /* ignore query-cancel */ pqsignal(SIGINT, SIG_IGN); /* ignore query-cancel */
pqsignal(SIGTERM, die); pqsignal(SIGTERM, die);
pqsignal(SIGQUIT, quickdie); pqsignal(SIGQUIT, quickdie);
pqsignal(SIGUSR1, SIG_IGN); pqsignal(SIGUSR1, SIG_IGN);
pqsignal(SIGUSR2, SIG_IGN); pqsignal(SIGUSR2, SIG_IGN);
/* /*
* Reset some signals that are accepted by postmaster but not here * Reset some signals that are accepted by postmaster but not here
*/ */
...@@ -336,8 +337,10 @@ BootstrapMain(int argc, char *argv[]) ...@@ -336,8 +337,10 @@ BootstrapMain(int argc, char *argv[])
pqsignal(SIGTTOU, SIG_DFL); pqsignal(SIGTTOU, SIG_DFL);
pqsignal(SIGCONT, SIG_DFL); pqsignal(SIGCONT, SIG_DFL);
pqsignal(SIGWINCH, SIG_DFL); pqsignal(SIGWINCH, SIG_DFL);
/* /*
* Unblock signals (they were blocked when the postmaster forked us) * Unblock signals (they were blocked when the postmaster forked
* us)
*/ */
PG_SETMASK(&UnBlockSig); PG_SETMASK(&UnBlockSig);
} }
...@@ -352,7 +355,7 @@ BootstrapMain(int argc, char *argv[]) ...@@ -352,7 +355,7 @@ BootstrapMain(int argc, char *argv[])
/* /*
* Create lockfile for data directory. * Create lockfile for data directory.
*/ */
if (! CreateDataDirLockFile(DataDir, false)) if (!CreateDataDirLockFile(DataDir, false))
proc_exit(1); proc_exit(1);
} }
...@@ -408,9 +411,8 @@ BootstrapMain(int argc, char *argv[]) ...@@ -408,9 +411,8 @@ BootstrapMain(int argc, char *argv[])
for (i = 0; i < HASHTABLESIZE; ++i) for (i = 0; i < HASHTABLESIZE; ++i)
hashtable[i] = NULL; hashtable[i] = NULL;
/* ---------------- /*
* abort processing resumes here * abort processing resumes here
* ----------------
*/ */
if (sigsetjmp(Warn_restart, 1) != 0) if (sigsetjmp(Warn_restart, 1) != 0)
{ {
...@@ -418,9 +420,8 @@ BootstrapMain(int argc, char *argv[]) ...@@ -418,9 +420,8 @@ BootstrapMain(int argc, char *argv[])
AbortCurrentTransaction(); AbortCurrentTransaction();
} }
/* ---------------- /*
* process input. * process input.
* ----------------
*/ */
/* /*
...@@ -720,9 +721,9 @@ InsertOneValue(Oid objectid, char *value, int i) ...@@ -720,9 +721,9 @@ InsertOneValue(Oid objectid, char *value, int i)
ObjectIdGetDatum(ap->am_typ.typelem), ObjectIdGetDatum(ap->am_typ.typelem),
Int32GetDatum(-1)); Int32GetDatum(-1));
prt = DatumGetCString(OidFunctionCall3(ap->am_typ.typoutput, prt = DatumGetCString(OidFunctionCall3(ap->am_typ.typoutput,
values[i], values[i],
ObjectIdGetDatum(ap->am_typ.typelem), ObjectIdGetDatum(ap->am_typ.typelem),
Int32GetDatum(-1))); Int32GetDatum(-1)));
if (!Quiet) if (!Quiet)
printf("%s ", prt); printf("%s ", prt);
pfree(prt); pfree(prt);
...@@ -740,12 +741,12 @@ InsertOneValue(Oid objectid, char *value, int i) ...@@ -740,12 +741,12 @@ InsertOneValue(Oid objectid, char *value, int i)
printf("Typ == NULL, typeindex = %u idx = %d\n", typeindex, i); printf("Typ == NULL, typeindex = %u idx = %d\n", typeindex, i);
values[i] = OidFunctionCall3(Procid[typeindex].inproc, values[i] = OidFunctionCall3(Procid[typeindex].inproc,
CStringGetDatum(value), CStringGetDatum(value),
ObjectIdGetDatum(Procid[typeindex].elem), ObjectIdGetDatum(Procid[typeindex].elem),
Int32GetDatum(-1)); Int32GetDatum(-1));
prt = DatumGetCString(OidFunctionCall3(Procid[typeindex].outproc, prt = DatumGetCString(OidFunctionCall3(Procid[typeindex].outproc,
values[i], values[i],
ObjectIdGetDatum(Procid[typeindex].elem), ObjectIdGetDatum(Procid[typeindex].elem),
Int32GetDatum(-1))); Int32GetDatum(-1)));
if (!Quiet) if (!Quiet)
printf("%s ", prt); printf("%s ", prt);
pfree(prt); pfree(prt);
......
This diff is collapsed.
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.56 2001/03/22 03:59:20 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.57 2001/03/22 06:16:10 momjian Exp $
* *
* NOTES * NOTES
* these routines moved here from commands/define.c and somewhat cleaned up. * these routines moved here from commands/define.c and somewhat cleaned up.
...@@ -102,17 +102,15 @@ OperatorGetWithOpenRelation(Relation pg_operator_desc, ...@@ -102,17 +102,15 @@ OperatorGetWithOpenRelation(Relation pg_operator_desc,
opKey[1].sk_nargs = opKey[1].sk_func.fn_nargs; opKey[1].sk_nargs = opKey[1].sk_func.fn_nargs;
opKey[2].sk_nargs = opKey[2].sk_func.fn_nargs; opKey[2].sk_nargs = opKey[2].sk_func.fn_nargs;
/* ---------------- /*
* form scan key * form scan key
* ----------------
*/ */
opKey[0].sk_argument = PointerGetDatum(operatorName); opKey[0].sk_argument = PointerGetDatum(operatorName);
opKey[1].sk_argument = ObjectIdGetDatum(leftObjectId); opKey[1].sk_argument = ObjectIdGetDatum(leftObjectId);
opKey[2].sk_argument = ObjectIdGetDatum(rightObjectId); opKey[2].sk_argument = ObjectIdGetDatum(rightObjectId);
/* ---------------- /*
* begin the scan * begin the scan
* ----------------
*/ */
pg_operator_scan = heap_beginscan(pg_operator_desc, pg_operator_scan = heap_beginscan(pg_operator_desc,
0, 0,
...@@ -120,10 +118,9 @@ OperatorGetWithOpenRelation(Relation pg_operator_desc, ...@@ -120,10 +118,9 @@ OperatorGetWithOpenRelation(Relation pg_operator_desc,
3, 3,
opKey); opKey);
/* ---------------- /*
* fetch the operator tuple, if it exists, and determine * fetch the operator tuple, if it exists, and determine the proper
* the proper return oid value. * return oid value.
* ----------------
*/ */
tup = heap_getnext(pg_operator_scan, 0); tup = heap_getnext(pg_operator_scan, 0);
...@@ -140,9 +137,8 @@ OperatorGetWithOpenRelation(Relation pg_operator_desc, ...@@ -140,9 +137,8 @@ OperatorGetWithOpenRelation(Relation pg_operator_desc,
*defined = false; *defined = false;
} }
/* ---------------- /*
* close the scan and return the oid. * close the scan and return the oid.
* ----------------
*/ */
heap_endscan(pg_operator_scan); heap_endscan(pg_operator_scan);
...@@ -170,11 +166,10 @@ OperatorGet(char *operatorName, ...@@ -170,11 +166,10 @@ OperatorGet(char *operatorName,
bool leftDefined = false; bool leftDefined = false;
bool rightDefined = false; bool rightDefined = false;
/* ---------------- /*
* look up the operator data types. * look up the operator data types.
* *
* Note: types must be defined before operators * Note: types must be defined before operators
* ----------------
*/ */
if (leftTypeName) if (leftTypeName)
{ {
...@@ -198,16 +193,14 @@ OperatorGet(char *operatorName, ...@@ -198,16 +193,14 @@ OperatorGet(char *operatorName,
(OidIsValid(rightObjectId) && rightDefined))) (OidIsValid(rightObjectId) && rightDefined)))
elog(ERROR, "OperatorGet: must have at least one argument type"); elog(ERROR, "OperatorGet: must have at least one argument type");
/* ---------------- /*
* open the pg_operator relation * open the pg_operator relation
* ----------------
*/ */
pg_operator_desc = heap_openr(OperatorRelationName, AccessShareLock); pg_operator_desc = heap_openr(OperatorRelationName, AccessShareLock);
/* ---------------- /*
* get the oid for the operator with the appropriate name * get the oid for the operator with the appropriate name and
* and left/right types. * left/right types.
* ----------------
*/ */
operatorObjectId = OperatorGetWithOpenRelation(pg_operator_desc, operatorObjectId = OperatorGetWithOpenRelation(pg_operator_desc,
operatorName, operatorName,
...@@ -215,9 +208,8 @@ OperatorGet(char *operatorName, ...@@ -215,9 +208,8 @@ OperatorGet(char *operatorName,
rightObjectId, rightObjectId,
defined); defined);
/* ---------------- /*
* close the relation and return the operator oid. * close the relation and return the operator oid.
* ----------------
*/ */
heap_close(pg_operator_desc, AccessShareLock); heap_close(pg_operator_desc, AccessShareLock);
...@@ -243,9 +235,8 @@ OperatorShellMakeWithOpenRelation(Relation pg_operator_desc, ...@@ -243,9 +235,8 @@ OperatorShellMakeWithOpenRelation(Relation pg_operator_desc,
NameData oname; NameData oname;
TupleDesc tupDesc; TupleDesc tupDesc;
/* ---------------- /*
* initialize our *nulls and *values arrays * initialize our *nulls and *values arrays
* ----------------
*/ */
for (i = 0; i < Natts_pg_operator; ++i) for (i = 0; i < Natts_pg_operator; ++i)
{ {
...@@ -253,10 +244,9 @@ OperatorShellMakeWithOpenRelation(Relation pg_operator_desc, ...@@ -253,10 +244,9 @@ OperatorShellMakeWithOpenRelation(Relation pg_operator_desc,
values[i] = (Datum) NULL; /* redundant, but safe */ values[i] = (Datum) NULL; /* redundant, but safe */
} }
/* ---------------- /*
* initialize *values with the operator name and input data types. * initialize *values with the operator name and input data types.
* Note that oprcode is set to InvalidOid, indicating it's a shell. * Note that oprcode is set to InvalidOid, indicating it's a shell.
* ----------------
*/ */
i = 0; i = 0;
namestrcpy(&oname, operatorName); namestrcpy(&oname, operatorName);
...@@ -277,9 +267,8 @@ OperatorShellMakeWithOpenRelation(Relation pg_operator_desc, ...@@ -277,9 +267,8 @@ OperatorShellMakeWithOpenRelation(Relation pg_operator_desc,
values[i++] = ObjectIdGetDatum(InvalidOid); values[i++] = ObjectIdGetDatum(InvalidOid);
values[i++] = ObjectIdGetDatum(InvalidOid); values[i++] = ObjectIdGetDatum(InvalidOid);
/* ---------------- /*
* create a new operator tuple * create a new operator tuple
* ----------------
*/ */
tupDesc = pg_operator_desc->rd_att; tupDesc = pg_operator_desc->rd_att;
...@@ -287,10 +276,8 @@ OperatorShellMakeWithOpenRelation(Relation pg_operator_desc, ...@@ -287,10 +276,8 @@ OperatorShellMakeWithOpenRelation(Relation pg_operator_desc,
values, values,
nulls); nulls);
/* ---------------- /*
* insert our "shell" operator tuple and * insert our "shell" operator tuple and close the relation
* close the relation
* ----------------
*/ */
heap_insert(pg_operator_desc, tup); heap_insert(pg_operator_desc, tup);
operatorObjectId = tup->t_data->t_oid; operatorObjectId = tup->t_data->t_oid;
...@@ -304,9 +291,8 @@ OperatorShellMakeWithOpenRelation(Relation pg_operator_desc, ...@@ -304,9 +291,8 @@ OperatorShellMakeWithOpenRelation(Relation pg_operator_desc,
CatalogCloseIndices(Num_pg_operator_indices, idescs); CatalogCloseIndices(Num_pg_operator_indices, idescs);
} }
/* ---------------- /*
* free the tuple and return the operator oid * free the tuple and return the operator oid
* ----------------
*/ */
heap_freetuple(tup); heap_freetuple(tup);
...@@ -335,9 +321,8 @@ OperatorShellMake(char *operatorName, ...@@ -335,9 +321,8 @@ OperatorShellMake(char *operatorName,
bool leftDefined = false; bool leftDefined = false;
bool rightDefined = false; bool rightDefined = false;
/* ---------------- /*
* get the left and right type oid's for this operator * get the left and right type oid's for this operator
* ----------------
*/ */
if (leftTypeName) if (leftTypeName)
leftObjectId = TypeGet(leftTypeName, &leftDefined); leftObjectId = TypeGet(leftTypeName, &leftDefined);
...@@ -349,24 +334,22 @@ OperatorShellMake(char *operatorName, ...@@ -349,24 +334,22 @@ OperatorShellMake(char *operatorName,
(OidIsValid(rightObjectId) && rightDefined))) (OidIsValid(rightObjectId) && rightDefined)))
elog(ERROR, "OperatorShellMake: no valid argument types??"); elog(ERROR, "OperatorShellMake: no valid argument types??");
/* ---------------- /*
* open pg_operator * open pg_operator
* ----------------
*/ */
pg_operator_desc = heap_openr(OperatorRelationName, RowExclusiveLock); pg_operator_desc = heap_openr(OperatorRelationName, RowExclusiveLock);
/* ---------------- /*
* add a "shell" operator tuple to the operator relation * add a "shell" operator tuple to the operator relation and recover
* and recover the shell tuple's oid. * the shell tuple's oid.
* ----------------
*/ */
operatorObjectId = OperatorShellMakeWithOpenRelation(pg_operator_desc, operatorObjectId = OperatorShellMakeWithOpenRelation(pg_operator_desc,
operatorName, operatorName,
leftObjectId, leftObjectId,
rightObjectId); rightObjectId);
/* ----------------
* close the operator relation and return the oid. /*
* ---------------- * close the operator relation and return the oid.
*/ */
heap_close(pg_operator_desc, RowExclusiveLock); heap_close(pg_operator_desc, RowExclusiveLock);
...@@ -516,11 +499,10 @@ OperatorDef(char *operatorName, ...@@ -516,11 +499,10 @@ OperatorDef(char *operatorName,
* filling in a previously-created shell. * filling in a previously-created shell.
*/ */
/* ---------------- /*
* look up the operator data types. * look up the operator data types.
* *
* Note: types must be defined before operators * Note: types must be defined before operators
* ----------------
*/ */
if (leftTypeName) if (leftTypeName)
{ {
...@@ -551,12 +533,10 @@ OperatorDef(char *operatorName, ...@@ -551,12 +533,10 @@ OperatorDef(char *operatorName,
nulls[i] = ' '; nulls[i] = ' ';
} }
/* ---------------- /*
* Look up registered procedures -- find the return type * Look up registered procedures -- find the return type of
* of procedureName to place in "result" field. * procedureName to place in "result" field. Do this before shells are
* Do this before shells are created so we don't * created so we don't have to worry about deleting them later.
* have to worry about deleting them later.
* ----------------
*/ */
MemSet(typeId, 0, FUNC_MAX_ARGS * sizeof(Oid)); MemSet(typeId, 0, FUNC_MAX_ARGS * sizeof(Oid));
if (!leftTypeName) if (!leftTypeName)
...@@ -589,9 +569,8 @@ OperatorDef(char *operatorName, ...@@ -589,9 +569,8 @@ OperatorDef(char *operatorName,
ReleaseSysCache(tup); ReleaseSysCache(tup);
/* ---------------- /*
* find restriction * find restriction
* ----------------
*/ */
if (restrictionName) if (restrictionName)
{ /* optional */ { /* optional */
...@@ -617,9 +596,8 @@ OperatorDef(char *operatorName, ...@@ -617,9 +596,8 @@ OperatorDef(char *operatorName,
else else
values[Anum_pg_operator_oprrest - 1] = ObjectIdGetDatum(InvalidOid); values[Anum_pg_operator_oprrest - 1] = ObjectIdGetDatum(InvalidOid);
/* ---------------- /*
* find join - only valid for binary operators * find join - only valid for binary operators
* ----------------
*/ */
if (joinName) if (joinName)
{ /* optional */ { /* optional */
...@@ -645,9 +623,8 @@ OperatorDef(char *operatorName, ...@@ -645,9 +623,8 @@ OperatorDef(char *operatorName,
else else
values[Anum_pg_operator_oprjoin - 1] = ObjectIdGetDatum(InvalidOid); values[Anum_pg_operator_oprjoin - 1] = ObjectIdGetDatum(InvalidOid);
/* ---------------- /*
* set up values in the operator tuple * set up values in the operator tuple
* ----------------
*/ */
i = 0; i = 0;
namestrcpy(&oname, operatorName); namestrcpy(&oname, operatorName);
...@@ -1077,11 +1054,10 @@ OperatorCreate(char *operatorName, ...@@ -1077,11 +1054,10 @@ OperatorCreate(char *operatorName,
elog(ERROR, "OperatorCreate: only binary operators can have sort links"); elog(ERROR, "OperatorCreate: only binary operators can have sort links");
} }
/* ---------------- /*
* Use OperatorDef() to define the specified operator and * Use OperatorDef() to define the specified operator and also create
* also create shells for the operator's associated operators * shells for the operator's associated operators if they don't
* if they don't already exist. * already exist.
* ----------------
*/ */
OperatorDef(operatorName, OperatorDef(operatorName,
leftTypeName, leftTypeName,
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.54 2001/03/22 03:59:20 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.55 2001/03/22 06:16:10 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -73,9 +73,8 @@ ProcedureCreate(char *procedureName, ...@@ -73,9 +73,8 @@ ProcedureCreate(char *procedureName,
TupleDesc tupDesc; TupleDesc tupDesc;
Oid retval; Oid retval;
/* ---------------- /*
* sanity checks * sanity checks
* ----------------
*/ */
Assert(PointerIsValid(prosrc)); Assert(PointerIsValid(prosrc));
Assert(PointerIsValid(probin)); Assert(PointerIsValid(probin));
...@@ -142,16 +141,16 @@ ProcedureCreate(char *procedureName, ...@@ -142,16 +141,16 @@ ProcedureCreate(char *procedureName,
if (strcmp(procedureName, GENERICSETNAME) == 0) if (strcmp(procedureName, GENERICSETNAME) == 0)
{ {
#ifdef SETS_FIXED #ifdef SETS_FIXED
/* ----------
* The code below doesn't work any more because the /*
* PROSRC system cache and the pg_proc_prosrc_index * The code below doesn't work any more because the PROSRC
* have been removed. Instead a sequential heap scan * system cache and the pg_proc_prosrc_index have been
* or something better must get implemented. The reason * removed. Instead a sequential heap scan or something better
* for removing is that nbtree index crashes if sources * must get implemented. The reason for removing is that
* exceed 2K --- what's likely for procedural languages. * nbtree index crashes if sources exceed 2K --- what's likely
* for procedural languages.
* *
* 1999/09/30 Jan * 1999/09/30 Jan
* ----------
*/ */
text *prosrctext; text *prosrctext;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.60 2001/03/22 03:59:20 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.61 2001/03/22 06:16:11 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -48,9 +48,8 @@ TypeGetWithOpenRelation(Relation pg_type_desc, ...@@ -48,9 +48,8 @@ TypeGetWithOpenRelation(Relation pg_type_desc,
Oid typoid; Oid typoid;
ScanKeyData typeKey[1]; ScanKeyData typeKey[1];
/* ---------------- /*
* initialize the scan key and begin a scan of pg_type * initialize the scan key and begin a scan of pg_type
* ----------------
*/ */
ScanKeyEntryInitialize(typeKey, ScanKeyEntryInitialize(typeKey,
0, 0,
...@@ -64,16 +63,14 @@ TypeGetWithOpenRelation(Relation pg_type_desc, ...@@ -64,16 +63,14 @@ TypeGetWithOpenRelation(Relation pg_type_desc,
1, 1,
typeKey); typeKey);
/* ---------------- /*
* get the type tuple, if it exists. * get the type tuple, if it exists.
* ----------------
*/ */
tup = heap_getnext(scan, 0); tup = heap_getnext(scan, 0);
/* ---------------- /*
* if no type tuple exists for the given type name, then * if no type tuple exists for the given type name, then end the scan
* end the scan and return appropriate information. * and return appropriate information.
* ----------------
*/ */
if (!HeapTupleIsValid(tup)) if (!HeapTupleIsValid(tup))
{ {
...@@ -82,11 +79,10 @@ TypeGetWithOpenRelation(Relation pg_type_desc, ...@@ -82,11 +79,10 @@ TypeGetWithOpenRelation(Relation pg_type_desc,
return InvalidOid; return InvalidOid;
} }
/* ---------------- /*
* here, the type tuple does exist so we pull information from * here, the type tuple does exist so we pull information from the
* the typisdefined field of the tuple and return the tuple's * typisdefined field of the tuple and return the tuple's oid, which
* oid, which is the oid of the type. * is the oid of the type.
* ----------------
*/ */
*defined = (bool) ((Form_pg_type) GETSTRUCT(tup))->typisdefined; *defined = (bool) ((Form_pg_type) GETSTRUCT(tup))->typisdefined;
typoid = tup->t_data->t_oid; typoid = tup->t_data->t_oid;
...@@ -116,23 +112,20 @@ TypeGet(char *typeName, /* name of type to be fetched */ ...@@ -116,23 +112,20 @@ TypeGet(char *typeName, /* name of type to be fetched */
Relation pg_type_desc; Relation pg_type_desc;
Oid typeoid; Oid typeoid;
/* ---------------- /*
* open the pg_type relation * open the pg_type relation
* ----------------
*/ */
pg_type_desc = heap_openr(TypeRelationName, AccessShareLock); pg_type_desc = heap_openr(TypeRelationName, AccessShareLock);
/* ---------------- /*
* scan the type relation for the information we want * scan the type relation for the information we want
* ----------------
*/ */
typeoid = TypeGetWithOpenRelation(pg_type_desc, typeoid = TypeGetWithOpenRelation(pg_type_desc,
typeName, typeName,
defined); defined);
/* ---------------- /*
* close the type relation and return the type oid. * close the type relation and return the type oid.
* ----------------
*/ */
heap_close(pg_type_desc, AccessShareLock); heap_close(pg_type_desc, AccessShareLock);
...@@ -155,9 +148,8 @@ TypeShellMakeWithOpenRelation(Relation pg_type_desc, char *typeName) ...@@ -155,9 +148,8 @@ TypeShellMakeWithOpenRelation(Relation pg_type_desc, char *typeName)
NameData name; NameData name;
TupleDesc tupDesc; TupleDesc tupDesc;
/* ---------------- /*
* initialize our *nulls and *values arrays * initialize our *nulls and *values arrays
* ----------------
*/ */
for (i = 0; i < Natts_pg_type; ++i) for (i = 0; i < Natts_pg_type; ++i)
{ {
...@@ -165,9 +157,8 @@ TypeShellMakeWithOpenRelation(Relation pg_type_desc, char *typeName) ...@@ -165,9 +157,8 @@ TypeShellMakeWithOpenRelation(Relation pg_type_desc, char *typeName)
values[i] = (Datum) NULL; /* redundant, but safe */ values[i] = (Datum) NULL; /* redundant, but safe */
} }
/* ---------------- /*
* initialize *values with the type name and dummy values * initialize *values with the type name and dummy values
* ----------------
*/ */
i = 0; i = 0;
namestrcpy(&name, typeName); namestrcpy(&name, typeName);
...@@ -190,17 +181,15 @@ TypeShellMakeWithOpenRelation(Relation pg_type_desc, char *typeName) ...@@ -190,17 +181,15 @@ TypeShellMakeWithOpenRelation(Relation pg_type_desc, char *typeName)
values[i++] = DirectFunctionCall1(textin, values[i++] = DirectFunctionCall1(textin,
CStringGetDatum(typeName)); /* 17 */ CStringGetDatum(typeName)); /* 17 */
/* ---------------- /*
* create a new type tuple with FormHeapTuple * create a new type tuple with FormHeapTuple
* ----------------
*/ */
tupDesc = pg_type_desc->rd_att; tupDesc = pg_type_desc->rd_att;
tup = heap_formtuple(tupDesc, values, nulls); tup = heap_formtuple(tupDesc, values, nulls);
/* ---------------- /*
* insert the tuple in the relation and get the tuple's oid. * insert the tuple in the relation and get the tuple's oid.
* ----------------
*/ */
heap_insert(pg_type_desc, tup); heap_insert(pg_type_desc, tup);
typoid = tup->t_data->t_oid; typoid = tup->t_data->t_oid;
...@@ -213,9 +202,9 @@ TypeShellMakeWithOpenRelation(Relation pg_type_desc, char *typeName) ...@@ -213,9 +202,9 @@ TypeShellMakeWithOpenRelation(Relation pg_type_desc, char *typeName)
CatalogIndexInsert(idescs, Num_pg_type_indices, pg_type_desc, tup); CatalogIndexInsert(idescs, Num_pg_type_indices, pg_type_desc, tup);
CatalogCloseIndices(Num_pg_type_indices, idescs); CatalogCloseIndices(Num_pg_type_indices, idescs);
} }
/* ----------------
* free the tuple and return the type-oid /*
* ---------------- * free the tuple and return the type-oid
*/ */
heap_freetuple(tup); heap_freetuple(tup);
...@@ -243,21 +232,18 @@ TypeShellMake(char *typeName) ...@@ -243,21 +232,18 @@ TypeShellMake(char *typeName)
Assert(PointerIsValid(typeName)); Assert(PointerIsValid(typeName));
/* ---------------- /*
* open pg_type * open pg_type
* ----------------
*/ */
pg_type_desc = heap_openr(TypeRelationName, RowExclusiveLock); pg_type_desc = heap_openr(TypeRelationName, RowExclusiveLock);
/* ---------------- /*
* insert the shell tuple * insert the shell tuple
* ----------------
*/ */
typoid = TypeShellMakeWithOpenRelation(pg_type_desc, typeName); typoid = TypeShellMakeWithOpenRelation(pg_type_desc, typeName);
/* ---------------- /*
* close pg_type and return the tuple's oid. * close pg_type and return the tuple's oid.
* ----------------
*/ */
heap_close(pg_type_desc, RowExclusiveLock); heap_close(pg_type_desc, RowExclusiveLock);
...@@ -311,20 +297,18 @@ TypeCreate(char *typeName, ...@@ -311,20 +297,18 @@ TypeCreate(char *typeName,
Oid argList[FUNC_MAX_ARGS]; Oid argList[FUNC_MAX_ARGS];
ScanKeyData typeKey[1]; ScanKeyData typeKey[1];
/* ---------------- /*
* check that the type is not already defined. It might exist as * check that the type is not already defined. It might exist as a
* a shell type, however (but only if assignedTypeOid is not given). * shell type, however (but only if assignedTypeOid is not given).
* ----------------
*/ */
typeObjectId = TypeGet(typeName, &defined); typeObjectId = TypeGet(typeName, &defined);
if (OidIsValid(typeObjectId) && if (OidIsValid(typeObjectId) &&
(defined || assignedTypeOid != InvalidOid)) (defined || assignedTypeOid != InvalidOid))
elog(ERROR, "TypeCreate: type %s already defined", typeName); elog(ERROR, "TypeCreate: type %s already defined", typeName);
/* ---------------- /*
* if this type has an associated elementType, then we check that * if this type has an associated elementType, then we check that it
* it is defined. * is defined.
* ----------------
*/ */
if (elementTypeName) if (elementTypeName)
{ {
...@@ -333,16 +317,14 @@ TypeCreate(char *typeName, ...@@ -333,16 +317,14 @@ TypeCreate(char *typeName,
elog(ERROR, "TypeCreate: type %s is not defined", elementTypeName); elog(ERROR, "TypeCreate: type %s is not defined", elementTypeName);
} }
/* ---------------- /*
* XXX comment me * XXX comment me
* ----------------
*/ */
if (externalSize == 0) if (externalSize == 0)
externalSize = -1; /* variable length */ externalSize = -1; /* variable length */
/* ---------------- /*
* initialize arrays needed by FormHeapTuple * initialize arrays needed by FormHeapTuple
* ----------------
*/ */
for (i = 0; i < Natts_pg_type; ++i) for (i = 0; i < Natts_pg_type; ++i)
{ {
...@@ -362,9 +344,8 @@ TypeCreate(char *typeName, ...@@ -362,9 +344,8 @@ TypeCreate(char *typeName,
if (internalSize == 0) if (internalSize == 0)
internalSize = -1; internalSize = -1;
/* ---------------- /*
* initialize the *values information * initialize the *values information
* ----------------
*/ */
i = 0; i = 0;
namestrcpy(&name, typeName); namestrcpy(&name, typeName);
...@@ -441,28 +422,24 @@ TypeCreate(char *typeName, ...@@ -441,28 +422,24 @@ TypeCreate(char *typeName,
values[i++] = ObjectIdGetDatum(procOid); /* 11 - 14 */ values[i++] = ObjectIdGetDatum(procOid); /* 11 - 14 */
} }
/* ---------------- /*
* set default alignment * set default alignment
* ----------------
*/ */
values[i++] = CharGetDatum(alignment); /* 15 */ values[i++] = CharGetDatum(alignment); /* 15 */
/* ---------------- /*
* set default storage for TOAST * set default storage for TOAST
* ----------------
*/ */
values[i++] = CharGetDatum(storage); /* 16 */ values[i++] = CharGetDatum(storage); /* 16 */
/* ---------------- /*
* initialize the default value for this type. * initialize the default value for this type.
* ----------------
*/ */
values[i] = DirectFunctionCall1(textin, /* 17 */ values[i] = DirectFunctionCall1(textin, /* 17 */
CStringGetDatum(defaultTypeValue ? defaultTypeValue : "-")); CStringGetDatum(defaultTypeValue ? defaultTypeValue : "-"));
/* ---------------- /*
* open pg_type and begin a scan for the type name. * open pg_type and begin a scan for the type name.
* ----------------
*/ */
pg_type_desc = heap_openr(TypeRelationName, RowExclusiveLock); pg_type_desc = heap_openr(TypeRelationName, RowExclusiveLock);
...@@ -478,11 +455,9 @@ TypeCreate(char *typeName, ...@@ -478,11 +455,9 @@ TypeCreate(char *typeName,
1, 1,
typeKey); typeKey);
/* ---------------- /*
* define the type either by adding a tuple to the type * define the type either by adding a tuple to the type relation, or
* relation, or by updating the fields of the "shell" tuple * by updating the fields of the "shell" tuple already there.
* already there.
* ----------------
*/ */
tup = heap_getnext(pg_type_scan, 0); tup = heap_getnext(pg_type_scan, 0);
if (HeapTupleIsValid(tup)) if (HeapTupleIsValid(tup))
...@@ -517,9 +492,8 @@ TypeCreate(char *typeName, ...@@ -517,9 +492,8 @@ TypeCreate(char *typeName,
typeObjectId = tup->t_data->t_oid; typeObjectId = tup->t_data->t_oid;
} }
/* ---------------- /*
* finish up * finish up
* ----------------
*/ */
heap_endscan(pg_type_scan); heap_endscan(pg_type_scan);
......
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.15 2001/03/22 03:59:20 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.16 2001/03/22 06:16:11 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -582,9 +582,8 @@ update_attstats(Oid relid, int natts, VacAttrStats *vacattrstats) ...@@ -582,9 +582,8 @@ update_attstats(Oid relid, int natts, VacAttrStats *vacattrstats)
for (i = 0; i < Natts_pg_statistic; ++i) for (i = 0; i < Natts_pg_statistic; ++i)
nulls[i] = ' '; nulls[i] = ' ';
/* ---------------- /*
* initialize values[] * initialize values[]
* ----------------
*/ */
i = 0; i = 0;
values[i++] = ObjectIdGetDatum(relid); /* starelid */ values[i++] = ObjectIdGetDatum(relid); /* starelid */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: stringinfo.c,v 1.27 2001/01/24 19:42:55 momjian Exp $ * $Id: stringinfo.c,v 1.28 2001/03/22 06:16:13 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -106,11 +106,11 @@ appendStringInfo(StringInfo str, const char *fmt,...) ...@@ -106,11 +106,11 @@ appendStringInfo(StringInfo str, const char *fmt,...)
for (;;) for (;;)
{ {
/*----------
* Try to format the given string into the available space; /*
* but if there's hardly any space, don't bother trying, * Try to format the given string into the available space; but if
* just fall through to enlarge the buffer first. * there's hardly any space, don't bother trying, just fall
*---------- * through to enlarge the buffer first.
*/ */
avail = str->maxlen - str->len - 1; avail = str->maxlen - str->len - 1;
if (avail > 16) if (avail > 16)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment