1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-26 12:21:12 +03:00

Change elog(WARN) to elog(ERROR) and elog(ABORT).

This commit is contained in:
Bruce Momjian
1998-01-05 03:35:55 +00:00
parent 0af9137f14
commit 0d9fc5afd6
188 changed files with 1436 additions and 1433 deletions

View File

@ -3,7 +3,7 @@
* geqo_erx.c--
* edge recombination crossover [ER]
*
* $Id: geqo_erx.c,v 1.5 1997/09/08 21:44:16 momjian Exp $
* $Id: geqo_erx.c,v 1.6 1998/01/05 03:31:48 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -353,7 +353,7 @@ gimme_gene(Edge edge, Edge *edge_table)
minimum_count = 1;
}
else if (minimum_count == -1)
elog(WARN, "gimme_gene: Internal error - minimum_count not set");
elog(ABORT, "gimme_gene: Internal error - minimum_count not set");
else if (edge_table[(int) friend].unused_edges == minimum_edges)
minimum_count++;
@ -379,7 +379,7 @@ gimme_gene(Edge edge, Edge *edge_table)
}
/* ... should never be reached */
elog(WARN, "gimme_gene: neither shared nor minimum number nor random edge found");
elog(ABORT, "gimme_gene: neither shared nor minimum number nor random edge found");
return 0; /* to keep the compiler quiet */
}
@ -487,6 +487,6 @@ edge_failure(Gene *gene, int index, Edge *edge_table, int num_gene)
/* ... should never be reached */
elog(WARN, "edge_failure: no edge detected");
elog(ABORT, "edge_failure: no edge detected");
return 0; /* to keep the compiler quiet */
}

View File

@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: geqo_eval.c,v 1.15 1997/09/08 21:44:19 momjian Exp $
* $Id: geqo_eval.c,v 1.16 1998/01/05 03:31:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -737,6 +737,6 @@ geqo_nth(int stop, List *rels)
return lfirst(r);
i++;
}
elog(WARN, "geqo_nth: Internal error - ran off end of list");
elog(ABORT, "geqo_nth: Internal error - ran off end of list");
return NULL; /* to keep compiler happy */
}

View File

@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: geqo_misc.c,v 1.5 1997/09/08 21:44:26 momjian Exp $
* $Id: geqo_misc.c,v 1.6 1998/01/05 03:31:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -53,7 +53,7 @@ avg_pool(Pool *pool)
double cumulative = 0.0;
if (pool->size == 0)
elog(WARN, "avg_pool: pool_size of zero");
elog(ABORT, "avg_pool: pool_size of zero");
for (i = 0; i < pool->size; i++)
cumulative = cumulative + pool->data[i].worth;

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/predmig.c,v 1.6 1997/09/08 21:45:07 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/predmig.c,v 1.7 1998/01/05 03:31:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -133,7 +133,7 @@ xfunc_predmig(JoinPath pathnode,/* root of the join tree */
/* sanity check */
if ((!streamroot && laststream) ||
(streamroot && !laststream))
elog(WARN, "called xfunc_predmig with bad inputs");
elog(ABORT, "called xfunc_predmig with bad inputs");
if (streamroot)
Assert(xfunc_check_stream(streamroot));
@ -333,7 +333,7 @@ xfunc_prdmig_pullup(Stream origstream, Stream pullme, JoinPath joinpath)
orignode = (Stream) get_downstream(orignode))
/* empty body in for loop */ ;
if (!orignode)
elog(WARN, "Didn't find matching node in original stream");
elog(ABORT, "Didn't find matching node in original stream");
/* pull up this node as far as it should go */
@ -790,14 +790,14 @@ xfunc_check_stream(Stream node)
{
if ((Stream) get_upstream((Stream) get_downstream(temp)) != temp)
{
elog(WARN, "bad pointers in stream");
elog(ABORT, "bad pointers in stream");
return (false);
}
if (!is_clause(temp))
{
if ((tmp = xfunc_num_relids(temp)) >= numrelids)
{
elog(WARN, "Joins got reordered!");
elog(ABORT, "Joins got reordered!");
return (false);
}
numrelids = tmp;

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.8 1997/12/23 03:27:23 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.9 1998/01/05 03:31:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -133,7 +133,7 @@ prune_rel_paths(List *rel_list)
rel->size = compute_joinrel_size(cheapest);
}
else
elog(WARN, "non JoinPath called");
elog(ABORT, "non JoinPath called");
}
}

View File

@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.9 1997/12/22 05:41:59 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.10 1998/01/05 03:31:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -461,7 +461,7 @@ xfunc_local_expense(LispValue clause)
}
else
{
elog(WARN, "Clause node of undetermined type");
elog(ABORT, "Clause node of undetermined type");
return (-1);
}
}
@ -497,7 +497,7 @@ xfunc_func_expense(LispValue node, LispValue args)
{
/* don't trust the opid in the Oper node. Use the opno. */
if (!(funcid = get_opcode(get_opno((Oper) node))))
elog(WARN, "Oper's function is undefined");
elog(ABORT, "Oper's function is undefined");
}
else
{
@ -507,7 +507,7 @@ xfunc_func_expense(LispValue node, LispValue args)
/* look up tuple in cache */
tupl = SearchSysCacheTuple(PROOID, ObjectIdGetDatum(funcid), 0, 0, 0);
if (!HeapTupleIsValid(tupl))
elog(WARN, "Cache lookup failed for procedure %d", funcid);
elog(ABORT, "Cache lookup failed for procedure %d", funcid);
proc = (Form_pg_proc) GETSTRUCT(tupl);
/*
@ -622,7 +622,7 @@ xfunc_width(LispValue clause)
PointerGetDatum(get_vartype((Var) clause)),
0, 0, 0);
if (!HeapTupleIsValid(tupl))
elog(WARN, "Cache lookup failed for type %d",
elog(ABORT, "Cache lookup failed for type %d",
get_vartype((Var) clause));
type = (TypeTupleForm) GETSTRUCT(tupl);
if (get_varattno((Var) clause) == 0)
@ -686,7 +686,7 @@ xfunc_width(LispValue clause)
ObjectIdGetDatum(get_opno((Oper) get_op(clause))),
0, 0, 0);
if (!HeapTupleIsValid(tupl))
elog(WARN, "Cache lookup failed for procedure %d",
elog(ABORT, "Cache lookup failed for procedure %d",
get_opno((Oper) get_op(clause)));
return (xfunc_func_width
((RegProcedure) (((OperatorTupleForm) (GETSTRUCT(tupl)))->oprcode),
@ -717,7 +717,7 @@ xfunc_width(LispValue clause)
}
else
{
elog(WARN, "Clause node of undetermined type");
elog(ABORT, "Clause node of undetermined type");
return (-1);
}
@ -855,7 +855,7 @@ xfunc_find_references(LispValue clause)
}
else
{
elog(WARN, "Clause node of undetermined type");
elog(ABORT, "Clause node of undetermined type");
return ((List) LispNil);
}
}
@ -1192,7 +1192,7 @@ xfunc_fixvars(LispValue clause, /* clause being pulled up */
xfunc_fixvars(lfirst(tmpclause), rel, varno);
else
{
elog(WARN, "Clause node of undetermined type");
elog(ABORT, "Clause node of undetermined type");
}
}
@ -1320,7 +1320,7 @@ xfunc_func_width(RegProcedure funcid, LispValue args)
Assert(RegProcedureIsValid(funcid));
tupl = SearchSysCacheTuple(PROOID, ObjectIdGetDatum(funcid), 0, 0, 0);
if (!HeapTupleIsValid(tupl))
elog(WARN, "Cache lookup failed for procedure %d", funcid);
elog(ABORT, "Cache lookup failed for procedure %d", funcid);
proc = (Form_pg_proc) GETSTRUCT(tupl);
/* if function returns a tuple, get the width of that */
@ -1338,7 +1338,7 @@ xfunc_func_width(RegProcedure funcid, LispValue args)
ObjectIdGetDatum(proc->prorettype),
0, 0, 0);
if (!HeapTupleIsValid(tupl))
elog(WARN, "Cache lookup failed for type %d", proc->prorettype);
elog(ABORT, "Cache lookup failed for type %d", proc->prorettype);
type = (TypeTupleForm) GETSTRUCT(tupl);
/* if the type length is known, return that */
if (type->typlen != -1)
@ -1421,7 +1421,7 @@ xfunc_LispRemove(LispValue foo, List bar)
sanity = true; /* found a matching item to remove! */
if (!sanity)
elog(WARN, "xfunc_LispRemove: didn't find a match!");
elog(ABORT, "xfunc_LispRemove: didn't find a match!");
return (result);
}

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.20 1997/12/18 12:54:04 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.21 1998/01/05 03:31:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -185,7 +185,7 @@ create_scan_node(Path *best_path, List *tlist)
break;
default:
elog(WARN, "create_scan_node: unknown node type",
elog(ABORT, "create_scan_node: unknown node type",
best_path->pathtype);
break;
}
@ -252,7 +252,7 @@ create_join_node(JoinPath *best_path, List *tlist)
break;
default:
/* do nothing */
elog(WARN, "create_join_node: unknown node type",
elog(ABORT, "create_join_node: unknown node type",
best_path->path.pathtype);
}
@ -294,7 +294,7 @@ create_seqscan_node(Path *best_path, List *tlist, List *scan_clauses)
temp = best_path->parent->relids;
if (temp == NULL)
elog(WARN, "scanrelid is empty");
elog(ABORT, "scanrelid is empty");
else
scan_relid = (Index) lfirsti(temp); /* ??? who takes care of
* lnext? - ay */
@ -364,7 +364,7 @@ create_indexscan_node(IndexPath *best_path,
ObjectIdGetDatum(lfirsti(ixid)),
0, 0, 0);
if (!HeapTupleIsValid(indexTuple))
elog(WARN, "create_plan: index %d not found",
elog(ABORT, "create_plan: index %d not found",
lfirsti(ixid));
index = (IndexTupleForm) GETSTRUCT(indexTuple);
if (index->indislossy)
@ -915,7 +915,7 @@ make_temp(List *tlist,
break;
default:
elog(WARN, "make_temp: unknown temp type %d", temptype);
elog(ABORT, "make_temp: unknown temp type %d", temptype);
}
return (retval);

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.13 1997/12/22 05:42:04 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.14 1998/01/05 03:32:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -407,7 +407,7 @@ make_groupPlan(List **tlist,
if (length(glc) != 0)
{
elog(WARN, "group attribute disappeared from target list");
elog(ABORT, "group attribute disappeared from target list");
}
/*

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.18 1997/12/29 01:12:45 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.19 1998/01/05 03:32:04 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -279,7 +279,7 @@ pg_checkretval(Oid rettype, QueryTreeList *queryTreeList)
if (rettype == InvalidOid)
return;
else
elog(WARN, "return type mismatch in function decl: final query is a catalog utility");
elog(ABORT, "return type mismatch in function decl: final query is a catalog utility");
}
/* okay, it's an ordinary query */
@ -294,7 +294,7 @@ pg_checkretval(Oid rettype, QueryTreeList *queryTreeList)
if (rettype == InvalidOid)
{
if (cmd == CMD_SELECT)
elog(WARN,
elog(ABORT,
"function declared with no return type, but final query is a retrieve");
else
return;
@ -302,14 +302,14 @@ pg_checkretval(Oid rettype, QueryTreeList *queryTreeList)
/* by here, the function is declared to return some type */
if ((typ = typeidType(rettype)) == NULL)
elog(WARN, "can't find return type %d for function\n", rettype);
elog(ABORT, "can't find return type %d for function\n", rettype);
/*
* test 3: if the function is declared to return a value, then the
* final query had better be a retrieve.
*/
if (cmd != CMD_SELECT)
elog(WARN, "function declared to return type %s, but final query is not a retrieve", typeTypeName(typ));
elog(ABORT, "function declared to return type %s, but final query is not a retrieve", typeTypeName(typ));
/*
* test 4: for base type returns, the target list should have exactly
@ -319,11 +319,11 @@ pg_checkretval(Oid rettype, QueryTreeList *queryTreeList)
if (typeTypeRelid(typ) == InvalidOid)
{
if (exec_tlist_length(tlist) > 1)
elog(WARN, "function declared to return %s returns multiple values in final retrieve", typeTypeName(typ));
elog(ABORT, "function declared to return %s returns multiple values in final retrieve", typeTypeName(typ));
resnode = (Resdom *) ((TargetEntry *) lfirst(tlist))->resdom;
if (resnode->restype != rettype)
elog(WARN, "return type mismatch in function: declared to return %s, returns %s", typeTypeName(typ), typeidTypeName(resnode->restype));
elog(ABORT, "return type mismatch in function: declared to return %s, returns %s", typeTypeName(typ), typeidTypeName(resnode->restype));
/* by here, base return types match */
return;
@ -352,13 +352,13 @@ pg_checkretval(Oid rettype, QueryTreeList *queryTreeList)
reln = heap_open(typeTypeRelid(typ));
if (!RelationIsValid(reln))
elog(WARN, "cannot open relation relid %d", typeTypeRelid(typ));
elog(ABORT, "cannot open relation relid %d", typeTypeRelid(typ));
relid = reln->rd_id;
relnatts = reln->rd_rel->relnatts;
if (exec_tlist_length(tlist) != relnatts)
elog(WARN, "function declared to return type %s does not retrieve (%s.*)", typeTypeName(typ), typeTypeName(typ));
elog(ABORT, "function declared to return type %s does not retrieve (%s.*)", typeTypeName(typ), typeTypeName(typ));
/* expect attributes 1 .. n in order */
for (i = 1; i <= relnatts; i++)
@ -388,14 +388,14 @@ pg_checkretval(Oid rettype, QueryTreeList *queryTreeList)
else if (IsA(thenode, Func))
tletype = (Oid) get_functype((Func *) thenode);
else
elog(WARN, "function declared to return type %s does not retrieve (%s.all)", typeTypeName(typ), typeTypeName(typ));
elog(ABORT, "function declared to return type %s does not retrieve (%s.all)", typeTypeName(typ), typeTypeName(typ));
}
else
elog(WARN, "function declared to return type %s does not retrieve (%s.all)", typeTypeName(typ), typeTypeName(typ));
elog(ABORT, "function declared to return type %s does not retrieve (%s.all)", typeTypeName(typ), typeTypeName(typ));
#endif
/* reach right in there, why don't you? */
if (tletype != reln->rd_att->attrs[i - 1]->atttypid)
elog(WARN, "function declared to return type %s does not retrieve (%s.all)", typeTypeName(typ), typeTypeName(typ));
elog(ABORT, "function declared to return type %s does not retrieve (%s.all)", typeTypeName(typ), typeTypeName(typ));
}
heap_close(reln);

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.10 1997/12/22 05:42:10 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.11 1998/01/05 03:32:05 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -201,7 +201,7 @@ set_temp_tlist_references(Temp *temp)
}
else
{
elog(WARN, "calling set_temp_tlist_references with empty lefttree");
elog(ABORT, "calling set_temp_tlist_references with empty lefttree");
}
}
@ -651,7 +651,7 @@ replace_result_clause(List *clause,
/*
* Ooops! we can not handle that!
*/
elog(WARN, "replace_result_clause: Can not handle this tlist!\n");
elog(ABORT, "replace_result_clause: Can not handle this tlist!\n");
}
}
@ -809,7 +809,7 @@ replace_agg_clause(Node *clause, List *subplanTargetList)
/*
* Ooops! we can not handle that!
*/
elog(WARN, "replace_agg_clause: Can not handle this tlist!\n");
elog(ABORT, "replace_agg_clause: Can not handle this tlist!\n");
}
}
@ -902,7 +902,7 @@ del_agg_clause(Node *clause)
/*
* Ooops! we can not handle that!
*/
elog(WARN, "del_agg_clause: Can not handle this tlist!\n");
elog(ABORT, "del_agg_clause: Can not handle this tlist!\n");
}
return NULL;
}

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.11 1997/11/20 23:22:01 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.12 1998/01/05 03:32:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -77,7 +77,7 @@ relation_info(Query *root, Index relid,
}
else
{
elog(WARN, "RelationCatalogInformation: Relation %d not found",
elog(ABORT, "RelationCatalogInformation: Relation %d not found",
relationObjectId);
}
@ -152,7 +152,7 @@ index_info(Query *root, bool first, int relid, IdxInfoRetval *info)
1, &indexKey);
}
if (!HeapScanIsValid(scan))
elog(WARN, "index_info: scan not started");
elog(ABORT, "index_info: scan not started");
indexTuple = heap_getnext(scan, 0, (Buffer *) NULL);
if (!HeapTupleIsValid(indexTuple))
{
@ -218,7 +218,7 @@ index_info(Query *root, bool first, int relid, IdxInfoRetval *info)
UInt16GetDatum(amstrategy),
0);
if (!HeapTupleIsValid(amopTuple))
elog(WARN, "index_info: no amop %d %d %d",
elog(ABORT, "index_info: no amop %d %d %d",
relam, index->indclass[i], amstrategy);
info->orderOprs[i] =
((Form_pg_amop) GETSTRUCT(amopTuple))->amopopr;
@ -349,10 +349,10 @@ restriction_selectivity(Oid functionObjectId,
(char *) constFlag,
NULL);
if (!PointerIsValid(result))
elog(WARN, "RestrictionClauseSelectivity: bad pointer");
elog(ABORT, "RestrictionClauseSelectivity: bad pointer");
if (*result < 0.0 || *result > 1.0)
elog(WARN, "RestrictionClauseSelectivity: bad value %lf",
elog(ABORT, "RestrictionClauseSelectivity: bad value %lf",
*result);
return ((Cost) *result);
@ -388,10 +388,10 @@ join_selectivity(Oid functionObjectId,
(char *) (int) attributeNumber2,
NULL);
if (!PointerIsValid(result))
elog(WARN, "JoinClauseSelectivity: bad pointer");
elog(ABORT, "JoinClauseSelectivity: bad pointer");
if (*result < 0.0 || *result > 1.0)
elog(WARN, "JoinClauseSelectivity: bad value %lf",
elog(ABORT, "JoinClauseSelectivity: bad value %lf",
*result);
return ((Cost) *result);
@ -532,7 +532,7 @@ IndexSelectivity(Oid indexrelid,
ObjectIdGetDatum(indexrelid),
0, 0, 0);
if (!HeapTupleIsValid(indRel))
elog(WARN, "IndexSelectivity: index %d not found",
elog(ABORT, "IndexSelectivity: index %d not found",
indexrelid);
relam = ((Form_pg_class) GETSTRUCT(indRel))->relam;
@ -540,7 +540,7 @@ IndexSelectivity(Oid indexrelid,
ObjectIdGetDatum(indexrelid),
0, 0, 0);
if (!HeapTupleIsValid(indexTuple))
elog(WARN, "IndexSelectivity: index %d not found",
elog(ABORT, "IndexSelectivity: index %d not found",
indexrelid);
index = (IndexTupleForm) GETSTRUCT(indexTuple);
@ -595,7 +595,7 @@ IndexSelectivity(Oid indexrelid,
ObjectIdGetDatum(relam),
0);
if (!HeapTupleIsValid(amopTuple))
elog(WARN, "IndexSelectivity: no amop %d %d",
elog(ABORT, "IndexSelectivity: no amop %d %d",
indclass, operatorObjectIds[n]);
amop = (Form_pg_amop) GETSTRUCT(amopTuple);