mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Change elog(WARN) to elog(ERROR) and elog(ABORT).
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.21 1997/12/29 05:13:57 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.22 1998/01/05 03:33:53 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -54,7 +54,7 @@ getid(char *s, char *n)
|
||||
for (id = s, len = 0; isalnum(*s) || *s == '_'; ++len, ++s)
|
||||
;
|
||||
if (len > sizeof(NameData))
|
||||
elog(WARN, "getid: identifier cannot be >%d characters",
|
||||
elog(ABORT, "getid: identifier cannot be >%d characters",
|
||||
sizeof(NameData));
|
||||
if (len > 0)
|
||||
memmove(n, id, len);
|
||||
@@ -102,11 +102,11 @@ aclparse(char *s, AclItem *aip, unsigned *modechg)
|
||||
}
|
||||
else if (strcmp(name, ACL_IDTYPE_UID_KEYWORD))
|
||||
{
|
||||
elog(WARN, "aclparse: bad keyword, must be [group|user]");
|
||||
elog(ABORT, "aclparse: bad keyword, must be [group|user]");
|
||||
}
|
||||
s = getid(s, name); /* move s to the name beyond the keyword */
|
||||
if (name[0] == '\0')
|
||||
elog(WARN, "aclparse: a name must follow the [group|user] keyword");
|
||||
elog(ABORT, "aclparse: a name must follow the [group|user] keyword");
|
||||
}
|
||||
if (name[0] == '\0')
|
||||
aip->ai_idtype = ACL_IDTYPE_WORLD;
|
||||
@@ -123,7 +123,7 @@ aclparse(char *s, AclItem *aip, unsigned *modechg)
|
||||
*modechg = ACL_MODECHG_EQL;
|
||||
break;
|
||||
default:
|
||||
elog(WARN, "aclparse: mode change flag must use \"%s\"",
|
||||
elog(ABORT, "aclparse: mode change flag must use \"%s\"",
|
||||
ACL_MODECHG_STR);
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ aclparse(char *s, AclItem *aip, unsigned *modechg)
|
||||
aip->ai_mode |= ACL_RU;
|
||||
break;
|
||||
default:
|
||||
elog(WARN, "aclparse: mode flags must use \"%s\"",
|
||||
elog(ABORT, "aclparse: mode flags must use \"%s\"",
|
||||
ACL_MODE_STR);
|
||||
}
|
||||
}
|
||||
@@ -156,7 +156,7 @@ aclparse(char *s, AclItem *aip, unsigned *modechg)
|
||||
htp = SearchSysCacheTuple(USENAME, PointerGetDatum(name),
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(htp))
|
||||
elog(WARN, "aclparse: non-existent user \"%s\"", name);
|
||||
elog(ABORT, "aclparse: non-existent user \"%s\"", name);
|
||||
aip->ai_id = ((Form_pg_user) GETSTRUCT(htp))->usesysid;
|
||||
break;
|
||||
case ACL_IDTYPE_GID:
|
||||
@@ -188,10 +188,10 @@ makeacl(int n)
|
||||
Size size;
|
||||
|
||||
if (n < 0)
|
||||
elog(WARN, "makeacl: invalid size: %d\n", n);
|
||||
elog(ABORT, "makeacl: invalid size: %d\n", n);
|
||||
size = ACL_N_SIZE(n);
|
||||
if (!(new_acl = (Acl *) palloc(size)))
|
||||
elog(WARN, "makeacl: palloc failed on %d\n", size);
|
||||
elog(ABORT, "makeacl: palloc failed on %d\n", size);
|
||||
MemSet((char *) new_acl, 0, size);
|
||||
new_acl->size = size;
|
||||
new_acl->ndim = 1;
|
||||
@@ -216,18 +216,18 @@ aclitemin(char *s)
|
||||
AclItem *aip;
|
||||
|
||||
if (!s)
|
||||
elog(WARN, "aclitemin: null string");
|
||||
elog(ABORT, "aclitemin: null string");
|
||||
|
||||
aip = (AclItem *) palloc(sizeof(AclItem));
|
||||
if (!aip)
|
||||
elog(WARN, "aclitemin: palloc failed");
|
||||
elog(ABORT, "aclitemin: palloc failed");
|
||||
s = aclparse(s, aip, &modechg);
|
||||
if (modechg != ACL_MODECHG_EQL)
|
||||
elog(WARN, "aclitemin: cannot accept anything but = ACLs");
|
||||
elog(ABORT, "aclitemin: cannot accept anything but = ACLs");
|
||||
while (isspace(*s))
|
||||
++s;
|
||||
if (*s)
|
||||
elog(WARN, "aclitemin: extra garbage at end of specification");
|
||||
elog(ABORT, "aclitemin: extra garbage at end of specification");
|
||||
return (aip);
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ aclitemout(AclItem *aip)
|
||||
|
||||
p = out = palloc(strlen("group =arwR ") + 1 + NAMEDATALEN);
|
||||
if (!out)
|
||||
elog(WARN, "aclitemout: palloc failed");
|
||||
elog(ABORT, "aclitemout: palloc failed");
|
||||
*p = '\0';
|
||||
|
||||
switch (aip->ai_idtype)
|
||||
@@ -296,7 +296,7 @@ aclitemout(AclItem *aip)
|
||||
case ACL_IDTYPE_WORLD:
|
||||
break;
|
||||
default:
|
||||
elog(WARN, "aclitemout: bad ai_idtype: %d", aip->ai_idtype);
|
||||
elog(ABORT, "aclitemout: bad ai_idtype: %d", aip->ai_idtype);
|
||||
break;
|
||||
}
|
||||
while (*p)
|
||||
@@ -420,7 +420,7 @@ aclinsert3(Acl *old_acl, AclItem *mod_aip, unsigned modechg)
|
||||
new_aip = ACL_DAT(new_acl);
|
||||
if (dst == 0)
|
||||
{ /* start */
|
||||
elog(WARN, "aclinsert3: insertion before world ACL??");
|
||||
elog(ABORT, "aclinsert3: insertion before world ACL??");
|
||||
}
|
||||
else if (dst >= num)
|
||||
{ /* end */
|
||||
@@ -534,7 +534,7 @@ aclremove(Acl *old_acl, AclItem *mod_aip)
|
||||
new_aip = ACL_DAT(new_acl);
|
||||
if (dst == 0)
|
||||
{ /* start */
|
||||
elog(WARN, "aclremove: removal of the world ACL??");
|
||||
elog(ABORT, "aclremove: removal of the world ACL??");
|
||||
}
|
||||
else if (dst == old_num - 1)
|
||||
{ /* end */
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.21 1997/12/06 22:57:10 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.22 1998/01/05 03:33:54 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -145,14 +145,14 @@ array_in(char *string, /* input array in external form */
|
||||
}
|
||||
for (q = p; isdigit(*q); q++);
|
||||
if (*q != ']')
|
||||
elog(WARN, "array_in: missing ']' in array declaration");
|
||||
elog(ABORT, "array_in: missing ']' in array declaration");
|
||||
*q = '\0';
|
||||
dim[ndim] = atoi(p);
|
||||
if ((dim[ndim] < 0) || (lBound[ndim] < 0))
|
||||
elog(WARN, "array_in: array dimensions need to be positive");
|
||||
elog(ABORT, "array_in: array dimensions need to be positive");
|
||||
dim[ndim] = dim[ndim] - lBound[ndim] + 1;
|
||||
if (dim[ndim] < 0)
|
||||
elog(WARN, "array_in: upper_bound cannot be < lower_bound");
|
||||
elog(ABORT, "array_in: upper_bound cannot be < lower_bound");
|
||||
p = q + 1;
|
||||
ndim++;
|
||||
}
|
||||
@@ -171,7 +171,7 @@ array_in(char *string, /* input array in external form */
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(WARN, "array_in: Need to specify dimension");
|
||||
elog(ABORT, "array_in: Need to specify dimension");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -179,7 +179,7 @@ array_in(char *string, /* input array in external form */
|
||||
while (isspace(*p))
|
||||
p++;
|
||||
if (strncmp(p, ASSGN, strlen(ASSGN)))
|
||||
elog(WARN, "array_in: missing assignment operator");
|
||||
elog(ABORT, "array_in: missing assignment operator");
|
||||
p += strlen(ASSGN);
|
||||
while (isspace(*p))
|
||||
p++;
|
||||
@@ -249,7 +249,7 @@ array_in(char *string, /* input array in external form */
|
||||
memmove((char *) ARR_LBOUND(retval), (char *) lBound, ndim * sizeof(int));
|
||||
memmove(ARR_DATA_PTR(retval), dataPtr, bytes);
|
||||
#endif
|
||||
elog(WARN, "large object arrays not supported");
|
||||
elog(ABORT, "large object arrays not supported");
|
||||
}
|
||||
pfree(string_save);
|
||||
return ((char *) retval);
|
||||
@@ -302,7 +302,7 @@ _ArrayCount(char *str, int dim[], int typdelim)
|
||||
* Signal a premature end of the string. DZ -
|
||||
* 2-9-1996
|
||||
*/
|
||||
elog(WARN, "malformed array constant: %s", str);
|
||||
elog(ABORT, "malformed array constant: %s", str);
|
||||
break;
|
||||
case '\"':
|
||||
scanning_string = !scanning_string;
|
||||
@@ -425,7 +425,7 @@ _ReadArrayStr(char *arrayStr,
|
||||
p++;
|
||||
nest_level++;
|
||||
if (nest_level > ndim)
|
||||
elog(WARN, "array_in: illformed array constant");
|
||||
elog(ABORT, "array_in: illformed array constant");
|
||||
indx[nest_level - 1] = 0;
|
||||
indx[ndim - 1] = 0;
|
||||
}
|
||||
@@ -460,7 +460,7 @@ _ReadArrayStr(char *arrayStr,
|
||||
}
|
||||
*q = '\0';
|
||||
if (i >= nitems)
|
||||
elog(WARN, "array_in: illformed array constant");
|
||||
elog(ABORT, "array_in: illformed array constant");
|
||||
values[i] = (*inputproc) (p, typelem);
|
||||
p = ++q;
|
||||
if (!eoArray)
|
||||
@@ -544,27 +544,27 @@ _ReadLOArray(char *str,
|
||||
if (!strcmp(word, "-chunk"))
|
||||
{
|
||||
if (str == NULL)
|
||||
elog(WARN, "array_in: access pattern file required");
|
||||
elog(ABORT, "array_in: access pattern file required");
|
||||
str = _AdvanceBy1word(str, &accessfile);
|
||||
}
|
||||
else if (!strcmp(word, "-noreorg"))
|
||||
{
|
||||
if (str == NULL)
|
||||
elog(WARN, "array_in: chunk file required");
|
||||
elog(ABORT, "array_in: chunk file required");
|
||||
str = _AdvanceBy1word(str, &chunkfile);
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(WARN, "usage: <input file> -chunk DEFAULT/<access pattern file> -invert/-native [-noreorg <chunk file>]");
|
||||
elog(ABORT, "usage: <input file> -chunk DEFAULT/<access pattern file> -invert/-native [-noreorg <chunk file>]");
|
||||
}
|
||||
}
|
||||
|
||||
if (inputfile == NULL)
|
||||
elog(WARN, "array_in: missing file name");
|
||||
elog(ABORT, "array_in: missing file name");
|
||||
lobjId = lo_creat(0);
|
||||
*fd = lo_open(lobjId, INV_READ);
|
||||
if (*fd < 0)
|
||||
elog(WARN, "Large object create failed");
|
||||
elog(ABORT, "Large object create failed");
|
||||
retStr = inputfile;
|
||||
*nbytes = strlen(retStr) + 2;
|
||||
|
||||
@@ -573,7 +573,7 @@ _ReadLOArray(char *str,
|
||||
FILE *afd;
|
||||
|
||||
if ((afd = AllocateFile(accessfile, "r")) == NULL)
|
||||
elog(WARN, "unable to open access pattern file");
|
||||
elog(ABORT, "unable to open access pattern file");
|
||||
*chunkFlag = true;
|
||||
retStr = _ChunkArray(*fd, afd, ndim, dim, baseSize, nbytes,
|
||||
chunkfile);
|
||||
@@ -836,7 +836,7 @@ array_ref(ArrayType *array,
|
||||
* fixed length arrays -- these are assumed to be 1-d
|
||||
*/
|
||||
if (indx[0] * elmlen > arraylen)
|
||||
elog(WARN, "array_ref: array bound exceeded");
|
||||
elog(ABORT, "array_ref: array bound exceeded");
|
||||
retval = (char *) array + indx[0] * elmlen;
|
||||
return _ArrayCast(retval, reftype, elmlen);
|
||||
}
|
||||
@@ -964,7 +964,7 @@ array_clip(ArrayType *array,
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
if (lowerIndx[i] > upperIndx[i])
|
||||
elog(WARN, "lowerIndex cannot be larger than upperIndx");
|
||||
elog(ABORT, "lowerIndex cannot be larger than upperIndx");
|
||||
mda_get_range(n, span, lowerIndx, upperIndx);
|
||||
|
||||
if (ARR_IS_LO(array))
|
||||
@@ -980,7 +980,7 @@ array_clip(ArrayType *array,
|
||||
rsize;
|
||||
|
||||
if (len < 0)
|
||||
elog(WARN, "array_clip: array of variable length objects not supported");
|
||||
elog(ABORT, "array_clip: array of variable length objects not supported");
|
||||
#ifdef LOARRAY
|
||||
lo_name = (char *) ARR_DATA_PTR(array);
|
||||
if ((fd = LOopen(lo_name, ARR_IS_INV(array) ? INV_READ : O_RDONLY)) < 0)
|
||||
@@ -1098,7 +1098,7 @@ array_set(ArrayType *array,
|
||||
* fixed length arrays -- these are assumed to be 1-d
|
||||
*/
|
||||
if (indx[0] * elmlen > arraylen)
|
||||
elog(WARN, "array_ref: array bound exceeded");
|
||||
elog(ABORT, "array_ref: array bound exceeded");
|
||||
pos = (char *) array + indx[0] * elmlen;
|
||||
ArrayCastAndSet(dataPtr, (bool) reftype, elmlen, pos);
|
||||
return ((char *) array);
|
||||
@@ -1110,7 +1110,7 @@ array_set(ArrayType *array,
|
||||
|
||||
if (!SanityCheckInput(ndim, n, dim, lb, indx))
|
||||
{
|
||||
elog(WARN, "array_set: array bound exceeded");
|
||||
elog(ABORT, "array_set: array bound exceeded");
|
||||
return ((char *) array);
|
||||
}
|
||||
offset = GetOffset(n, dim, lb, indx);
|
||||
@@ -1225,7 +1225,7 @@ array_assgn(ArrayType *array,
|
||||
if (array == (ArrayType *) NULL)
|
||||
RETURN_NULL;
|
||||
if (len < 0)
|
||||
elog(WARN, "array_assgn:updates on arrays of variable length elements not allowed");
|
||||
elog(ABORT, "array_assgn:updates on arrays of variable length elements not allowed");
|
||||
|
||||
dim = ARR_DIMS(array);
|
||||
lb = ARR_LBOUND(array);
|
||||
@@ -1239,7 +1239,7 @@ array_assgn(ArrayType *array,
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
if (lowerIndx[i] > upperIndx[i])
|
||||
elog(WARN, "lowerIndex larger than upperIndx");
|
||||
elog(ABORT, "lowerIndex larger than upperIndx");
|
||||
|
||||
if (ARR_IS_LO(array))
|
||||
{
|
||||
@@ -1315,7 +1315,7 @@ system_cache_lookup(Oid element_type,
|
||||
|
||||
if (!HeapTupleIsValid(typeTuple))
|
||||
{
|
||||
elog(WARN, "array_out: Cache lookup failed for type %d\n",
|
||||
elog(ABORT, "array_out: Cache lookup failed for type %d\n",
|
||||
element_type);
|
||||
return;
|
||||
}
|
||||
@@ -1350,7 +1350,7 @@ _ArrayCast(char *value, bool byval, int len)
|
||||
case 4:
|
||||
return ((Datum) *(int32 *) value);
|
||||
default:
|
||||
elog(WARN, "array_ref: byval and elt len > 4!");
|
||||
elog(ABORT, "array_ref: byval and elt len > 4!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1734,7 +1734,7 @@ _array_newLO(int *fd, int flag)
|
||||
strcpy(saveName, p);
|
||||
#ifdef LOARRAY
|
||||
if ((*fd = LOcreat(saveName, 0600, flag)) < 0)
|
||||
elog(WARN, "Large object create failed");
|
||||
elog(ABORT, "Large object create failed");
|
||||
#endif
|
||||
return (p);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/bool.c,v 1.11 1997/11/07 06:30:20 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/bool.c,v 1.12 1998/01/05 03:33:55 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -72,7 +72,7 @@ boolin(char *b)
|
||||
break;
|
||||
}
|
||||
|
||||
elog(WARN,"Bad boolean external representation '%s'", b);
|
||||
elog(ABORT,"Bad boolean external representation '%s'", b);
|
||||
/* not reached */
|
||||
return (FALSE);
|
||||
} /* boolin() */
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* workings can be found in the book "Software Solutions in C" by
|
||||
* Dale Schumacher, Academic Press, ISBN: 0-12-632360-7.
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.18 1997/10/25 05:11:06 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.19 1998/01/05 03:33:56 momjian Exp $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -156,10 +156,10 @@ printf( "cashin- precision %d; decimal %c; thousands %c; currency %c; positive %
|
||||
s++;
|
||||
|
||||
if (*s != '\0')
|
||||
elog(WARN, "Bad money external representation %s", str);
|
||||
elog(ABORT, "Bad money external representation %s", str);
|
||||
|
||||
if (!PointerIsValid(result = PALLOCTYPE(Cash)))
|
||||
elog(WARN, "Memory allocation failed, can't input cash '%s'", str);
|
||||
elog(ABORT, "Memory allocation failed, can't input cash '%s'", str);
|
||||
|
||||
*result = (value * sgn);
|
||||
|
||||
@@ -257,7 +257,7 @@ cash_out(Cash *in_value)
|
||||
if (minus)
|
||||
{
|
||||
if (!PointerIsValid(result = PALLOC(CASH_BUFSZ + 2 - count + strlen(nsymbol))))
|
||||
elog(WARN, "Memory allocation failed, can't output cash", NULL);
|
||||
elog(ABORT, "Memory allocation failed, can't output cash", NULL);
|
||||
|
||||
/* Position code of 0 means use parens */
|
||||
if (convention == 0)
|
||||
@@ -270,7 +270,7 @@ cash_out(Cash *in_value)
|
||||
else
|
||||
{
|
||||
if (!PointerIsValid(result = PALLOC(CASH_BUFSZ + 2 - count)))
|
||||
elog(WARN, "Memory allocation failed, can't output cash", NULL);
|
||||
elog(ABORT, "Memory allocation failed, can't output cash", NULL);
|
||||
|
||||
strcpy(result, buf + count);
|
||||
}
|
||||
@@ -346,7 +346,7 @@ cash_pl(Cash *c1, Cash *c2)
|
||||
return (NULL);
|
||||
|
||||
if (!PointerIsValid(result = PALLOCTYPE(Cash)))
|
||||
elog(WARN, "Memory allocation failed, can't add cash", NULL);
|
||||
elog(ABORT, "Memory allocation failed, can't add cash", NULL);
|
||||
|
||||
*result = (*c1 + *c2);
|
||||
|
||||
@@ -366,7 +366,7 @@ cash_mi(Cash *c1, Cash *c2)
|
||||
return (NULL);
|
||||
|
||||
if (!PointerIsValid(result = PALLOCTYPE(Cash)))
|
||||
elog(WARN, "Memory allocation failed, can't subtract cash", NULL);
|
||||
elog(ABORT, "Memory allocation failed, can't subtract cash", NULL);
|
||||
|
||||
*result = (*c1 - *c2);
|
||||
|
||||
@@ -386,7 +386,7 @@ cash_mul_flt8(Cash *c, float8 *f)
|
||||
return (NULL);
|
||||
|
||||
if (!PointerIsValid(result = PALLOCTYPE(Cash)))
|
||||
elog(WARN, "Memory allocation failed, can't multiply cash", NULL);
|
||||
elog(ABORT, "Memory allocation failed, can't multiply cash", NULL);
|
||||
|
||||
*result = ((*f) * (*c));
|
||||
|
||||
@@ -419,10 +419,10 @@ cash_div_flt8(Cash *c, float8 *f)
|
||||
return (NULL);
|
||||
|
||||
if (!PointerIsValid(result = PALLOCTYPE(Cash)))
|
||||
elog(WARN, "Memory allocation failed, can't divide cash", NULL);
|
||||
elog(ABORT, "Memory allocation failed, can't divide cash", NULL);
|
||||
|
||||
if (*f == 0.0)
|
||||
elog(WARN, "cash_div: divide by 0.0 error");
|
||||
elog(ABORT, "cash_div: divide by 0.0 error");
|
||||
|
||||
*result = rint(*c / *f);
|
||||
|
||||
@@ -441,7 +441,7 @@ cash_mul_flt4(Cash *c, float4 *f)
|
||||
return (NULL);
|
||||
|
||||
if (!PointerIsValid(result = PALLOCTYPE(Cash)))
|
||||
elog(WARN, "Memory allocation failed, can't multiply cash", NULL);
|
||||
elog(ABORT, "Memory allocation failed, can't multiply cash", NULL);
|
||||
|
||||
*result = ((*f) * (*c));
|
||||
|
||||
@@ -474,10 +474,10 @@ cash_div_flt4(Cash *c, float4 *f)
|
||||
return (NULL);
|
||||
|
||||
if (!PointerIsValid(result = PALLOCTYPE(Cash)))
|
||||
elog(WARN, "Memory allocation failed, can't divide cash", NULL);
|
||||
elog(ABORT, "Memory allocation failed, can't divide cash", NULL);
|
||||
|
||||
if (*f == 0.0)
|
||||
elog(WARN, "cash_div: divide by 0.0 error");
|
||||
elog(ABORT, "cash_div: divide by 0.0 error");
|
||||
|
||||
*result = rint(*c / *f);
|
||||
|
||||
@@ -497,7 +497,7 @@ cash_mul_int4(Cash *c, int4 i)
|
||||
return (NULL);
|
||||
|
||||
if (!PointerIsValid(result = PALLOCTYPE(Cash)))
|
||||
elog(WARN, "Memory allocation failed, can't multiply cash", NULL);
|
||||
elog(ABORT, "Memory allocation failed, can't multiply cash", NULL);
|
||||
|
||||
*result = ((i) * (*c));
|
||||
|
||||
@@ -530,10 +530,10 @@ cash_div_int4(Cash *c, int4 i)
|
||||
return (NULL);
|
||||
|
||||
if (!PointerIsValid(result = PALLOCTYPE(Cash)))
|
||||
elog(WARN, "Memory allocation failed, can't divide cash", NULL);
|
||||
elog(ABORT, "Memory allocation failed, can't divide cash", NULL);
|
||||
|
||||
if (i == 0)
|
||||
elog(WARN, "cash_idiv: divide by 0 error");
|
||||
elog(ABORT, "cash_idiv: divide by 0 error");
|
||||
|
||||
*result = rint(*c / i);
|
||||
|
||||
@@ -553,7 +553,7 @@ cash_mul_int2(Cash *c, int2 s)
|
||||
return (NULL);
|
||||
|
||||
if (!PointerIsValid(result = PALLOCTYPE(Cash)))
|
||||
elog(WARN, "Memory allocation failed, can't multiply cash", NULL);
|
||||
elog(ABORT, "Memory allocation failed, can't multiply cash", NULL);
|
||||
|
||||
*result = ((s) * (*c));
|
||||
|
||||
@@ -586,10 +586,10 @@ cash_div_int2(Cash *c, int2 s)
|
||||
return (NULL);
|
||||
|
||||
if (!PointerIsValid(result = PALLOCTYPE(Cash)))
|
||||
elog(WARN, "Memory allocation failed, can't divide cash", NULL);
|
||||
elog(ABORT, "Memory allocation failed, can't divide cash", NULL);
|
||||
|
||||
if (s == 0)
|
||||
elog(WARN, "cash_div: divide by 0 error");
|
||||
elog(ABORT, "cash_div: divide by 0 error");
|
||||
|
||||
*result = rint(*c / s);
|
||||
|
||||
@@ -609,7 +609,7 @@ cashlarger(Cash *c1, Cash *c2)
|
||||
return (NULL);
|
||||
|
||||
if (!PointerIsValid(result = PALLOCTYPE(Cash)))
|
||||
elog(WARN, "Memory allocation failed, can't return larger cash", NULL);
|
||||
elog(ABORT, "Memory allocation failed, can't return larger cash", NULL);
|
||||
|
||||
*result = ((*c1 > *c2) ? *c1 : *c2);
|
||||
|
||||
@@ -629,7 +629,7 @@ cashsmaller(Cash *c1, Cash *c2)
|
||||
return (NULL);
|
||||
|
||||
if (!PointerIsValid(result = PALLOCTYPE(Cash)))
|
||||
elog(WARN, "Memory allocation failed, can't return smaller cash", NULL);
|
||||
elog(ABORT, "Memory allocation failed, can't return smaller cash", NULL);
|
||||
|
||||
*result = ((*c1 < *c2) ? *c1 : *c2);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/chunk.c,v 1.11 1997/12/06 22:57:12 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/chunk.c,v 1.12 1998/01/05 03:33:58 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -104,7 +104,7 @@ _ChunkArray(int fd,
|
||||
else
|
||||
cfd = LOopen(chunkfile, O_RDONLY);
|
||||
if (cfd < 0)
|
||||
elog(WARN, "Unable to open chunk file");
|
||||
elog(ABORT, "Unable to open chunk file");
|
||||
#endif
|
||||
|
||||
strcpy(cInfo.lo_name, chunkfile);
|
||||
@@ -148,11 +148,11 @@ GetChunkSize(FILE *fd,
|
||||
*/
|
||||
fscanf(fd, "%d", &N);
|
||||
if (N > MAXPAT)
|
||||
elog(WARN, "array_in: too many access pattern elements");
|
||||
elog(ABORT, "array_in: too many access pattern elements");
|
||||
for (i = 0; i < N; i++)
|
||||
for (j = 0; j < ndim + 1; j++)
|
||||
if (fscanf(fd, "%d ", &(A[i][j])) == EOF)
|
||||
elog(WARN, "array_in: bad access pattern input");
|
||||
elog(ABORT, "array_in: bad access pattern input");
|
||||
|
||||
/*
|
||||
* estimate chunk size
|
||||
@@ -413,12 +413,12 @@ seek_and_read(int pos, int size, char buff[], int fp, int from)
|
||||
|
||||
/* Assuming only one file */
|
||||
if (lo_lseek(fp, pos, from) < 0)
|
||||
elog(WARN, "File seek error");
|
||||
elog(ABORT, "File seek error");
|
||||
#ifdef LOARRAY
|
||||
v = (struct varlena *) LOread(fp, size);
|
||||
#endif
|
||||
if (VARSIZE(v) - VARHDRSZ < size)
|
||||
elog(WARN, "File read error");
|
||||
elog(ABORT, "File read error");
|
||||
memmove(buff, VARDATA(v), size);
|
||||
pfree(v);
|
||||
return (1);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.19 1997/09/20 16:17:45 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.20 1998/01/05 03:33:59 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* This code is actually (almost) unused.
|
||||
@@ -129,14 +129,14 @@ reltimein(char *str)
|
||||
char lowstr[MAXDATELEN + 1];
|
||||
|
||||
if (!PointerIsValid(str))
|
||||
elog(WARN, "Bad (null) date external representation", NULL);
|
||||
elog(ABORT, "Bad (null) date external representation", NULL);
|
||||
|
||||
if (strlen(str) > MAXDATELEN)
|
||||
elog(WARN, "Bad (length) reltime external representation '%s'", str);
|
||||
elog(ABORT, "Bad (length) reltime external representation '%s'", str);
|
||||
|
||||
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)
|
||||
|| (DecodeDateDelta(field, ftype, nf, &dtype, tm, &fsec) != 0))
|
||||
elog(WARN, "Bad reltime external representation '%s'", str);
|
||||
elog(ABORT, "Bad reltime external representation '%s'", str);
|
||||
|
||||
#ifdef DATEDEBUG
|
||||
printf("reltimein- %d fields are type %d (DTK_DATE=%d)\n", nf, dtype, DTK_DATE);
|
||||
@@ -153,7 +153,7 @@ reltimein(char *str)
|
||||
return (INVALID_RELTIME);
|
||||
}
|
||||
|
||||
elog(WARN, "Bad reltime (internal coding error) '%s'", str);
|
||||
elog(ABORT, "Bad reltime (internal coding error) '%s'", str);
|
||||
return (INVALID_RELTIME);
|
||||
} /* reltimein() */
|
||||
|
||||
@@ -361,7 +361,7 @@ reltime_timespan(RelativeTime reltime)
|
||||
month;
|
||||
|
||||
if (!PointerIsValid(result = PALLOCTYPE(TimeSpan)))
|
||||
elog(WARN, "Memory allocation failed, can't convert reltime to timespan", NULL);
|
||||
elog(ABORT, "Memory allocation failed, can't convert reltime to timespan", NULL);
|
||||
|
||||
switch (reltime)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.18 1997/12/23 19:23:07 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.19 1998/01/05 03:34:00 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -71,14 +71,14 @@ date_in(char *str)
|
||||
char lowstr[MAXDATELEN + 1];
|
||||
|
||||
if (!PointerIsValid(str))
|
||||
elog(WARN, "Bad (null) date external representation", NULL);
|
||||
elog(ABORT, "Bad (null) date external representation", NULL);
|
||||
|
||||
#ifdef DATEDEBUG
|
||||
printf("date_in- input string is %s\n", str);
|
||||
#endif
|
||||
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)
|
||||
|| (DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tzp) != 0))
|
||||
elog(WARN, "Bad date external representation %s", str);
|
||||
elog(ABORT, "Bad date external representation %s", str);
|
||||
|
||||
switch (dtype)
|
||||
{
|
||||
@@ -96,15 +96,15 @@ date_in(char *str)
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(WARN, "Unrecognized date external representation %s", str);
|
||||
elog(ABORT, "Unrecognized date external representation %s", str);
|
||||
}
|
||||
|
||||
if (tm->tm_year < 0 || tm->tm_year > 32767)
|
||||
elog(WARN, "date_in: year must be limited to values 0 through 32767 in '%s'", str);
|
||||
elog(ABORT, "date_in: year must be limited to values 0 through 32767 in '%s'", str);
|
||||
if (tm->tm_mon < 1 || tm->tm_mon > 12)
|
||||
elog(WARN, "date_in: month must be limited to values 1 through 12 in '%s'", str);
|
||||
elog(ABORT, "date_in: month must be limited to values 1 through 12 in '%s'", str);
|
||||
if (tm->tm_mday < 1 || tm->tm_mday > day_tab[isleap(tm->tm_year)][tm->tm_mon - 1])
|
||||
elog(WARN, "date_in: day must be limited to values 1 through %d in '%s'",
|
||||
elog(ABORT, "date_in: day must be limited to values 1 through %d in '%s'",
|
||||
day_tab[isleap(tm->tm_year)][tm->tm_mon - 1], str);
|
||||
|
||||
date = (date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - date2j(2000, 1, 1));
|
||||
@@ -239,7 +239,7 @@ date_datetime(DateADT dateVal)
|
||||
result = PALLOCTYPE(DateTime);
|
||||
|
||||
if (date2tm(dateVal, &tz, tm, &fsec, &tzn) != 0)
|
||||
elog(WARN, "Unable to convert date to datetime", NULL);
|
||||
elog(ABORT, "Unable to convert date to datetime", NULL);
|
||||
|
||||
#ifdef DATEDEBUG
|
||||
printf("date_datetime- date is %d.%02d.%02d\n", tm->tm_year, tm->tm_mon, tm->tm_mday);
|
||||
@@ -247,7 +247,7 @@ date_datetime(DateADT dateVal)
|
||||
#endif
|
||||
|
||||
if (tm2datetime(tm, fsec, &tz, result) != 0)
|
||||
elog(WARN, "Datetime out of range", NULL);
|
||||
elog(ABORT, "Datetime out of range", NULL);
|
||||
|
||||
return (result);
|
||||
} /* date_datetime() */
|
||||
@@ -267,10 +267,10 @@ datetime_date(DateTime *datetime)
|
||||
char *tzn;
|
||||
|
||||
if (!PointerIsValid(datetime))
|
||||
elog(WARN, "Unable to convert null datetime to date", NULL);
|
||||
elog(ABORT, "Unable to convert null datetime to date", NULL);
|
||||
|
||||
if (DATETIME_NOT_FINITE(*datetime))
|
||||
elog(WARN, "Unable to convert datetime to date", NULL);
|
||||
elog(ABORT, "Unable to convert datetime to date", NULL);
|
||||
|
||||
if (DATETIME_IS_EPOCH(*datetime))
|
||||
{
|
||||
@@ -285,7 +285,7 @@ datetime_date(DateTime *datetime)
|
||||
else
|
||||
{
|
||||
if (datetime2tm(*datetime, &tz, tm, &fsec, &tzn) != 0)
|
||||
elog(WARN, "Unable to convert datetime to date", NULL);
|
||||
elog(ABORT, "Unable to convert datetime to date", NULL);
|
||||
}
|
||||
|
||||
result = (date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - date2j(2000, 1, 1));
|
||||
@@ -310,7 +310,7 @@ abstime_date(AbsoluteTime abstime)
|
||||
case INVALID_ABSTIME:
|
||||
case NOSTART_ABSTIME:
|
||||
case NOEND_ABSTIME:
|
||||
elog(WARN, "Unable to convert reserved abstime value to date", NULL);
|
||||
elog(ABORT, "Unable to convert reserved abstime value to date", NULL);
|
||||
|
||||
/*
|
||||
* pretend to drop through to make compiler think that result
|
||||
@@ -440,18 +440,18 @@ time_in(char *str)
|
||||
int ftype[MAXDATEFIELDS];
|
||||
|
||||
if (!PointerIsValid(str))
|
||||
elog(WARN, "Bad (null) time external representation", NULL);
|
||||
elog(ABORT, "Bad (null) time external representation", NULL);
|
||||
|
||||
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)
|
||||
|| (DecodeTimeOnly(field, ftype, nf, &dtype, tm, &fsec) != 0))
|
||||
elog(WARN, "Bad time external representation '%s'", str);
|
||||
elog(ABORT, "Bad time external representation '%s'", str);
|
||||
|
||||
if ((tm->tm_hour < 0) || (tm->tm_hour > 23))
|
||||
elog(WARN, "Hour must be limited to values 0 through 23 in '%s'", str);
|
||||
elog(ABORT, "Hour must be limited to values 0 through 23 in '%s'", str);
|
||||
if ((tm->tm_min < 0) || (tm->tm_min > 59))
|
||||
elog(WARN, "Minute must be limited to values 0 through 59 in '%s'", str);
|
||||
elog(ABORT, "Minute must be limited to values 0 through 59 in '%s'", str);
|
||||
if ((tm->tm_sec < 0) || ((tm->tm_sec + fsec) >= 60))
|
||||
elog(WARN, "Second must be limited to values 0 through < 60 in '%s'", str);
|
||||
elog(ABORT, "Second must be limited to values 0 through < 60 in '%s'", str);
|
||||
|
||||
time = PALLOCTYPE(TimeADT);
|
||||
|
||||
@@ -565,10 +565,10 @@ datetime_time(DateTime *datetime)
|
||||
char *tzn;
|
||||
|
||||
if (!PointerIsValid(datetime))
|
||||
elog(WARN, "Unable to convert null datetime to date", NULL);
|
||||
elog(ABORT, "Unable to convert null datetime to date", NULL);
|
||||
|
||||
if (DATETIME_NOT_FINITE(*datetime))
|
||||
elog(WARN, "Unable to convert datetime to date", NULL);
|
||||
elog(ABORT, "Unable to convert datetime to date", NULL);
|
||||
|
||||
if (DATETIME_IS_EPOCH(*datetime))
|
||||
{
|
||||
@@ -583,7 +583,7 @@ datetime_time(DateTime *datetime)
|
||||
else
|
||||
{
|
||||
if (datetime2tm(*datetime, &tz, tm, &fsec, &tzn) != 0)
|
||||
elog(WARN, "Unable to convert datetime to date", NULL);
|
||||
elog(ABORT, "Unable to convert datetime to date", NULL);
|
||||
}
|
||||
|
||||
result = PALLOCTYPE(TimeADT);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datum.c,v 1.7 1997/09/08 02:30:35 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datum.c,v 1.8 1998/01/05 03:34:01 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -61,7 +61,7 @@ datumGetSize(Datum value, Oid type, bool byVal, Size len)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(WARN,
|
||||
elog(ABORT,
|
||||
"datumGetSize: Error: type=%ld, byVaL with len=%d",
|
||||
(long) type, len);
|
||||
}
|
||||
@@ -78,7 +78,7 @@ datumGetSize(Datum value, Oid type, bool byVal, Size len)
|
||||
s = (struct varlena *) DatumGetPointer(value);
|
||||
if (!PointerIsValid(s))
|
||||
{
|
||||
elog(WARN,
|
||||
elog(ABORT,
|
||||
"datumGetSize: Invalid Datum Pointer");
|
||||
}
|
||||
size = (Size) VARSIZE(s);
|
||||
@@ -132,7 +132,7 @@ datumCopy(Datum value, Oid type, bool byVal, Size len)
|
||||
s = (char *) palloc(realSize);
|
||||
if (s == NULL)
|
||||
{
|
||||
elog(WARN, "datumCopy: out of memory\n");
|
||||
elog(ABORT, "datumCopy: out of memory\n");
|
||||
}
|
||||
memmove(s, DatumGetPointer(value), realSize);
|
||||
res = (Datum) s;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.47 1997/12/23 19:26:31 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.48 1998/01/05 03:34:03 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -109,11 +109,11 @@ datetime_in(char *str)
|
||||
char lowstr[MAXDATELEN + 1];
|
||||
|
||||
if (!PointerIsValid(str))
|
||||
elog(WARN, "Bad (null) datetime external representation", NULL);
|
||||
elog(ABORT, "Bad (null) datetime external representation", NULL);
|
||||
|
||||
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)
|
||||
|| (DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tz) != 0))
|
||||
elog(WARN, "Bad datetime external representation '%s'", str);
|
||||
elog(ABORT, "Bad datetime external representation '%s'", str);
|
||||
|
||||
result = PALLOCTYPE(DateTime);
|
||||
|
||||
@@ -121,7 +121,7 @@ datetime_in(char *str)
|
||||
{
|
||||
case DTK_DATE:
|
||||
if (tm2datetime(tm, fsec, &tz, result) != 0)
|
||||
elog(WARN, "Datetime out of range '%s'", str);
|
||||
elog(ABORT, "Datetime out of range '%s'", str);
|
||||
|
||||
#ifdef DATEDEBUG
|
||||
printf("datetime_in- date is %f\n", *result);
|
||||
@@ -150,7 +150,7 @@ datetime_in(char *str)
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(WARN, "Internal coding error, can't input datetime '%s'", str);
|
||||
elog(ABORT, "Internal coding error, can't input datetime '%s'", str);
|
||||
}
|
||||
|
||||
return (result);
|
||||
@@ -225,11 +225,11 @@ timespan_in(char *str)
|
||||
fsec = 0;
|
||||
|
||||
if (!PointerIsValid(str))
|
||||
elog(WARN, "Bad (null) timespan external representation", NULL);
|
||||
elog(ABORT, "Bad (null) timespan external representation", NULL);
|
||||
|
||||
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)
|
||||
|| (DecodeDateDelta(field, ftype, nf, &dtype, tm, &fsec) != 0))
|
||||
elog(WARN, "Bad timespan external representation '%s'", str);
|
||||
elog(ABORT, "Bad timespan external representation '%s'", str);
|
||||
|
||||
span = PALLOCTYPE(TimeSpan);
|
||||
|
||||
@@ -241,12 +241,12 @@ timespan_in(char *str)
|
||||
#if FALSE
|
||||
TIMESPAN_INVALID(span);
|
||||
#endif
|
||||
elog(WARN, "Bad timespan external representation '%s'", str);
|
||||
elog(ABORT, "Bad timespan external representation '%s'", str);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(WARN, "Internal coding error, can't input timespan '%s'", str);
|
||||
elog(ABORT, "Internal coding error, can't input timespan '%s'", str);
|
||||
}
|
||||
|
||||
return (span);
|
||||
@@ -272,7 +272,7 @@ timespan_out(TimeSpan *span)
|
||||
return (NULL);
|
||||
|
||||
if (EncodeTimeSpan(tm, fsec, DateStyle, buf) != 0)
|
||||
elog(WARN, "Unable to format timespan", NULL);
|
||||
elog(ABORT, "Unable to format timespan", NULL);
|
||||
|
||||
result = PALLOC(strlen(buf) + 1);
|
||||
|
||||
@@ -904,7 +904,7 @@ datetime_pl_span(DateTime *datetime, TimeSpan *span)
|
||||
tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
|
||||
#endif
|
||||
if (tm2datetime(tm, fsec, &tz, &dt) != 0)
|
||||
elog(WARN, "Unable to add datetime and timespan", NULL);
|
||||
elog(ABORT, "Unable to add datetime and timespan", NULL);
|
||||
|
||||
}
|
||||
else
|
||||
@@ -1106,10 +1106,10 @@ timespan_div(TimeSpan *span1, float8 *arg2)
|
||||
return NULL;
|
||||
|
||||
if (!PointerIsValid(result = PALLOCTYPE(TimeSpan)))
|
||||
elog(WARN, "Memory allocation failed, can't subtract timespans", NULL);
|
||||
elog(ABORT, "Memory allocation failed, can't subtract timespans", NULL);
|
||||
|
||||
if (*arg2 == 0.0)
|
||||
elog(WARN, "timespan_div: divide by 0.0 error");
|
||||
elog(ABORT, "timespan_div: divide by 0.0 error");
|
||||
|
||||
result->month = rint(span1->month / *arg2);
|
||||
result->time = JROUND(span1->time / *arg2);
|
||||
@@ -1238,7 +1238,7 @@ datetime_age(DateTime *datetime1, DateTime *datetime2)
|
||||
|
||||
if (tm2timespan(tm, fsec, result) != 0)
|
||||
{
|
||||
elog(WARN, "Unable to decode datetime", NULL);
|
||||
elog(ABORT, "Unable to decode datetime", NULL);
|
||||
}
|
||||
|
||||
#if FALSE
|
||||
@@ -1255,7 +1255,7 @@ datetime_age(DateTime *datetime1, DateTime *datetime2)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(WARN, "Unable to decode datetime", NULL);
|
||||
elog(ABORT, "Unable to decode datetime", NULL);
|
||||
}
|
||||
|
||||
return (result);
|
||||
@@ -1436,7 +1436,7 @@ datetime_trunc(text *units, DateTime *datetime)
|
||||
{
|
||||
#if FALSE
|
||||
/* should return null but Postgres doesn't like that currently. - tgl 97/06/12 */
|
||||
elog(WARN, "Datetime is not finite", NULL);
|
||||
elog(ABORT, "Datetime is not finite", NULL);
|
||||
#endif
|
||||
*result = 0;
|
||||
|
||||
@@ -1480,7 +1480,7 @@ datetime_trunc(text *units, DateTime *datetime)
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(WARN, "Datetime units '%s' not supported", lowunits);
|
||||
elog(ABORT, "Datetime units '%s' not supported", lowunits);
|
||||
result = NULL;
|
||||
}
|
||||
|
||||
@@ -1513,7 +1513,7 @@ datetime_trunc(text *units, DateTime *datetime)
|
||||
}
|
||||
|
||||
if (tm2datetime(tm, fsec, &tz, result) != 0)
|
||||
elog(WARN, "Unable to truncate datetime to '%s'", lowunits);
|
||||
elog(ABORT, "Unable to truncate datetime to '%s'", lowunits);
|
||||
|
||||
#if FALSE
|
||||
}
|
||||
@@ -1526,7 +1526,7 @@ datetime_trunc(text *units, DateTime *datetime)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(WARN, "Datetime units '%s' not recognized", lowunits);
|
||||
elog(ABORT, "Datetime units '%s' not recognized", lowunits);
|
||||
result = NULL;
|
||||
}
|
||||
}
|
||||
@@ -1580,7 +1580,7 @@ timespan_trunc(text *units, TimeSpan *timespan)
|
||||
if (TIMESPAN_IS_INVALID(*timespan))
|
||||
{
|
||||
#if FALSE
|
||||
elog(WARN, "Timespan is not finite", NULL);
|
||||
elog(ABORT, "Timespan is not finite", NULL);
|
||||
#endif
|
||||
result = NULL;
|
||||
|
||||
@@ -1623,12 +1623,12 @@ timespan_trunc(text *units, TimeSpan *timespan)
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(WARN, "Timespan units '%s' not supported", lowunits);
|
||||
elog(ABORT, "Timespan units '%s' not supported", lowunits);
|
||||
result = NULL;
|
||||
}
|
||||
|
||||
if (tm2timespan(tm, fsec, result) != 0)
|
||||
elog(WARN, "Unable to truncate timespan to '%s'", lowunits);
|
||||
elog(ABORT, "Unable to truncate timespan to '%s'", lowunits);
|
||||
|
||||
}
|
||||
else
|
||||
@@ -1652,7 +1652,7 @@ timespan_trunc(text *units, TimeSpan *timespan)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(WARN, "Timespan units '%s' not recognized", units);
|
||||
elog(ABORT, "Timespan units '%s' not recognized", units);
|
||||
result = NULL;
|
||||
}
|
||||
|
||||
@@ -1708,7 +1708,7 @@ datetime_part(text *units, DateTime *datetime)
|
||||
{
|
||||
#if FALSE
|
||||
/* should return null but Postgres doesn't like that currently. - tgl 97/06/12 */
|
||||
elog(WARN, "Datetime is not finite", NULL);
|
||||
elog(ABORT, "Datetime is not finite", NULL);
|
||||
#endif
|
||||
*result = 0;
|
||||
|
||||
@@ -1774,7 +1774,7 @@ datetime_part(text *units, DateTime *datetime)
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(WARN, "Datetime units '%s' not supported", lowunits);
|
||||
elog(ABORT, "Datetime units '%s' not supported", lowunits);
|
||||
*result = 0;
|
||||
}
|
||||
|
||||
@@ -1790,28 +1790,28 @@ datetime_part(text *units, DateTime *datetime)
|
||||
|
||||
case DTK_DOW:
|
||||
if (datetime2tm(dt, &tz, tm, &fsec, &tzn) != 0)
|
||||
elog(WARN, "Unable to encode datetime", NULL);
|
||||
elog(ABORT, "Unable to encode datetime", NULL);
|
||||
|
||||
*result = j2day(date2j(tm->tm_year, tm->tm_mon, tm->tm_mday));
|
||||
break;
|
||||
|
||||
case DTK_DOY:
|
||||
if (datetime2tm(dt, &tz, tm, &fsec, &tzn) != 0)
|
||||
elog(WARN, "Unable to encode datetime", NULL);
|
||||
elog(ABORT, "Unable to encode datetime", NULL);
|
||||
|
||||
*result = (date2j(tm->tm_year, tm->tm_mon, tm->tm_mday)
|
||||
- date2j(tm->tm_year, 1, 1) + 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(WARN, "Datetime units '%s' not supported", lowunits);
|
||||
elog(ABORT, "Datetime units '%s' not supported", lowunits);
|
||||
*result = 0;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(WARN, "Datetime units '%s' not recognized", lowunits);
|
||||
elog(ABORT, "Datetime units '%s' not recognized", lowunits);
|
||||
*result = 0;
|
||||
}
|
||||
}
|
||||
@@ -1864,7 +1864,7 @@ timespan_part(text *units, TimeSpan *timespan)
|
||||
if (TIMESPAN_IS_INVALID(*timespan))
|
||||
{
|
||||
#if FALSE
|
||||
elog(WARN, "Timespan is not finite", NULL);
|
||||
elog(ABORT, "Timespan is not finite", NULL);
|
||||
#endif
|
||||
*result = 0;
|
||||
|
||||
@@ -1925,7 +1925,7 @@ timespan_part(text *units, TimeSpan *timespan)
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(WARN, "Timespan units '%s' not yet supported", units);
|
||||
elog(ABORT, "Timespan units '%s' not yet supported", units);
|
||||
result = NULL;
|
||||
}
|
||||
|
||||
@@ -1949,7 +1949,7 @@ timespan_part(text *units, TimeSpan *timespan)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(WARN, "Timespan units '%s' not recognized", units);
|
||||
elog(ABORT, "Timespan units '%s' not recognized", units);
|
||||
*result = 0;
|
||||
}
|
||||
|
||||
@@ -2005,7 +2005,7 @@ datetime_zone(text *zone, DateTime *datetime)
|
||||
* could return null but Postgres doesn't like that currently. -
|
||||
* tgl 97/06/12
|
||||
*/
|
||||
elog(WARN, "Datetime is not finite", NULL);
|
||||
elog(ABORT, "Datetime is not finite", NULL);
|
||||
result = NULL;
|
||||
|
||||
}
|
||||
@@ -2018,7 +2018,7 @@ datetime_zone(text *zone, DateTime *datetime)
|
||||
dt = dt2local(dt, tz);
|
||||
|
||||
if (datetime2tm(dt, NULL, tm, &fsec, NULL) != 0)
|
||||
elog(WARN, "Datetime not legal", NULL);
|
||||
elog(ABORT, "Datetime not legal", NULL);
|
||||
|
||||
up = upzone;
|
||||
lp = lowzone;
|
||||
@@ -2039,7 +2039,7 @@ datetime_zone(text *zone, DateTime *datetime)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(WARN, "Time zone '%s' not recognized", lowzone);
|
||||
elog(ABORT, "Time zone '%s' not recognized", lowzone);
|
||||
result = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/filename.c,v 1.11 1997/10/25 01:10:36 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/filename.c,v 1.12 1998/01/05 03:34:06 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -48,7 +48,7 @@ filename_in(char *file)
|
||||
|
||||
if ((pw = getpwnam(userName)) == NULL)
|
||||
{
|
||||
elog(WARN, "User %s is not a Unix user on the db server.",
|
||||
elog(ABORT, "User %s is not a Unix user on the db server.",
|
||||
userName);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ filename_in(char *file)
|
||||
/* printf("name: %s\n"); */
|
||||
if ((pw = getpwnam(name)) == NULL)
|
||||
{
|
||||
elog(WARN, "No such user: %s\n", name);
|
||||
elog(ABORT, "No such user: %s\n", name);
|
||||
ind = 0;
|
||||
}
|
||||
else
|
||||
@@ -112,7 +112,7 @@ filename_in(char *file)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(WARN, "Couldn't find %s in your environment", environment);
|
||||
elog(ABORT, "Couldn't find %s in your environment", environment);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -132,6 +132,6 @@ filename_out(char *s)
|
||||
return ((char *) NULL);
|
||||
ret = (char *) palloc(strlen(s) + 1);
|
||||
if (!ret)
|
||||
elog(WARN, "filename_out: palloc failed");
|
||||
elog(ABORT, "filename_out: palloc failed");
|
||||
return (strcpy(ret, s));
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.24 1997/09/26 20:32:02 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.25 1998/01/05 03:34:07 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -161,9 +161,9 @@ CheckFloat4Val(double val)
|
||||
return;
|
||||
#else
|
||||
if (fabs(val) > FLOAT4_MAX)
|
||||
elog(WARN, "Bad float4 input format -- overflow");
|
||||
elog(ABORT, "Bad float4 input format -- overflow");
|
||||
if (val != 0.0 && fabs(val) < FLOAT4_MIN)
|
||||
elog(WARN, "Bad float4 input format -- underflow");
|
||||
elog(ABORT, "Bad float4 input format -- underflow");
|
||||
return;
|
||||
#endif /* UNSAFE_FLOATS */
|
||||
}
|
||||
@@ -186,9 +186,9 @@ CheckFloat8Val(double val)
|
||||
return;
|
||||
#else
|
||||
if (fabs(val) > FLOAT8_MAX)
|
||||
elog(WARN, "Bad float8 input format -- overflow");
|
||||
elog(ABORT, "Bad float8 input format -- overflow");
|
||||
if (val != 0.0 && fabs(val) < FLOAT8_MIN)
|
||||
elog(WARN, "Bad float8 input format -- underflow");
|
||||
elog(ABORT, "Bad float8 input format -- underflow");
|
||||
return;
|
||||
#endif /* UNSAFE_FLOATS */
|
||||
}
|
||||
@@ -210,7 +210,7 @@ float4in(char *num)
|
||||
errno = 0;
|
||||
val = strtod(num, &endptr);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(WARN, "Bad float4 input format '%s'", num);
|
||||
elog(ABORT, "Bad float4 input format '%s'", num);
|
||||
|
||||
/*
|
||||
* if we get here, we have a legal double, still need to check to see
|
||||
@@ -257,7 +257,7 @@ float8in(char *num)
|
||||
errno = 0;
|
||||
val = strtod(num, &endptr);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(WARN, "Bad float8 input format '%s'", num);
|
||||
elog(ABORT, "Bad float8 input format '%s'", num);
|
||||
|
||||
CheckFloat8Val(val);
|
||||
*result = val;
|
||||
@@ -515,7 +515,7 @@ float4div(float32 arg1, float32 arg2)
|
||||
return (float32) NULL;
|
||||
|
||||
if (*arg2 == 0.0)
|
||||
elog(WARN, "float4div: divide by zero error");
|
||||
elog(ABORT, "float4div: divide by zero error");
|
||||
|
||||
val = *arg1 / *arg2;
|
||||
|
||||
@@ -609,7 +609,7 @@ float8div(float64 arg1, float64 arg2)
|
||||
result = (float64) palloc(sizeof(float64data));
|
||||
|
||||
if (*arg2 == 0.0)
|
||||
elog(WARN, "float8div: divide by zero error");
|
||||
elog(ABORT, "float8div: divide by zero error");
|
||||
|
||||
val = *arg1 / *arg2;
|
||||
CheckFloat8Val(val);
|
||||
@@ -806,10 +806,10 @@ dtoi4(float64 num)
|
||||
int32 result;
|
||||
|
||||
if (!PointerIsValid(num))
|
||||
elog(WARN, "dtoi4: unable to convert null", NULL);
|
||||
elog(ABORT, "dtoi4: unable to convert null", NULL);
|
||||
|
||||
if ((*num < INT_MIN) || (*num > INT_MAX))
|
||||
elog(WARN, "dtoi4: integer out of range", NULL);
|
||||
elog(ABORT, "dtoi4: integer out of range", NULL);
|
||||
|
||||
result = rint(*num);
|
||||
return (result);
|
||||
@@ -825,10 +825,10 @@ dtoi2(float64 num)
|
||||
int16 result;
|
||||
|
||||
if (!PointerIsValid(num))
|
||||
elog(WARN, "dtoi2: unable to convert null", NULL);
|
||||
elog(ABORT, "dtoi2: unable to convert null", NULL);
|
||||
|
||||
if ((*num < SHRT_MIN) || (*num > SHRT_MAX))
|
||||
elog(WARN, "dtoi2: integer out of range", NULL);
|
||||
elog(ABORT, "dtoi2: integer out of range", NULL);
|
||||
|
||||
result = rint(*num);
|
||||
return (result);
|
||||
@@ -874,10 +874,10 @@ ftoi4(float32 num)
|
||||
int32 result;
|
||||
|
||||
if (!PointerIsValid(num))
|
||||
elog(WARN, "ftoi4: unable to convert null", NULL);
|
||||
elog(ABORT, "ftoi4: unable to convert null", NULL);
|
||||
|
||||
if ((*num < INT_MIN) || (*num > INT_MAX))
|
||||
elog(WARN, "ftoi4: integer out of range", NULL);
|
||||
elog(ABORT, "ftoi4: integer out of range", NULL);
|
||||
|
||||
result = rint(*num);
|
||||
return (result);
|
||||
@@ -893,10 +893,10 @@ ftoi2(float32 num)
|
||||
int16 result;
|
||||
|
||||
if (!PointerIsValid(num))
|
||||
elog(WARN, "ftoi2: unable to convert null", NULL);
|
||||
elog(ABORT, "ftoi2: unable to convert null", NULL);
|
||||
|
||||
if ((*num < SHRT_MIN) || (*num > SHRT_MAX))
|
||||
elog(WARN, "ftoi2: integer out of range", NULL);
|
||||
elog(ABORT, "ftoi2: integer out of range", NULL);
|
||||
|
||||
result = rint(*num);
|
||||
return (result);
|
||||
@@ -1052,7 +1052,7 @@ dpow(float64 arg1, float64 arg2)
|
||||
#else
|
||||
if (!finite(*result))
|
||||
#endif
|
||||
elog(WARN, "pow() result is out of range");
|
||||
elog(ABORT, "pow() result is out of range");
|
||||
|
||||
CheckFloat8Val(*result);
|
||||
return (result);
|
||||
@@ -1083,7 +1083,7 @@ dexp(float64 arg1)
|
||||
#else
|
||||
if (!finite(*result))
|
||||
#endif
|
||||
elog(WARN, "exp() result is out of range");
|
||||
elog(ABORT, "exp() result is out of range");
|
||||
|
||||
CheckFloat8Val(*result);
|
||||
return (result);
|
||||
@@ -1107,9 +1107,9 @@ dlog1(float64 arg1)
|
||||
|
||||
tmp = *arg1;
|
||||
if (tmp == 0.0)
|
||||
elog(WARN, "can't take log of zero");
|
||||
elog(ABORT, "can't take log of zero");
|
||||
if (tmp < 0)
|
||||
elog(WARN, "can't take log of a negative number");
|
||||
elog(ABORT, "can't take log of a negative number");
|
||||
*result = (float64data) log(tmp);
|
||||
|
||||
CheckFloat8Val(*result);
|
||||
@@ -1185,7 +1185,7 @@ float48div(float32 arg1, float64 arg2)
|
||||
result = (float64) palloc(sizeof(float64data));
|
||||
|
||||
if (*arg2 == 0.0)
|
||||
elog(WARN, "float48div: divide by zero");
|
||||
elog(ABORT, "float48div: divide by zero");
|
||||
|
||||
*result = *arg1 / *arg2;
|
||||
CheckFloat8Val(*result);
|
||||
@@ -1255,7 +1255,7 @@ float84div(float64 arg1, float32 arg2)
|
||||
result = (float64) palloc(sizeof(float64data));
|
||||
|
||||
if (*arg2 == 0.0)
|
||||
elog(WARN, "float48div: divide by zero");
|
||||
elog(ABORT, "float48div: divide by zero");
|
||||
|
||||
*result = *arg1 / *arg2;
|
||||
CheckFloat8Val(*result);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.26 1997/09/25 14:09:04 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.27 1998/01/05 03:34:08 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -294,7 +294,7 @@ path_encode(bool closed, int npts, Point *pt)
|
||||
{
|
||||
*cp++ = LDELIM;
|
||||
if (!pair_encode(pt->x, pt->y, cp))
|
||||
elog(WARN, "Unable to format path", NULL);
|
||||
elog(ABORT, "Unable to format path", NULL);
|
||||
cp += strlen(cp);
|
||||
*cp++ = RDELIM;
|
||||
*cp++ = DELIM;
|
||||
@@ -364,11 +364,11 @@ box_in(char *str)
|
||||
y;
|
||||
|
||||
if (!PointerIsValid(str))
|
||||
elog(WARN, " Bad (null) box external representation", NULL);
|
||||
elog(ABORT, " Bad (null) box external representation", NULL);
|
||||
|
||||
if ((!path_decode(FALSE, 2, str, &isopen, &s, &(box->high)))
|
||||
|| (*s != '\0'))
|
||||
elog(WARN, "Bad box external representation '%s'", str);
|
||||
elog(ABORT, "Bad box external representation '%s'", str);
|
||||
|
||||
/* reorder corners if necessary... */
|
||||
if (box->high.x < box->low.x)
|
||||
@@ -1058,10 +1058,10 @@ path_in(char *str)
|
||||
int depth = 0;
|
||||
|
||||
if (!PointerIsValid(str))
|
||||
elog(WARN, "Bad (null) path external representation");
|
||||
elog(ABORT, "Bad (null) path external representation");
|
||||
|
||||
if ((npts = pair_count(str, ',')) <= 0)
|
||||
elog(WARN, "Bad path external representation '%s'", str);
|
||||
elog(ABORT, "Bad path external representation '%s'", str);
|
||||
|
||||
s = str;
|
||||
while (isspace(*s))
|
||||
@@ -1082,7 +1082,7 @@ path_in(char *str)
|
||||
|
||||
if ((!path_decode(TRUE, npts, s, &isopen, &s, &(path->p[0])))
|
||||
&& (!((depth == 0) && (*s == '\0'))) && !((depth >= 1) && (*s == RDELIM)))
|
||||
elog(WARN, "Bad path external representation '%s'", str);
|
||||
elog(ABORT, "Bad path external representation '%s'", str);
|
||||
|
||||
path->closed = (!isopen);
|
||||
|
||||
@@ -1367,10 +1367,10 @@ point_in(char *str)
|
||||
char *s;
|
||||
|
||||
if (!PointerIsValid(str))
|
||||
elog(WARN, "Bad (null) point external representation");
|
||||
elog(ABORT, "Bad (null) point external representation");
|
||||
|
||||
if (!pair_decode(str, &x, &y, &s) || (strlen(s) > 0))
|
||||
elog(WARN, "Bad point external representation '%s'", str);
|
||||
elog(ABORT, "Bad point external representation '%s'", str);
|
||||
|
||||
point = PALLOCTYPE(Point);
|
||||
|
||||
@@ -1549,13 +1549,13 @@ lseg_in(char *str)
|
||||
char *s;
|
||||
|
||||
if (!PointerIsValid(str))
|
||||
elog(WARN, " Bad (null) lseg external representation", NULL);
|
||||
elog(ABORT, " Bad (null) lseg external representation", NULL);
|
||||
|
||||
lseg = PALLOCTYPE(LSEG);
|
||||
|
||||
if ((!path_decode(TRUE, 2, str, &isopen, &s, &(lseg->p[0])))
|
||||
|| (*s != '\0'))
|
||||
elog(WARN, "Bad lseg external representation '%s'", str);
|
||||
elog(ABORT, "Bad lseg external representation '%s'", str);
|
||||
|
||||
lseg->m = point_sl(&lseg->p[0], &lseg->p[1]);
|
||||
|
||||
@@ -2037,7 +2037,7 @@ dist_cpoly(CIRCLE *circle, POLYGON *poly)
|
||||
LSEG seg;
|
||||
|
||||
if (!PointerIsValid(circle) || !PointerIsValid(poly))
|
||||
elog(WARN, "Invalid (null) input for distance", NULL);
|
||||
elog(ABORT, "Invalid (null) input for distance", NULL);
|
||||
|
||||
if (point_inside(&(circle->center), poly->npts, poly->p))
|
||||
{
|
||||
@@ -2242,7 +2242,7 @@ Point *
|
||||
close_pb(Point *pt, BOX *box)
|
||||
{
|
||||
/* think about this one for a while */
|
||||
elog(WARN, "close_pb not implemented", NULL);
|
||||
elog(ABORT, "close_pb not implemented", NULL);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
@@ -2273,7 +2273,7 @@ Point *
|
||||
close_sb(LSEG *lseg, BOX *box)
|
||||
{
|
||||
/* think about this one for a while */
|
||||
elog(WARN, "close_sb not implemented", NULL);
|
||||
elog(ABORT, "close_sb not implemented", NULL);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
@@ -2282,7 +2282,7 @@ Point *
|
||||
close_lb(LINE *line, BOX *box)
|
||||
{
|
||||
/* think about this one for a while */
|
||||
elog(WARN, "close_lb not implemented", NULL);
|
||||
elog(ABORT, "close_lb not implemented", NULL);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
@@ -2531,7 +2531,7 @@ make_bound_box(POLYGON *poly)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(WARN, "Unable to create bounding box for empty polygon", NULL);
|
||||
elog(ABORT, "Unable to create bounding box for empty polygon", NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2553,10 +2553,10 @@ poly_in(char *str)
|
||||
char *s;
|
||||
|
||||
if (!PointerIsValid(str))
|
||||
elog(WARN, " Bad (null) polygon external representation");
|
||||
elog(ABORT, " Bad (null) polygon external representation");
|
||||
|
||||
if ((npts = pair_count(str, ',')) <= 0)
|
||||
elog(WARN, "Bad polygon external representation '%s'", str);
|
||||
elog(ABORT, "Bad polygon external representation '%s'", str);
|
||||
|
||||
size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * npts);
|
||||
poly = PALLOC(size);
|
||||
@@ -2567,7 +2567,7 @@ poly_in(char *str)
|
||||
|
||||
if ((!path_decode(FALSE, npts, str, &isopen, &s, &(poly->p[0])))
|
||||
|| (*s != '\0'))
|
||||
elog(WARN, "Bad polygon external representation '%s'", str);
|
||||
elog(ABORT, "Bad polygon external representation '%s'", str);
|
||||
|
||||
make_bound_box(poly);
|
||||
|
||||
@@ -2870,7 +2870,7 @@ point_div(Point *p1, Point *p2)
|
||||
div = (p2->x * p2->x) + (p2->y * p2->y);
|
||||
|
||||
if (div == 0.0)
|
||||
elog(WARN, "point_div: divide by 0.0 error");
|
||||
elog(ABORT, "point_div: divide by 0.0 error");
|
||||
|
||||
result->x = ((p1->x * p2->x) + (p1->y * p2->y)) / div;
|
||||
result->y = ((p2->x * p1->y) - (p2->y * p1->x)) / div;
|
||||
@@ -3139,7 +3139,7 @@ path_center(PATH *path)
|
||||
if (!PointerIsValid(path))
|
||||
return (NULL);
|
||||
|
||||
elog(WARN, "path_center not implemented", NULL);
|
||||
elog(ABORT, "path_center not implemented", NULL);
|
||||
|
||||
result = PALLOCTYPE(Point);
|
||||
result = NULL;
|
||||
@@ -3158,7 +3158,7 @@ path_poly(PATH *path)
|
||||
return (NULL);
|
||||
|
||||
if (!path->closed)
|
||||
elog(WARN, "Open path cannot be converted to polygon", NULL);
|
||||
elog(ABORT, "Open path cannot be converted to polygon", NULL);
|
||||
|
||||
size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * path->npts);
|
||||
poly = PALLOC(size);
|
||||
@@ -3197,7 +3197,7 @@ upgradepath(PATH *path)
|
||||
return (NULL);
|
||||
|
||||
if (!isoldpath(path))
|
||||
elog(WARN, "upgradepath: path already upgraded?", NULL);
|
||||
elog(ABORT, "upgradepath: path already upgraded?", NULL);
|
||||
|
||||
npts = (path->npts - 1);
|
||||
size = offsetof(PATH, p[0]) +(sizeof(path->p[0]) * npts);
|
||||
@@ -3463,7 +3463,7 @@ circle_in(char *str)
|
||||
int depth = 0;
|
||||
|
||||
if (!PointerIsValid(str))
|
||||
elog(WARN, " Bad (null) circle external representation", NULL);
|
||||
elog(ABORT, " Bad (null) circle external representation", NULL);
|
||||
|
||||
circle = PALLOCTYPE(CIRCLE);
|
||||
|
||||
@@ -3483,7 +3483,7 @@ circle_in(char *str)
|
||||
}
|
||||
|
||||
if (!pair_decode(s, &circle->center.x, &circle->center.y, &s))
|
||||
elog(WARN, "Bad circle external representation '%s'", str);
|
||||
elog(ABORT, "Bad circle external representation '%s'", str);
|
||||
|
||||
if (*s == DELIM)
|
||||
s++;
|
||||
@@ -3491,7 +3491,7 @@ circle_in(char *str)
|
||||
s++;
|
||||
|
||||
if ((!single_decode(s, &circle->radius, &s)) || (circle->radius < 0))
|
||||
elog(WARN, "Bad circle external representation '%s'", str);
|
||||
elog(ABORT, "Bad circle external representation '%s'", str);
|
||||
|
||||
while (depth > 0)
|
||||
{
|
||||
@@ -3505,12 +3505,12 @@ circle_in(char *str)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(WARN, "Bad circle external representation '%s'", str);
|
||||
elog(ABORT, "Bad circle external representation '%s'", str);
|
||||
}
|
||||
}
|
||||
|
||||
if (*s != '\0')
|
||||
elog(WARN, "Bad circle external representation '%s'", str);
|
||||
elog(ABORT, "Bad circle external representation '%s'", str);
|
||||
|
||||
return (circle);
|
||||
} /* circle_in() */
|
||||
@@ -3532,13 +3532,13 @@ circle_out(CIRCLE *circle)
|
||||
*cp++ = LDELIM_C;
|
||||
*cp++ = LDELIM;
|
||||
if (!pair_encode(circle->center.x, circle->center.y, cp))
|
||||
elog(WARN, "Unable to format circle", NULL);
|
||||
elog(ABORT, "Unable to format circle", NULL);
|
||||
|
||||
cp += strlen(cp);
|
||||
*cp++ = RDELIM;
|
||||
*cp++ = DELIM;
|
||||
if (!single_encode(circle->radius, cp))
|
||||
elog(WARN, "Unable to format circle", NULL);
|
||||
elog(ABORT, "Unable to format circle", NULL);
|
||||
|
||||
cp += strlen(cp);
|
||||
*cp++ = RDELIM_C;
|
||||
@@ -4000,7 +4000,7 @@ circle_poly(int npts, CIRCLE *circle)
|
||||
return (NULL);
|
||||
|
||||
if (FPzero(circle->radius) || (npts < 2))
|
||||
elog(WARN, "Unable to convert circle to polygon", NULL);
|
||||
elog(ABORT, "Unable to convert circle to polygon", NULL);
|
||||
|
||||
size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * npts);
|
||||
poly = PALLOC(size);
|
||||
@@ -4036,7 +4036,7 @@ poly_circle(POLYGON *poly)
|
||||
return (NULL);
|
||||
|
||||
if (poly->npts < 2)
|
||||
elog(WARN, "Unable to convert polygon to circle", NULL);
|
||||
elog(ABORT, "Unable to convert polygon to circle", NULL);
|
||||
|
||||
circle = PALLOCTYPE(CIRCLE);
|
||||
|
||||
@@ -4059,7 +4059,7 @@ poly_circle(POLYGON *poly)
|
||||
circle->radius /= poly->npts;
|
||||
|
||||
if (FPzero(circle->radius))
|
||||
elog(WARN, "Unable to convert polygon to circle", NULL);
|
||||
elog(ABORT, "Unable to convert polygon to circle", NULL);
|
||||
|
||||
return (circle);
|
||||
} /* poly_circle() */
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.10 1997/11/17 16:24:17 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.11 1998/01/05 03:34:09 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -232,9 +232,9 @@ int16
|
||||
i4toi2(int32 arg1)
|
||||
{
|
||||
if (arg1 < SHRT_MIN)
|
||||
elog(WARN, "i4toi2: '%d' causes int2 underflow", arg1);
|
||||
elog(ABORT, "i4toi2: '%d' causes int2 underflow", arg1);
|
||||
if (arg1 > SHRT_MAX)
|
||||
elog(WARN, "i4toi2: '%d' causes int2 overflow", arg1);
|
||||
elog(ABORT, "i4toi2: '%d' causes int2 overflow", arg1);
|
||||
|
||||
return ((int16) arg1);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.36 1997/10/30 14:06:47 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.37 1998/01/05 03:34:11 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -256,14 +256,14 @@ nabstimein(char *str)
|
||||
ftype[MAXDATEFIELDS];
|
||||
|
||||
if (!PointerIsValid(str))
|
||||
elog(WARN, "Bad (null) abstime external representation", NULL);
|
||||
elog(ABORT, "Bad (null) abstime external representation", NULL);
|
||||
|
||||
if (strlen(str) > MAXDATELEN)
|
||||
elog(WARN, "Bad (length) abstime external representation '%s'", str);
|
||||
elog(ABORT, "Bad (length) abstime external representation '%s'", str);
|
||||
|
||||
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)
|
||||
|| (DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tz) != 0))
|
||||
elog(WARN, "Bad abstime external representation '%s'", str);
|
||||
elog(ABORT, "Bad abstime external representation '%s'", str);
|
||||
|
||||
#ifdef DATEDEBUG
|
||||
printf("nabstimein- %d fields are type %d (DTK_DATE=%d)\n", nf, dtype, DTK_DATE);
|
||||
@@ -296,7 +296,7 @@ nabstimein(char *str)
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(WARN, "Bad abstime (internal coding error) '%s'", str);
|
||||
elog(ABORT, "Bad abstime (internal coding error) '%s'", str);
|
||||
result = INVALID_ABSTIME;
|
||||
break;
|
||||
};
|
||||
@@ -547,7 +547,7 @@ abstime_datetime(AbsoluteTime abstime)
|
||||
DateTime *result;
|
||||
|
||||
if (!PointerIsValid(result = PALLOCTYPE(DateTime)))
|
||||
elog(WARN, "Unable to allocate space to convert abstime to datetime", NULL);
|
||||
elog(ABORT, "Unable to allocate space to convert abstime to datetime", NULL);
|
||||
|
||||
switch (abstime)
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.19 1997/12/20 00:10:29 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.20 1998/01/05 03:34:12 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -58,9 +58,9 @@ pg_atoi(char *s, int size, int c)
|
||||
errno = 0;
|
||||
l = strtol(s, &badp, 10);
|
||||
if (errno) /* strtol must set ERANGE */
|
||||
elog(WARN, "pg_atoi: error reading \"%s\": %m", s);
|
||||
elog(ABORT, "pg_atoi: error reading \"%s\": %m", s);
|
||||
if (badp && *badp && (*badp != c))
|
||||
elog(WARN, "pg_atoi: error in \"%s\": can\'t parse \"%s\"", s, badp);
|
||||
elog(ABORT, "pg_atoi: error in \"%s\": can\'t parse \"%s\"", s, badp);
|
||||
|
||||
switch (size)
|
||||
{
|
||||
@@ -70,12 +70,12 @@ pg_atoi(char *s, int size, int c)
|
||||
if (l < INT_MIN)
|
||||
{
|
||||
errno = ERANGE;
|
||||
elog(WARN, "pg_atoi: error reading \"%s\": %m", s);
|
||||
elog(ABORT, "pg_atoi: error reading \"%s\": %m", s);
|
||||
}
|
||||
if (l > INT_MAX)
|
||||
{
|
||||
errno = ERANGE;
|
||||
elog(WARN, "pg_atoi: error reading \"%s\": %m", s);
|
||||
elog(ABORT, "pg_atoi: error reading \"%s\": %m", s);
|
||||
}
|
||||
#endif /* HAS_LONG_LONG */
|
||||
break;
|
||||
@@ -83,28 +83,28 @@ pg_atoi(char *s, int size, int c)
|
||||
if (l < SHRT_MIN)
|
||||
{
|
||||
errno = ERANGE;
|
||||
elog(WARN, "pg_atoi: error reading \"%s\": %m", s);
|
||||
elog(ABORT, "pg_atoi: error reading \"%s\": %m", s);
|
||||
}
|
||||
if (l > SHRT_MAX)
|
||||
{
|
||||
errno = ERANGE;
|
||||
elog(WARN, "pg_atoi: error reading \"%s\": %m", s);
|
||||
elog(ABORT, "pg_atoi: error reading \"%s\": %m", s);
|
||||
}
|
||||
break;
|
||||
case sizeof(int8):
|
||||
if (l < SCHAR_MIN)
|
||||
{
|
||||
errno = ERANGE;
|
||||
elog(WARN, "pg_atoi: error reading \"%s\": %m", s);
|
||||
elog(ABORT, "pg_atoi: error reading \"%s\": %m", s);
|
||||
}
|
||||
if (l > SCHAR_MAX)
|
||||
{
|
||||
errno = ERANGE;
|
||||
elog(WARN, "pg_atoi: error reading \"%s\": %m", s);
|
||||
elog(ABORT, "pg_atoi: error reading \"%s\": %m", s);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
elog(WARN, "pg_atoi: invalid result size: %d", size);
|
||||
elog(ABORT, "pg_atoi: invalid result size: %d", size);
|
||||
}
|
||||
return ((int32) l);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidname.c,v 1.9 1997/10/25 01:10:41 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidname.c,v 1.10 1998/01/05 03:34:13 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -40,7 +40,7 @@ oidnamein(char *inStr)
|
||||
StrNCpy(oc->name.data, inptr, NAMEDATALEN);
|
||||
}
|
||||
else
|
||||
elog(WARN, "Bad input data for type oidname");
|
||||
elog(ABORT, "Bad input data for type oidname");
|
||||
|
||||
return oc;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regexp.c,v 1.11 1997/10/25 01:10:44 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regexp.c,v 1.12 1998/01/05 03:34:14 momjian Exp $
|
||||
*
|
||||
* Alistair Crooks added the code for the regex caching
|
||||
* agc - cached the regular expressions used - there's a good chance
|
||||
@@ -157,7 +157,7 @@ RE_compile_and_execute(struct varlena * text_re, char *text, int cflags)
|
||||
rev[oldest].cre_s = (char *) NULL;
|
||||
pg95_regerror(regcomp_result, &rev[oldest].cre_re, errMsg,
|
||||
sizeof(errMsg));
|
||||
elog(WARN, "regcomp failed with error %s", errMsg);
|
||||
elog(ABORT, "regcomp failed with error %s", errMsg);
|
||||
}
|
||||
|
||||
/* not reached */
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.10 1997/11/20 23:23:00 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.11 1998/01/05 03:34:14 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -45,7 +45,7 @@ regprocin(char *proname)
|
||||
proc = heap_openr(ProcedureRelationName);
|
||||
if (!RelationIsValid(proc))
|
||||
{
|
||||
elog(WARN, "regprocin: could not open %s",
|
||||
elog(ABORT, "regprocin: could not open %s",
|
||||
ProcedureRelationName);
|
||||
return (0);
|
||||
}
|
||||
@@ -59,7 +59,7 @@ regprocin(char *proname)
|
||||
if (!HeapScanIsValid(procscan))
|
||||
{
|
||||
heap_close(proc);
|
||||
elog(WARN, "regprocin: could not being scan of %s",
|
||||
elog(ABORT, "regprocin: could not being scan of %s",
|
||||
ProcedureRelationName);
|
||||
return (0);
|
||||
}
|
||||
@@ -104,7 +104,7 @@ regprocout(RegProcedure proid)
|
||||
proc = heap_openr(ProcedureRelationName);
|
||||
if (!RelationIsValid(proc))
|
||||
{
|
||||
elog(WARN, "regprocout: could not open %s",
|
||||
elog(ABORT, "regprocout: could not open %s",
|
||||
ProcedureRelationName);
|
||||
return (0);
|
||||
}
|
||||
@@ -118,7 +118,7 @@ regprocout(RegProcedure proid)
|
||||
if (!HeapScanIsValid(procscan))
|
||||
{
|
||||
heap_close(proc);
|
||||
elog(WARN, "regprocout: could not being scan of %s",
|
||||
elog(ABORT, "regprocout: could not being scan of %s",
|
||||
ProcedureRelationName);
|
||||
return (0);
|
||||
}
|
||||
@@ -176,7 +176,7 @@ oid8types(Oid (*oidArray)[])
|
||||
type = heap_openr(TypeRelationName);
|
||||
if (!RelationIsValid(type))
|
||||
{
|
||||
elog(WARN, "int8typeout: could not open %s",
|
||||
elog(ABORT, "int8typeout: could not open %s",
|
||||
TypeRelationName);
|
||||
return (0);
|
||||
}
|
||||
@@ -196,7 +196,7 @@ oid8types(Oid (*oidArray)[])
|
||||
if (!HeapScanIsValid(typescan))
|
||||
{
|
||||
heap_close(type);
|
||||
elog(WARN, "int8typeout: could not being scan of %s",
|
||||
elog(ABORT, "int8typeout: could not being scan of %s",
|
||||
TypeRelationName);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.12 1997/11/24 05:09:03 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.13 1998/01/05 03:34:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -287,7 +287,7 @@ getattdisbursion(Oid relid, AttrNumber attnum)
|
||||
0, 0);
|
||||
if (!HeapTupleIsValid(atp))
|
||||
{
|
||||
elog(WARN, "getattdisbursion: no attribute tuple %d %d",
|
||||
elog(ABORT, "getattdisbursion: no attribute tuple %d %d",
|
||||
relid, attnum);
|
||||
return (0);
|
||||
}
|
||||
@@ -304,7 +304,7 @@ getattdisbursion(Oid relid, AttrNumber attnum)
|
||||
*/
|
||||
if (!HeapTupleIsValid(atp))
|
||||
{
|
||||
elog(WARN, "getattdisbursion: no relation tuple %d", relid);
|
||||
elog(ABORT, "getattdisbursion: no relation tuple %d", relid);
|
||||
return (0);
|
||||
}
|
||||
ntuples = ((Form_pg_class) GETSTRUCT(atp))->reltuples;
|
||||
@@ -357,7 +357,7 @@ gethilokey(Oid relid,
|
||||
*low = "n";
|
||||
|
||||
/*
|
||||
* XXX elog(WARN, "gethilokey: statistic tuple not
|
||||
* XXX elog(ABORT, "gethilokey: statistic tuple not
|
||||
* found");
|
||||
*/
|
||||
return;
|
||||
@@ -417,9 +417,9 @@ btreesel(Oid operatorObjectId,
|
||||
}
|
||||
|
||||
if (!PointerIsValid(result))
|
||||
elog(WARN, "Btree Selectivity: bad pointer");
|
||||
elog(ABORT, "Btree Selectivity: bad pointer");
|
||||
if (*result < 0.0 || *result > 1.0)
|
||||
elog(WARN, "Btree Selectivity: bad value %lf", *result);
|
||||
elog(ABORT, "Btree Selectivity: bad value %lf", *result);
|
||||
|
||||
return (result);
|
||||
}
|
||||
@@ -465,7 +465,7 @@ btreenpage(Oid operatorObjectId,
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(atp))
|
||||
{
|
||||
elog(WARN, "btreenpage: no index tuple %d", indexrelid);
|
||||
elog(ABORT, "btreenpage: no index tuple %d", indexrelid);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -503,7 +503,7 @@ hashsel(Oid operatorObjectId,
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(atp))
|
||||
{
|
||||
elog(WARN, "hashsel: no index tuple %d", indexrelid);
|
||||
elog(ABORT, "hashsel: no index tuple %d", indexrelid);
|
||||
return (0);
|
||||
}
|
||||
ntuples = ((Form_pg_class) GETSTRUCT(atp))->reltuples;
|
||||
@@ -530,9 +530,9 @@ hashsel(Oid operatorObjectId,
|
||||
}
|
||||
|
||||
if (!PointerIsValid(result))
|
||||
elog(WARN, "Hash Table Selectivity: bad pointer");
|
||||
elog(ABORT, "Hash Table Selectivity: bad pointer");
|
||||
if (*result < 0.0 || *result > 1.0)
|
||||
elog(WARN, "Hash Table Selectivity: bad value %lf", *result);
|
||||
elog(ABORT, "Hash Table Selectivity: bad value %lf", *result);
|
||||
|
||||
return (result);
|
||||
|
||||
@@ -559,7 +559,7 @@ hashnpage(Oid operatorObjectId,
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(atp))
|
||||
{
|
||||
elog(WARN, "hashsel: no index tuple %d", indexrelid);
|
||||
elog(ABORT, "hashsel: no index tuple %d", indexrelid);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.9 1997/11/24 05:09:04 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.10 1998/01/05 03:34:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -90,7 +90,7 @@ SetDefine(char *querystr, char *typename)
|
||||
ObjectIdGetDatum(setoid),
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(tup))
|
||||
elog(WARN, "setin: unable to define set %s", querystr);
|
||||
elog(ABORT, "setin: unable to define set %s", querystr);
|
||||
|
||||
/*
|
||||
* We can tell whether the set was already defined by checking the
|
||||
@@ -145,7 +145,7 @@ SetDefine(char *querystr, char *typename)
|
||||
setoid = newtup->t_oid;
|
||||
}
|
||||
else
|
||||
elog(WARN, "setin: could not find new set oid tuple");
|
||||
elog(ABORT, "setin: could not find new set oid tuple");
|
||||
heap_endscan(pg_proc_scan);
|
||||
|
||||
if (RelationGetRelationTupleForm(procrel)->relhasindex)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.14 1997/12/23 19:24:43 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.15 1998/01/05 03:34:19 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -75,7 +75,7 @@ bpcharin(char *s, int dummy, int typlen)
|
||||
}
|
||||
|
||||
if (len > 4096)
|
||||
elog(WARN, "bpcharin: length of char() must be less than 4096");
|
||||
elog(ABORT, "bpcharin: length of char() must be less than 4096");
|
||||
|
||||
result = (char *) palloc(typlen);
|
||||
*(int32 *) result = typlen;
|
||||
@@ -145,7 +145,7 @@ varcharin(char *s, int dummy, int typlen)
|
||||
}
|
||||
|
||||
if (len > 4096)
|
||||
elog(WARN, "varcharin: length of char() must be less than 4096");
|
||||
elog(ABORT, "varcharin: length of char() must be less than 4096");
|
||||
|
||||
result = (char *) palloc(typlen);
|
||||
*(int32 *) result = typlen;
|
||||
@@ -199,7 +199,7 @@ int32
|
||||
bpcharlen(char *arg)
|
||||
{
|
||||
if (!PointerIsValid(arg))
|
||||
elog(WARN, "Bad (null) char() external representation", NULL);
|
||||
elog(ABORT, "Bad (null) char() external representation", NULL);
|
||||
|
||||
return(bcTruelen(arg));
|
||||
} /* bpcharlen() */
|
||||
@@ -355,7 +355,7 @@ int32
|
||||
varcharlen(char *arg)
|
||||
{
|
||||
if (!PointerIsValid(arg))
|
||||
elog(WARN, "Bad (null) varchar() external representation", NULL);
|
||||
elog(ABORT, "Bad (null) varchar() external representation", NULL);
|
||||
|
||||
return(vcTruelen(arg));
|
||||
} /* vclen() */
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.26 1998/01/01 05:50:50 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.27 1998/01/05 03:34:20 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -31,7 +31,7 @@
|
||||
*
|
||||
* Non-printable characters must be passed as '\nnn' (octal) and are
|
||||
* converted to internal form. '\' must be passed as '\\'.
|
||||
* elog(WARN, ...) if bad form.
|
||||
* elog(ABORT, ...) if bad form.
|
||||
*
|
||||
* BUGS:
|
||||
* The input is scaned twice.
|
||||
@@ -46,7 +46,7 @@ byteain(char *inputText)
|
||||
text *result;
|
||||
|
||||
if (inputText == NULL)
|
||||
elog(WARN, "Bad input string for type bytea");
|
||||
elog(ABORT, "Bad input string for type bytea");
|
||||
|
||||
for (byte = 0, tp = inputText; *tp != '\0'; byte++)
|
||||
if (*tp++ == '\\')
|
||||
@@ -56,7 +56,7 @@ byteain(char *inputText)
|
||||
else if (!isdigit(*tp++) ||
|
||||
!isdigit(*tp++) ||
|
||||
!isdigit(*tp++))
|
||||
elog(WARN, "Bad input string for type bytea");
|
||||
elog(ABORT, "Bad input string for type bytea");
|
||||
}
|
||||
tp = inputText;
|
||||
byte += VARHDRSZ;
|
||||
@@ -195,7 +195,7 @@ int32
|
||||
textlen(text *t)
|
||||
{
|
||||
if (!PointerIsValid(t))
|
||||
elog(WARN,"Null input to textlen");
|
||||
elog(ABORT,"Null input to textlen");
|
||||
|
||||
return (VARSIZE(t) - VARHDRSZ);
|
||||
} /* textlen() */
|
||||
@@ -537,7 +537,7 @@ byteaGetByte(text *v, int32 n)
|
||||
|
||||
if (n >= len)
|
||||
{
|
||||
elog(WARN, "byteaGetByte: index (=%d) out of range [0..%d]",
|
||||
elog(ABORT, "byteaGetByte: index (=%d) out of range [0..%d]",
|
||||
n, len - 1);
|
||||
}
|
||||
|
||||
@@ -595,7 +595,7 @@ byteaSetByte(text *v, int32 n, int32 newByte)
|
||||
|
||||
if (n >= len)
|
||||
{
|
||||
elog(WARN,
|
||||
elog(ABORT,
|
||||
"byteaSetByte: index (=%d) out of range [0..%d]",
|
||||
n, len - 1);
|
||||
}
|
||||
@@ -606,7 +606,7 @@ byteaSetByte(text *v, int32 n, int32 newByte)
|
||||
res = (text *) palloc(VARSIZE(v));
|
||||
if (res == NULL)
|
||||
{
|
||||
elog(WARN, "byteaSetByte: Out of memory (%d bytes requested)",
|
||||
elog(ABORT, "byteaSetByte: Out of memory (%d bytes requested)",
|
||||
VARSIZE(v));
|
||||
}
|
||||
memmove((char *) res, (char *) v, VARSIZE(v));
|
||||
@@ -641,7 +641,7 @@ byteaSetBit(text *v, int32 n, int32 newBit)
|
||||
*/
|
||||
if (newBit != 0 && newBit != 1)
|
||||
{
|
||||
elog(WARN, "byteaSetByte: new bit must be 0 or 1");
|
||||
elog(ABORT, "byteaSetByte: new bit must be 0 or 1");
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user