aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/adt')
-rw-r--r--src/backend/utils/adt/cash.c30
-rw-r--r--src/backend/utils/adt/date.c6
-rw-r--r--src/backend/utils/adt/datetime.c24
-rw-r--r--src/backend/utils/adt/dt.c36
-rw-r--r--src/backend/utils/adt/float.c18
-rw-r--r--src/backend/utils/adt/geo_ops.c34
-rw-r--r--src/backend/utils/adt/nabstime.c6
-rw-r--r--src/backend/utils/adt/ruleutils.c6
-rw-r--r--src/backend/utils/adt/selfuncs.c6
-rw-r--r--src/backend/utils/adt/tid.c4
-rw-r--r--src/backend/utils/adt/varchar.c18
-rw-r--r--src/backend/utils/adt/varlena.c3
12 files changed, 96 insertions, 95 deletions
diff --git a/src/backend/utils/adt/cash.c b/src/backend/utils/adt/cash.c
index 0bc44f4b95b..1dd31df3438 100644
--- a/src/backend/utils/adt/cash.c
+++ b/src/backend/utils/adt/cash.c
@@ -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.32 1999/07/17 20:17:54 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.33 2000/01/15 02:59:36 petere Exp $
*/
#include <limits.h>
@@ -285,7 +285,7 @@ cash_out(Cash *in_value)
if (minus)
{
if (!PointerIsValid(result = palloc(CASH_BUFSZ + 2 - count + strlen(nsymbol))))
- elog(ERROR, "Memory allocation failed, can't output cash", NULL);
+ elog(ERROR, "Memory allocation failed, can't output cash");
/* Position code of 0 means use parens */
if (convention == 0)
@@ -298,7 +298,7 @@ cash_out(Cash *in_value)
else
{
if (!PointerIsValid(result = palloc(CASH_BUFSZ + 2 - count)))
- elog(ERROR, "Memory allocation failed, can't output cash", NULL);
+ elog(ERROR, "Memory allocation failed, can't output cash");
strcpy(result, buf + count);
}
@@ -374,7 +374,7 @@ cash_pl(Cash *c1, Cash *c2)
return NULL;
if (!PointerIsValid(result = palloc(sizeof(Cash))))
- elog(ERROR, "Memory allocation failed, can't add cash", NULL);
+ elog(ERROR, "Memory allocation failed, can't add cash");
*result = (*c1 + *c2);
@@ -394,7 +394,7 @@ cash_mi(Cash *c1, Cash *c2)
return NULL;
if (!PointerIsValid(result = palloc(sizeof(Cash))))
- elog(ERROR, "Memory allocation failed, can't subtract cash", NULL);
+ elog(ERROR, "Memory allocation failed, can't subtract cash");
*result = (*c1 - *c2);
@@ -414,7 +414,7 @@ cash_mul_flt8(Cash *c, float8 *f)
return NULL;
if (!PointerIsValid(result = palloc(sizeof(Cash))))
- elog(ERROR, "Memory allocation failed, can't multiply cash", NULL);
+ elog(ERROR, "Memory allocation failed, can't multiply cash");
*result = ((*f) * (*c));
@@ -447,7 +447,7 @@ cash_div_flt8(Cash *c, float8 *f)
return NULL;
if (!PointerIsValid(result = palloc(sizeof(Cash))))
- elog(ERROR, "Memory allocation failed, can't divide cash", NULL);
+ elog(ERROR, "Memory allocation failed, can't divide cash");
if (*f == 0.0)
elog(ERROR, "cash_div: divide by 0.0 error");
@@ -469,7 +469,7 @@ cash_mul_flt4(Cash *c, float4 *f)
return NULL;
if (!PointerIsValid(result = palloc(sizeof(Cash))))
- elog(ERROR, "Memory allocation failed, can't multiply cash", NULL);
+ elog(ERROR, "Memory allocation failed, can't multiply cash");
*result = ((*f) * (*c));
@@ -502,7 +502,7 @@ cash_div_flt4(Cash *c, float4 *f)
return NULL;
if (!PointerIsValid(result = palloc(sizeof(Cash))))
- elog(ERROR, "Memory allocation failed, can't divide cash", NULL);
+ elog(ERROR, "Memory allocation failed, can't divide cash");
if (*f == 0.0)
elog(ERROR, "cash_div: divide by 0.0 error");
@@ -525,7 +525,7 @@ cash_mul_int4(Cash *c, int4 i)
return NULL;
if (!PointerIsValid(result = palloc(sizeof(Cash))))
- elog(ERROR, "Memory allocation failed, can't multiply cash", NULL);
+ elog(ERROR, "Memory allocation failed, can't multiply cash");
*result = ((i) * (*c));
@@ -558,7 +558,7 @@ cash_div_int4(Cash *c, int4 i)
return NULL;
if (!PointerIsValid(result = palloc(sizeof(Cash))))
- elog(ERROR, "Memory allocation failed, can't divide cash", NULL);
+ elog(ERROR, "Memory allocation failed, can't divide cash");
if (i == 0)
elog(ERROR, "cash_idiv: divide by 0 error");
@@ -581,7 +581,7 @@ cash_mul_int2(Cash *c, int2 s)
return NULL;
if (!PointerIsValid(result = palloc(sizeof(Cash))))
- elog(ERROR, "Memory allocation failed, can't multiply cash", NULL);
+ elog(ERROR, "Memory allocation failed, can't multiply cash");
*result = ((s) * (*c));
@@ -614,7 +614,7 @@ cash_div_int2(Cash *c, int2 s)
return NULL;
if (!PointerIsValid(result = palloc(sizeof(Cash))))
- elog(ERROR, "Memory allocation failed, can't divide cash", NULL);
+ elog(ERROR, "Memory allocation failed, can't divide cash");
if (s == 0)
elog(ERROR, "cash_div: divide by 0 error");
@@ -637,7 +637,7 @@ cashlarger(Cash *c1, Cash *c2)
return NULL;
if (!PointerIsValid(result = palloc(sizeof(Cash))))
- elog(ERROR, "Memory allocation failed, can't return larger cash", NULL);
+ elog(ERROR, "Memory allocation failed, can't return larger cash");
*result = ((*c1 > *c2) ? *c1 : *c2);
@@ -657,7 +657,7 @@ cashsmaller(Cash *c1, Cash *c2)
return NULL;
if (!PointerIsValid(result = palloc(sizeof(Cash))))
- elog(ERROR, "Memory allocation failed, can't return smaller cash", NULL);
+ elog(ERROR, "Memory allocation failed, can't return smaller cash");
*result = ((*c1 < *c2) ? *c1 : *c2);
diff --git a/src/backend/utils/adt/date.c b/src/backend/utils/adt/date.c
index 7045b6d2091..c2144e85430 100644
--- a/src/backend/utils/adt/date.c
+++ b/src/backend/utils/adt/date.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.39 2000/01/02 01:37:26 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.40 2000/01/15 02:59:36 petere Exp $
*
* NOTES
* This code is actually (almost) unused.
@@ -133,7 +133,7 @@ reltimein(char *str)
char lowstr[MAXDATELEN + 1];
if (!PointerIsValid(str))
- elog(ERROR, "Bad (null) date external representation", NULL);
+ elog(ERROR, "Bad (null) date external representation");
if (strlen(str) > MAXDATELEN)
elog(ERROR, "Bad (length) reltime external representation '%s'", str);
@@ -362,7 +362,7 @@ reltime_timespan(RelativeTime reltime)
month;
if (!PointerIsValid(result = palloc(sizeof(TimeSpan))))
- elog(ERROR, "Memory allocation failed, can't convert reltime to timespan", NULL);
+ elog(ERROR, "Memory allocation failed, can't convert reltime to timespan");
switch (reltime)
{
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index 508b2dffb24..2d733ccec56 100644
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.39 2000/01/02 01:37:26 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.40 2000/01/15 02:59:36 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -46,7 +46,7 @@ date_in(char *str)
char lowstr[MAXDATELEN + 1];
if (!PointerIsValid(str))
- elog(ERROR, "Bad (null) date external representation", NULL);
+ elog(ERROR, "Bad (null) date external representation");
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)
|| (DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tzp) != 0))
@@ -199,10 +199,10 @@ date_datetime(DateADT dateVal)
result = palloc(sizeof(DateTime));
if (date2tm(dateVal, &tz, tm, &fsec, &tzn) != 0)
- elog(ERROR, "Unable to convert date to datetime", NULL);
+ elog(ERROR, "Unable to convert date to datetime");
if (tm2datetime(tm, fsec, &tz, result) != 0)
- elog(ERROR, "Datetime out of range", NULL);
+ elog(ERROR, "Datetime out of range");
return result;
} /* date_datetime() */
@@ -222,10 +222,10 @@ datetime_date(DateTime *datetime)
char *tzn;
if (!PointerIsValid(datetime))
- elog(ERROR, "Unable to convert null datetime to date", NULL);
+ elog(ERROR, "Unable to convert null datetime to date");
if (DATETIME_NOT_FINITE(*datetime))
- elog(ERROR, "Unable to convert datetime to date", NULL);
+ elog(ERROR, "Unable to convert datetime to date");
if (DATETIME_IS_EPOCH(*datetime))
{
@@ -240,7 +240,7 @@ datetime_date(DateTime *datetime)
else
{
if (datetime2tm(*datetime, &tz, tm, &fsec, &tzn) != 0)
- elog(ERROR, "Unable to convert datetime to date", NULL);
+ elog(ERROR, "Unable to convert datetime to date");
}
result = (date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - date2j(2000, 1, 1));
@@ -265,7 +265,7 @@ abstime_date(AbsoluteTime abstime)
case INVALID_ABSTIME:
case NOSTART_ABSTIME:
case NOEND_ABSTIME:
- elog(ERROR, "Unable to convert reserved abstime value to date", NULL);
+ elog(ERROR, "Unable to convert reserved abstime value to date");
/*
* pretend to drop through to make compiler think that result
@@ -387,7 +387,7 @@ time_in(char *str)
int ftype[MAXDATEFIELDS];
if (!PointerIsValid(str))
- elog(ERROR, "Bad (null) time external representation", NULL);
+ elog(ERROR, "Bad (null) time external representation");
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)
|| (DecodeTimeOnly(field, ftype, nf, &dtype, tm, &fsec) != 0))
@@ -505,10 +505,10 @@ datetime_time(DateTime *datetime)
char *tzn;
if (!PointerIsValid(datetime))
- elog(ERROR, "Unable to convert null datetime to date", NULL);
+ elog(ERROR, "Unable to convert null datetime to date");
if (DATETIME_NOT_FINITE(*datetime))
- elog(ERROR, "Unable to convert datetime to date", NULL);
+ elog(ERROR, "Unable to convert datetime to date");
if (DATETIME_IS_EPOCH(*datetime))
{
@@ -523,7 +523,7 @@ datetime_time(DateTime *datetime)
else
{
if (datetime2tm(*datetime, &tz, tm, &fsec, &tzn) != 0)
- elog(ERROR, "Unable to convert datetime to date", NULL);
+ elog(ERROR, "Unable to convert datetime to date");
}
result = palloc(sizeof(TimeADT));
diff --git a/src/backend/utils/adt/dt.c b/src/backend/utils/adt/dt.c
index a9ae4eebe37..e633613eca4 100644
--- a/src/backend/utils/adt/dt.c
+++ b/src/backend/utils/adt/dt.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.80 2000/01/04 07:53:27 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.81 2000/01/15 02:59:36 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -114,7 +114,7 @@ datetime_in(char *str)
char lowstr[MAXDATELEN + 1];
if (!PointerIsValid(str))
- elog(ERROR, "Bad (null) datetime external representation", NULL);
+ elog(ERROR, "Bad (null) datetime external representation");
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)
|| (DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tz) != 0))
@@ -223,7 +223,7 @@ timespan_in(char *str)
fsec = 0;
if (!PointerIsValid(str))
- elog(ERROR, "Bad (null) timespan external representation", NULL);
+ elog(ERROR, "Bad (null) timespan external representation");
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)
|| (DecodeDateDelta(field, ftype, nf, &dtype, tm, &fsec) != 0))
@@ -270,7 +270,7 @@ timespan_out(TimeSpan *span)
return NULL;
if (EncodeTimeSpan(tm, fsec, DateStyle, buf) != 0)
- elog(ERROR, "Unable to format timespan", NULL);
+ elog(ERROR, "Unable to format timespan");
result = palloc(strlen(buf) + 1);
@@ -841,7 +841,7 @@ datetime_pl_span(DateTime *datetime, TimeSpan *span)
tm->tm_mday = (day_tab[isleap(tm->tm_year)][tm->tm_mon - 1]);
if (tm2datetime(tm, fsec, &tz, &dt) != 0)
- elog(ERROR, "Unable to add datetime and timespan", NULL);
+ elog(ERROR, "Unable to add datetime and timespan");
}
else
@@ -1037,7 +1037,7 @@ timespan_div(TimeSpan *span1, float8 *arg2)
return NULL;
if (!PointerIsValid(result = palloc(sizeof(TimeSpan))))
- elog(ERROR, "Memory allocation failed, can't divide timespans", NULL);
+ elog(ERROR, "Memory allocation failed, can't divide timespans");
if (*arg2 == 0.0)
elog(ERROR, "timespan_div: divide by 0.0 error");
@@ -1164,11 +1164,11 @@ datetime_age(DateTime *datetime1, DateTime *datetime2)
}
if (tm2timespan(tm, fsec, result) != 0)
- elog(ERROR, "Unable to decode datetime", NULL);
+ elog(ERROR, "Unable to decode datetime");
}
else
- elog(ERROR, "Unable to decode datetime", NULL);
+ elog(ERROR, "Unable to decode datetime");
return result;
} /* datetime_age() */
@@ -1528,7 +1528,7 @@ timespan_trunc(text *units, TimeSpan *timespan)
}
else
{
- elog(NOTICE, "Timespan out of range", NULL);
+ elog(NOTICE, "Timespan out of range");
result = NULL;
}
@@ -1547,7 +1547,7 @@ timespan_trunc(text *units, TimeSpan *timespan)
}
else
{
- elog(ERROR, "Timespan units '%s' not recognized", units);
+ elog(ERROR, "Timespan units '%s' not recognized", textout(units));
result = NULL;
}
@@ -1688,14 +1688,14 @@ datetime_part(text *units, DateTime *datetime)
case DTK_DOW:
if (datetime2tm(dt, &tz, tm, &fsec, &tzn) != 0)
- elog(ERROR, "Unable to encode datetime", NULL);
+ elog(ERROR, "Unable to encode datetime");
*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(ERROR, "Unable to encode datetime", NULL);
+ elog(ERROR, "Unable to encode datetime");
*result = (date2j(tm->tm_year, tm->tm_mon, tm->tm_mday)
- date2j(tm->tm_year, 1, 1) + 1);
@@ -1754,7 +1754,7 @@ timespan_part(text *units, TimeSpan *timespan)
if (TIMESPAN_IS_INVALID(*timespan))
{
#if NOT_USED
- elog(ERROR, "Timespan is not finite", NULL);
+ elog(ERROR, "Timespan is not finite");
#endif
*result = 0;
@@ -1815,14 +1815,14 @@ timespan_part(text *units, TimeSpan *timespan)
break;
default:
- elog(ERROR, "Timespan units '%s' not yet supported", units);
+ elog(ERROR, "Timespan units '%s' not yet supported", textout(units));
result = NULL;
}
}
else
{
- elog(NOTICE, "Timespan out of range", NULL);
+ elog(NOTICE, "Timespan out of range");
*result = 0;
}
@@ -1839,7 +1839,7 @@ timespan_part(text *units, TimeSpan *timespan)
}
else
{
- elog(ERROR, "Timespan units '%s' not recognized", units);
+ elog(ERROR, "Timespan units '%s' not recognized", textout(units));
*result = 0;
}
@@ -1889,7 +1889,7 @@ datetime_zone(text *zone, DateTime *datetime)
* could return null but Postgres doesn't like that currently. -
* tgl 97/06/12
*/
- elog(ERROR, "Datetime is not finite", NULL);
+ elog(ERROR, "Datetime is not finite");
result = NULL;
}
@@ -1902,7 +1902,7 @@ datetime_zone(text *zone, DateTime *datetime)
dt = dt2local(dt, tz);
if (datetime2tm(dt, NULL, tm, &fsec, NULL) != 0)
- elog(ERROR, "Datetime not legal", NULL);
+ elog(ERROR, "Datetime not legal");
up = upzone;
lp = lowzone;
diff --git a/src/backend/utils/adt/float.c b/src/backend/utils/adt/float.c
index 6145ad04614..1a3eddb9ab2 100644
--- a/src/backend/utils/adt/float.c
+++ b/src/backend/utils/adt/float.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.51 1999/12/20 02:15:35 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.52 2000/01/15 02:59:37 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -830,10 +830,10 @@ dtoi4(float64 num)
int32 result;
if (!PointerIsValid(num))
- elog(ERROR, "dtoi4: unable to convert null", NULL);
+ elog(ERROR, "dtoi4: unable to convert null");
if ((*num < INT_MIN) || (*num > INT_MAX))
- elog(ERROR, "dtoi4: integer out of range", NULL);
+ elog(ERROR, "dtoi4: integer out of range");
result = rint(*num);
return result;
@@ -849,10 +849,10 @@ dtoi2(float64 num)
int16 result;
if (!PointerIsValid(num))
- elog(ERROR, "dtoi2: unable to convert null", NULL);
+ elog(ERROR, "dtoi2: unable to convert null");
if ((*num < SHRT_MIN) || (*num > SHRT_MAX))
- elog(ERROR, "dtoi2: integer out of range", NULL);
+ elog(ERROR, "dtoi2: integer out of range");
result = rint(*num);
return result;
@@ -898,10 +898,10 @@ ftoi4(float32 num)
int32 result;
if (!PointerIsValid(num))
- elog(ERROR, "ftoi4: unable to convert null", NULL);
+ elog(ERROR, "ftoi4: unable to convert null");
if ((*num < INT_MIN) || (*num > INT_MAX))
- elog(ERROR, "ftoi4: integer out of range", NULL);
+ elog(ERROR, "ftoi4: integer out of range");
result = rint(*num);
return result;
@@ -917,10 +917,10 @@ ftoi2(float32 num)
int16 result;
if (!PointerIsValid(num))
- elog(ERROR, "ftoi2: unable to convert null", NULL);
+ elog(ERROR, "ftoi2: unable to convert null");
if ((*num < SHRT_MIN) || (*num > SHRT_MAX))
- elog(ERROR, "ftoi2: integer out of range", NULL);
+ elog(ERROR, "ftoi2: integer out of range");
result = rint(*num);
return result;
diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c
index b56b7f5d8da..5fc86c6a62e 100644
--- a/src/backend/utils/adt/geo_ops.c
+++ b/src/backend/utils/adt/geo_ops.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.46 1999/12/21 17:01:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.47 2000/01/15 02:59:37 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -282,7 +282,7 @@ path_encode(bool closed, int npts, Point *pt)
{
*cp++ = LDELIM;
if (!pair_encode(pt->x, pt->y, cp))
- elog(ERROR, "Unable to format path", NULL);
+ elog(ERROR, "Unable to format path");
cp += strlen(cp);
*cp++ = RDELIM;
*cp++ = DELIM;
@@ -352,7 +352,7 @@ box_in(char *str)
y;
if (!PointerIsValid(str))
- elog(ERROR, " Bad (null) box external representation", NULL);
+ elog(ERROR, " Bad (null) box external representation");
if ((!path_decode(FALSE, 2, str, &isopen, &s, &(box->high)))
|| (*s != '\0'))
@@ -777,7 +777,7 @@ line_in(char *str)
#endif
if (!PointerIsValid(str))
- elog(ERROR, " Bad (null) line external representation", NULL);
+ elog(ERROR, " Bad (null) line external representation");
#ifdef ENABLE_LINE_TYPE
if ((!path_decode(TRUE, 2, str, &isopen, &s, &(lseg.p[0])))
@@ -1645,7 +1645,7 @@ lseg_in(char *str)
char *s;
if (!PointerIsValid(str))
- elog(ERROR, " Bad (null) lseg external representation", NULL);
+ elog(ERROR, " Bad (null) lseg external representation");
lseg = palloc(sizeof(LSEG));
@@ -2193,7 +2193,7 @@ dist_cpoly(CIRCLE *circle, POLYGON *poly)
LSEG seg;
if (!PointerIsValid(circle) || !PointerIsValid(poly))
- elog(ERROR, "Invalid (null) input for distance", NULL);
+ elog(ERROR, "Invalid (null) input for distance");
if (point_inside(&(circle->center), poly->npts, poly->p))
{
@@ -2669,7 +2669,7 @@ Point *
close_lb(LINE *line, BOX *box)
{
/* think about this one for a while */
- elog(ERROR, "close_lb not implemented", NULL);
+ elog(ERROR, "close_lb not implemented");
return NULL;
}
@@ -2939,7 +2939,7 @@ make_bound_box(POLYGON *poly)
box_fill(&(poly->boundbox), x1, x2, y1, y2);
}
else
- elog(ERROR, "Unable to create bounding box for empty polygon", NULL);
+ elog(ERROR, "Unable to create bounding box for empty polygon");
}
/*------------------------------------------------------------------
@@ -3540,7 +3540,7 @@ path_center(PATH *path)
if (!PointerIsValid(path))
return NULL;
- elog(ERROR, "path_center not implemented", NULL);
+ elog(ERROR, "path_center not implemented");
result = palloc(sizeof(Point));
result = NULL;
@@ -3559,7 +3559,7 @@ path_poly(PATH *path)
return NULL;
if (!path->closed)
- elog(ERROR, "Open path cannot be converted to polygon", NULL);
+ elog(ERROR, "Open path cannot be converted to polygon");
size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * path->npts);
poly = palloc(size);
@@ -3598,7 +3598,7 @@ upgradepath(PATH *path)
return NULL;
if (!isoldpath(path))
- elog(ERROR, "upgradepath: path already upgraded?", NULL);
+ elog(ERROR, "upgradepath: path already upgraded?");
npts = (path->npts - 1);
size = offsetof(PATH, p[0]) +(sizeof(path->p[0]) * npts);
@@ -3862,7 +3862,7 @@ circle_in(char *str)
int depth = 0;
if (!PointerIsValid(str))
- elog(ERROR, " Bad (null) circle external representation", NULL);
+ elog(ERROR, " Bad (null) circle external representation");
circle = palloc(sizeof(CIRCLE));
@@ -3927,13 +3927,13 @@ circle_out(CIRCLE *circle)
*cp++ = LDELIM_C;
*cp++ = LDELIM;
if (!pair_encode(circle->center.x, circle->center.y, cp))
- elog(ERROR, "Unable to format circle", NULL);
+ elog(ERROR, "Unable to format circle");
cp += strlen(cp);
*cp++ = RDELIM;
*cp++ = DELIM;
if (!single_encode(circle->radius, cp))
- elog(ERROR, "Unable to format circle", NULL);
+ elog(ERROR, "Unable to format circle");
cp += strlen(cp);
*cp++ = RDELIM_C;
@@ -4395,7 +4395,7 @@ circle_poly(int npts, CIRCLE *circle)
return NULL;
if (FPzero(circle->radius) || (npts < 2))
- elog(ERROR, "Unable to convert circle to polygon", NULL);
+ elog(ERROR, "Unable to convert circle to polygon");
size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * npts);
poly = palloc(size);
@@ -4431,7 +4431,7 @@ poly_circle(POLYGON *poly)
return NULL;
if (poly->npts < 2)
- elog(ERROR, "Unable to convert polygon to circle", NULL);
+ elog(ERROR, "Unable to convert polygon to circle");
circle = palloc(sizeof(CIRCLE));
@@ -4452,7 +4452,7 @@ poly_circle(POLYGON *poly)
circle->radius /= poly->npts;
if (FPzero(circle->radius))
- elog(ERROR, "Unable to convert polygon to circle", NULL);
+ elog(ERROR, "Unable to convert polygon to circle");
return circle;
} /* poly_circle() */
diff --git a/src/backend/utils/adt/nabstime.c b/src/backend/utils/adt/nabstime.c
index 1b57d70c91b..e2ad623a470 100644
--- a/src/backend/utils/adt/nabstime.c
+++ b/src/backend/utils/adt/nabstime.c
@@ -4,7 +4,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nabstime.c,v 1.63 2000/01/02 01:37:27 momjian Exp $
+ * $Id: nabstime.c,v 1.64 2000/01/15 02:59:38 petere Exp $
*
*/
#include <ctype.h>
@@ -265,7 +265,7 @@ nabstimein(char *str)
ftype[MAXDATEFIELDS];
if (!PointerIsValid(str))
- elog(ERROR, "Bad (null) abstime external representation", NULL);
+ elog(ERROR, "Bad (null) abstime external representation");
if (strlen(str) > MAXDATELEN)
elog(ERROR, "Bad (length) abstime external representation '%s'", str);
@@ -552,7 +552,7 @@ abstime_datetime(AbsoluteTime abstime)
DateTime *result;
if (!PointerIsValid(result = palloc(sizeof(DateTime))))
- elog(ERROR, "Unable to allocate space to convert abstime to datetime", NULL);
+ elog(ERROR, "Unable to allocate space to convert abstime to datetime");
switch (abstime)
{
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 8e473b558a0..496fb94ddc9 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -3,7 +3,7 @@
* out of its tuple
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.37 2000/01/05 18:23:50 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.38 2000/01/15 02:59:38 petere Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@@ -411,10 +411,10 @@ pg_get_indexdef(Oid indexrelid)
spirc = SPI_execp(plan_getam, spi_args, spi_nulls, 1);
if (spirc != SPI_OK_SELECT)
elog(ERROR, "failed to get pg_am tuple for index %s",
- idxrelrec->relname);
+ NameStr(idxrelrec->relname));
if (SPI_processed != 1)
elog(ERROR, "failed to get pg_am tuple for index %s",
- idxrelrec->relname);
+ NameStr(idxrelrec->relname));
spi_tup = SPI_tuptable->vals[0];
spi_ttc = SPI_tuptable->tupdesc;
spi_fno = SPI_fnumber(spi_ttc, "amname");
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index 5755926e9d8..b711d768c07 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.46 2000/01/10 17:14:38 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.47 2000/01/15 02:59:38 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -760,7 +760,7 @@ btreesel(Oid operatorObjectId,
if (!PointerIsValid(result))
elog(ERROR, "Btree Selectivity: bad pointer");
if (*result < 0.0 || *result > 1.0)
- elog(ERROR, "Btree Selectivity: bad value %lf", *result);
+ elog(ERROR, "Btree Selectivity: bad value %f", *result);
return result;
}
@@ -911,7 +911,7 @@ hashsel(Oid operatorObjectId,
if (!PointerIsValid(result))
elog(ERROR, "Hash Table Selectivity: bad pointer");
if (*result < 0.0 || *result > 1.0)
- elog(ERROR, "Hash Table Selectivity: bad value %lf", *result);
+ elog(ERROR, "Hash Table Selectivity: bad value %f", *result);
return result;
diff --git a/src/backend/utils/adt/tid.c b/src/backend/utils/adt/tid.c
index dc243205e91..25c22cfb8c3 100644
--- a/src/backend/utils/adt/tid.c
+++ b/src/backend/utils/adt/tid.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/tid.c,v 1.13 1999/12/20 01:23:04 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/tid.c,v 1.14 2000/01/15 02:59:38 petere Exp $
*
* NOTES
* input routine largely stolen from boxin().
@@ -200,7 +200,7 @@ currtid_byrelname(const text *relname, ItemPointer tid)
heap_close(rel, AccessShareLock);
}
else
- elog(ERROR, "Relation %s not found", relname);
+ elog(ERROR, "Relation %s not found", textout((text *)relname));
pfree(str);
return result;
diff --git a/src/backend/utils/adt/varchar.c b/src/backend/utils/adt/varchar.c
index 9ac113301d7..c821a35a2df 100644
--- a/src/backend/utils/adt/varchar.c
+++ b/src/backend/utils/adt/varchar.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.55 1999/11/07 23:08:24 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.56 2000/01/15 02:59:38 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -83,7 +83,7 @@ bpcharin(char *s, int dummy, int32 atttypmod)
len = atttypmod - VARHDRSZ;
if (len > MaxAttrSize)
- elog(ERROR, "bpcharin: length of char() must be less than %d",
+ elog(ERROR, "bpcharin: length of char() must be less than %ld",
MaxAttrSize);
result = (char *) palloc(atttypmod);
@@ -154,7 +154,7 @@ bpchar(char *s, int32 len)
rlen = len - VARHDRSZ;
if (rlen > MaxAttrSize)
- elog(ERROR, "bpchar: length of char() must be less than %d",
+ elog(ERROR, "bpchar: length of char() must be less than %ld",
MaxAttrSize);
#ifdef STRINGDEBUG
@@ -336,7 +336,7 @@ varcharin(char *s, int dummy, int32 atttypmod)
len = atttypmod; /* clip the string at max length */
if (len > MaxAttrSize)
- elog(ERROR, "varcharin: length of char() must be less than %d",
+ elog(ERROR, "varcharin: length of char() must be less than %ld",
MaxAttrSize);
result = (char *) palloc(len);
@@ -408,7 +408,7 @@ varchar(char *s, int32 slen)
#endif
if (len > MaxAttrSize)
- elog(ERROR, "varchar: length of varchar() must be less than %d",
+ elog(ERROR, "varchar: length of varchar() must be less than %ld",
MaxAttrSize);
result = (char *) palloc(slen);
@@ -460,7 +460,7 @@ bpcharlen(char *arg)
#endif
if (!PointerIsValid(arg))
- elog(ERROR, "Bad (null) char() external representation", NULL);
+ elog(ERROR, "Bad (null) char() external representation");
#ifdef MULTIBYTE
l = bcTruelen(arg);
len = 0;
@@ -482,7 +482,7 @@ int32
bpcharoctetlen(char *arg)
{
if (!PointerIsValid(arg))
- elog(ERROR, "Bad (null) char() external representation", NULL);
+ elog(ERROR, "Bad (null) char() external representation");
return bcTruelen(arg);
}
@@ -629,7 +629,7 @@ varcharlen(char *arg)
#endif
if (!PointerIsValid(arg))
- elog(ERROR, "Bad (null) varchar() external representation", NULL);
+ elog(ERROR, "Bad (null) varchar() external representation");
#ifdef MULTIBYTE
len = 0;
@@ -652,7 +652,7 @@ int32
varcharoctetlen(char *arg)
{
if (!PointerIsValid(arg))
- elog(ERROR, "Bad (null) varchar() external representation", NULL);
+ elog(ERROR, "Bad (null) varchar() external representation");
return VARSIZE(arg) - VARHDRSZ;
}
diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c
index 90f898fe971..aaa0ffd4504 100644
--- a/src/backend/utils/adt/varlena.c
+++ b/src/backend/utils/adt/varlena.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.54 1999/11/07 23:08:24 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.55 2000/01/15 02:59:38 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -172,6 +172,7 @@ textin(char *inputText)
* textout - converts internal representation to "..."
*/
char *
+
textout(text *vlena)
{
int len;