1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

Error message editing in backend/bootstrap, /lib, /nodes, /port.

This commit is contained in:
Tom Lane
2003-07-22 23:30:39 +00:00
parent 56f87688c4
commit c72839d5be
21 changed files with 121 additions and 113 deletions

View File

@@ -14,7 +14,7 @@
* Copyright (c) 2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/bitmapset.c,v 1.2 2003/06/29 23:05:04 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/bitmapset.c,v 1.3 2003/07/22 23:30:37 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -184,7 +184,7 @@ bms_make_singleton(int x)
bitnum;
if (x < 0)
elog(ERROR, "bms_make_singleton: negative set member not allowed");
elog(ERROR, "negative bitmapset member not allowed");
wordnum = WORDNUM(x);
bitnum = BITNUM(x);
result = (Bitmapset *) palloc0(BITMAPSET_SIZE(wordnum + 1));
@@ -354,7 +354,7 @@ bms_is_member(int x, const Bitmapset *a)
/* XXX better to just return false for x<0 ? */
if (x < 0)
elog(ERROR, "bms_is_member: negative set member not allowed");
elog(ERROR, "negative bitmapset member not allowed");
if (a == NULL)
return false;
wordnum = WORDNUM(x);
@@ -431,7 +431,7 @@ bms_singleton_member(const Bitmapset *a)
int wordnum;
if (a == NULL)
elog(ERROR, "bms_singleton_member: set is empty");
elog(ERROR, "bitmapset is empty");
nwords = a->nwords;
for (wordnum = 0; wordnum < nwords; wordnum++)
{
@@ -440,7 +440,7 @@ bms_singleton_member(const Bitmapset *a)
if (w != 0)
{
if (result >= 0 || HAS_MULTIPLE_ONES(w))
elog(ERROR, "bms_singleton_member: set has multiple members");
elog(ERROR, "bitmapset has multiple members");
result = wordnum * BITS_PER_BITMAPWORD;
while ((w & 255) == 0)
{
@@ -451,7 +451,7 @@ bms_singleton_member(const Bitmapset *a)
}
}
if (result < 0)
elog(ERROR, "bms_singleton_member: set is empty");
elog(ERROR, "bitmapset is empty");
return result;
}
@@ -558,7 +558,7 @@ bms_add_member(Bitmapset *a, int x)
bitnum;
if (x < 0)
elog(ERROR, "bms_add_member: negative set member not allowed");
elog(ERROR, "negative bitmapset member not allowed");
if (a == NULL)
return bms_make_singleton(x);
wordnum = WORDNUM(x);
@@ -598,7 +598,7 @@ bms_del_member(Bitmapset *a, int x)
bitnum;
if (x < 0)
elog(ERROR, "bms_del_member: negative set member not allowed");
elog(ERROR, "negative bitmapset member not allowed");
if (a == NULL)
return NULL;
wordnum = WORDNUM(x);

View File

@@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.259 2003/07/03 16:32:20 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.260 2003/07/22 23:30:37 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1328,7 +1328,8 @@ _copyAConst(A_Const *from)
/* nothing to do */
break;
default:
elog(ERROR, "_copyAConst: unknown node type %d", from->val.type);
elog(ERROR, "unrecognized node type: %d",
(int) from->val.type);
break;
}
@@ -2443,7 +2444,8 @@ _copyValue(Value *from)
/* nothing to do */
break;
default:
elog(ERROR, "_copyValue: unknown node type %d", from->type);
elog(ERROR, "unrecognized node type: %d",
(int) from->type);
break;
}
return newnode;
@@ -2966,8 +2968,7 @@ copyObject(void *from)
break;
default:
elog(ERROR, "copyObject: don't know how to copy node type %d",
nodeTag(from));
elog(ERROR, "unrecognized node type: %d", (int) nodeTag(from));
retval = from; /* keep compiler quiet */
break;
}

View File

@@ -18,7 +18,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.202 2003/07/03 16:32:32 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.203 2003/07/22 23:30:37 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -189,7 +189,7 @@ _equalParam(Param *a, Param *b)
COMPARE_SCALAR_FIELD(paramid);
break;
default:
elog(ERROR, "_equalParam: Invalid paramkind value: %d",
elog(ERROR, "unrecognized paramkind value: %d",
a->paramkind);
}
@@ -1616,7 +1616,7 @@ _equalValue(Value *a, Value *b)
/* nothing to do */
break;
default:
elog(ERROR, "_equalValue: unknown node type %d", a->type);
elog(ERROR, "unrecognized node type: %d", (int) a->type);
break;
}
@@ -1630,7 +1630,7 @@ _equalValue(Value *a, Value *b)
bool
equal(void *a, void *b)
{
bool retval = false;
bool retval;
if (a == b)
return true;
@@ -2081,8 +2081,9 @@ equal(void *a, void *b)
break;
default:
elog(WARNING, "equal: don't know whether nodes of type %d are equal",
nodeTag(a));
elog(ERROR, "unrecognized node type: %d",
(int) nodeTag(a));
retval = false; /* keep compiler quiet */
break;
}

View File

@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.50 2003/06/15 22:51:45 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.51 2003/07/22 23:30:37 tgl Exp $
*
* NOTES
* XXX a few of the following functions are duplicated to handle
@@ -186,7 +186,7 @@ nconc(List *l1, List *l2)
if (l2 == NIL)
return l1;
if (l1 == l2)
elog(ERROR, "can't nconc a list to itself");
elog(ERROR, "cannot nconc a list to itself");
for (temp = l1; lnext(temp) != NIL; temp = lnext(temp))
;
@@ -352,7 +352,7 @@ void *
llast(List *l)
{
if (l == NIL)
elog(ERROR, "llast: empty list");
elog(ERROR, "empty list does not have a last item");
while (lnext(l) != NIL)
l = lnext(l);
return lfirst(l);

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.212 2003/07/03 16:32:38 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.213 2003/07/22 23:30:37 tgl Exp $
*
* NOTES
* Every node type that can appear in stored rules' parsetrees *must*
@@ -1322,7 +1322,7 @@ _outRangeTblEntry(StringInfo str, RangeTblEntry *node)
WRITE_NODE_FIELD(joinaliasvars);
break;
default:
elog(ERROR, "bogus rte kind %d", (int) node->rtekind);
elog(ERROR, "unrecognized rte kind: %d", (int) node->rtekind);
break;
}
@@ -1410,8 +1410,7 @@ _outValue(StringInfo str, Value *value)
appendStringInfo(str, "%s", value->val.str);
break;
default:
elog(WARNING, "_outValue: don't know how to print type %d",
value->type);
elog(ERROR, "unrecognized node type: %d", (int) value->type);
break;
}
}
@@ -1821,8 +1820,12 @@ _outNode(StringInfo str, void *obj)
break;
default:
elog(WARNING, "_outNode: don't know how to print type %d",
nodeTag(obj));
/*
* This should be an ERROR, but it's too useful to be able
* to dump structures that _outNode only understands part of.
*/
elog(WARNING, "could not dump unrecognized node type: %d",
(int) nodeTag(obj));
break;
}
appendStringInfoChar(str, '}');

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.61 2003/05/06 00:20:32 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.62 2003/07/22 23:30:37 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -82,7 +82,9 @@ elog_node_display(int lev, const char *title, void *obj, bool pretty)
else
f = format_node_dump(s);
pfree(s);
elog(lev, "%s:\n%s", title, f);
ereport(lev,
(errmsg_internal("%s:", title),
errdetail("%s", f)));
pfree(f);
}
@@ -350,7 +352,7 @@ print_expr(Node *expr, List *rtable)
ObjectIdGetDatum(c->consttype),
0, 0, 0);
if (!HeapTupleIsValid(typeTup))
elog(ERROR, "Cache lookup for type %u failed", c->consttype);
elog(ERROR, "cache lookup failed for type %u", c->consttype);
typoutput = ((Form_pg_type) GETSTRUCT(typeTup))->typoutput;
typelem = ((Form_pg_type) GETSTRUCT(typeTup))->typelem;
ReleaseSysCache(typeTup);

View File

@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/read.c,v 1.33 2002/11/25 18:12:10 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/read.c,v 1.34 2003/07/22 23:30:38 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -293,7 +293,7 @@ nodeRead(bool read_car_only)
this_value = parseNodeString();
token = pg_strtok(&tok_len);
if (token == NULL || token[0] != '}')
elog(ERROR, "nodeRead: did not find '}' at end of node");
elog(ERROR, "did not find '}' at end of input node");
if (!read_car_only)
make_dotted_pair_cell = true;
else
@@ -373,7 +373,7 @@ nodeRead(bool read_car_only)
break;
}
default:
elog(ERROR, "nodeRead: Bad type %d", type);
elog(ERROR, "unrecognized node type: %d", (int) type);
this_value = NULL; /* keep compiler happy */
break;
}

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.158 2003/07/03 16:32:39 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.159 2003/07/22 23:30:38 tgl Exp $
*
* NOTES
* Path and Plan nodes do not have any readfuncs support, because we
@@ -146,7 +146,7 @@ toIntList(List *list)
Value *v = (Value *) lfirst(l);
if (!IsA(v, Integer))
elog(ERROR, "toIntList: unexpected datatype");
elog(ERROR, "unexpected node type: %d", (int) nodeTag(v));
lfirsti(l) = intVal(v);
pfree(v);
}
@@ -180,7 +180,7 @@ toOidList(List *list)
pfree(v);
}
else
elog(ERROR, "toOidList: unexpected datatype");
elog(ERROR, "unexpected node type: %d", (int) nodeTag(v));
}
return list;
}
@@ -554,7 +554,7 @@ _readBoolExpr(void)
else if (strncmp(token, "not", 3) == 0)
local_node->boolop = NOT_EXPR;
else
elog(ERROR, "_readBoolExpr: unknown boolop \"%.*s\"", length, token);
elog(ERROR, "unrecognized boolop \"%.*s\"", length, token);
READ_NODE_FIELD(args);
@@ -928,7 +928,8 @@ _readRangeTblEntry(void)
READ_NODE_FIELD(joinaliasvars);
break;
default:
elog(ERROR, "bogus rte kind %d", (int) local_node->rtekind);
elog(ERROR, "unrecognized RTE kind: %d",
(int) local_node->rtekind);
break;
}
@@ -1078,14 +1079,14 @@ readDatum(bool typbyval)
token = pg_strtok(&tokenLength); /* read the '[' */
if (token == NULL || token[0] != '[')
elog(ERROR, "readDatum: expected '%s', got '%s'; length = %lu",
"[", token ? (const char *) token : "[NULL]",
elog(ERROR, "expected \"[\" to start datum, but got \"%s\"; length = %lu",
token ? (const char *) token : "[NULL]",
(unsigned long) length);
if (typbyval)
{
if (length > (Size) sizeof(Datum))
elog(ERROR, "readDatum: byval & length = %lu",
elog(ERROR, "byval datum but length = %lu",
(unsigned long) length);
res = (Datum) 0;
s = (char *) (&res);
@@ -1110,8 +1111,8 @@ readDatum(bool typbyval)
token = pg_strtok(&tokenLength); /* read the ']' */
if (token == NULL || token[0] != ']')
elog(ERROR, "readDatum: expected '%s', got '%s'; length = %lu",
"]", token ? (const char *) token : "[NULL]",
elog(ERROR, "expected \"]\" to end datum, but got \"%s\"; length = %lu",
token ? (const char *) token : "[NULL]",
(unsigned long) length);
return res;