mirror of
https://github.com/postgres/postgres.git
synced 2025-11-15 03:41:20 +03:00
Remove un-needed braces around single statements.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.27 1998/02/26 04:36:47 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.28 1998/06/15 19:29:31 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -98,13 +98,9 @@ aclparse(char *s, AclItem *aip, unsigned *modechg)
|
||||
*s != ACL_MODECHG_EQL_CHR)
|
||||
{ /* we just read a keyword, not a name */
|
||||
if (!strcmp(name, ACL_IDTYPE_GID_KEYWORD))
|
||||
{
|
||||
aip->ai_idtype = ACL_IDTYPE_GID;
|
||||
}
|
||||
else if (strcmp(name, ACL_IDTYPE_UID_KEYWORD))
|
||||
{
|
||||
elog(ERROR, "aclparse: bad keyword, must be [group|user]");
|
||||
}
|
||||
s = getid(s, name); /* move s to the name beyond the keyword */
|
||||
if (name[0] == '\0')
|
||||
elog(ERROR, "aclparse: a name must follow the [group|user] keyword");
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.29 1998/03/30 16:47:23 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.30 1998/06/15 19:29:32 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -157,9 +157,7 @@ array_in(char *string, /* input array in external form */
|
||||
ndim++;
|
||||
}
|
||||
else
|
||||
{
|
||||
done = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (ndim == 0)
|
||||
@@ -170,9 +168,7 @@ array_in(char *string, /* input array in external form */
|
||||
for (i = 0; i < ndim; lBound[i++] = 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ERROR, "array_in: Need to specify dimension");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -273,9 +269,7 @@ _ArrayCount(char *str, int dim[], int typdelim)
|
||||
char *q;
|
||||
|
||||
for (i = 0; i < MAXDIM; ++i)
|
||||
{
|
||||
temp[i] = dim[i] = 0;
|
||||
}
|
||||
|
||||
if (strncmp(str, "{}", 2) == 0)
|
||||
return (0);
|
||||
@@ -292,9 +286,7 @@ _ArrayCount(char *str, int dim[], int typdelim)
|
||||
case '\\':
|
||||
/* skip escaped characters (\ and ") inside strings */
|
||||
if (scanning_string && *(q + 1))
|
||||
{
|
||||
q++;
|
||||
}
|
||||
break;
|
||||
case '\0':
|
||||
|
||||
@@ -343,9 +335,7 @@ _ArrayCount(char *str, int dim[], int typdelim)
|
||||
q++;
|
||||
}
|
||||
for (i = 0; i < ndim; ++i)
|
||||
{
|
||||
dim[i] = temp[i];
|
||||
}
|
||||
|
||||
return (ndim);
|
||||
}
|
||||
@@ -493,13 +483,9 @@ _ReadArrayStr(char *arrayStr,
|
||||
if (values[i])
|
||||
{
|
||||
if (typalign == 'd')
|
||||
{
|
||||
*nbytes += DOUBLEALIGN(*(int32 *) values[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
*nbytes += INTALIGN(*(int32 *) values[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -555,9 +541,7 @@ _ReadLOArray(char *str,
|
||||
str = _AdvanceBy1word(str, &chunkfile);
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ERROR, "usage: <input file> -chunk DEFAULT/<access pattern file> -invert/-native [-noreorg <chunk file>]");
|
||||
}
|
||||
}
|
||||
|
||||
if (inputfile == NULL)
|
||||
@@ -1040,9 +1024,7 @@ array_clip(ArrayType *array,
|
||||
1, isNull);
|
||||
}
|
||||
else
|
||||
{
|
||||
_ReadArray(lowerIndx, upperIndx, len, fd, newfd, array, 1, isNull);
|
||||
}
|
||||
}
|
||||
#ifdef LOARRAY
|
||||
LOclose(fd);
|
||||
@@ -1245,9 +1227,7 @@ array_assgn(ArrayType *array,
|
||||
|
||||
if (!SanityCheckInput(ndim, n, dim, lb, upperIndx) ||
|
||||
!SanityCheckInput(ndim, n, dim, lb, lowerIndx))
|
||||
{
|
||||
return ((char *) array);
|
||||
}
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
if (lowerIndx[i] > upperIndx[i])
|
||||
@@ -1338,13 +1318,9 @@ system_cache_lookup(Oid element_type,
|
||||
*typelem = typeStruct->typelem;
|
||||
*typalign = typeStruct->typalign;
|
||||
if (input)
|
||||
{
|
||||
*proc = typeStruct->typinput;
|
||||
}
|
||||
else
|
||||
{
|
||||
*proc = typeStruct->typoutput;
|
||||
}
|
||||
}
|
||||
|
||||
static Datum
|
||||
@@ -1367,9 +1343,7 @@ _ArrayCast(char *value, bool byval, int len)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return (Datum) value;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1400,9 +1374,7 @@ ArrayCastAndSet(char *src,
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
memmove(dest, src, typlen);
|
||||
}
|
||||
inc = typlen;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -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.23 1998/03/02 00:13:36 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.24 1998/06/15 19:29:32 momjian Exp $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -122,9 +122,7 @@ printf( "cashin- negative symbol; string is '%s'\n", s);
|
||||
|
||||
}
|
||||
else if (*s == psymbol)
|
||||
{
|
||||
s++;
|
||||
}
|
||||
|
||||
#ifdef CASHDEBUG
|
||||
printf( "cashin- string is '%s'\n", s);
|
||||
@@ -687,9 +685,7 @@ cash_words_out(Cash *value)
|
||||
p += 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
*buf = 0;
|
||||
}
|
||||
|
||||
m0 = *value % 100; /* cents */
|
||||
m1 = (*value / 100) % 1000; /* hundreds */
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.22 1998/02/26 04:36:59 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.23 1998/06/15 19:29:33 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -175,13 +175,9 @@ int
|
||||
date_cmp(DateADT dateVal1, DateADT dateVal2)
|
||||
{
|
||||
if (dateVal1 < dateVal2)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else if (dateVal1 > dateVal2)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
} /* date_cmp() */
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datum.c,v 1.9 1998/01/05 16:39:52 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datum.c,v 1.10 1998/06/15 19:29:34 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -56,9 +56,7 @@ datumGetSize(Datum value, Oid type, bool byVal, Size len)
|
||||
if (byVal)
|
||||
{
|
||||
if (len <= sizeof(Datum))
|
||||
{
|
||||
size = len;
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ERROR,
|
||||
@@ -116,9 +114,7 @@ datumCopy(Datum value, Oid type, bool byVal, Size len)
|
||||
|
||||
|
||||
if (byVal)
|
||||
{
|
||||
res = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (value == 0)
|
||||
@@ -131,9 +127,7 @@ datumCopy(Datum value, Oid type, bool byVal, Size len)
|
||||
*/
|
||||
s = (char *) palloc(realSize);
|
||||
if (s == NULL)
|
||||
{
|
||||
elog(ERROR, "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.54 1998/06/15 18:39:37 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.55 1998/06/15 19:29:34 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -188,9 +188,7 @@ datetime_out(DateTime *dt)
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
EncodeSpecialDateTime(DT_INVALID, buf);
|
||||
}
|
||||
|
||||
result = palloc(strlen(buf) + 1);
|
||||
|
||||
@@ -682,9 +680,7 @@ timespan_cmp(TimeSpan *timespan1, TimeSpan *timespan2)
|
||||
|
||||
}
|
||||
else if (TIMESPAN_IS_INVALID(*timespan2))
|
||||
{
|
||||
return (-1);
|
||||
}
|
||||
|
||||
span1 = timespan1->time;
|
||||
if (timespan1->month != 0)
|
||||
@@ -727,17 +723,11 @@ datetime_smaller(DateTime *datetime1, DateTime *datetime2)
|
||||
dt2 = SetDateTime(dt2);
|
||||
|
||||
if (DATETIME_IS_INVALID(dt1))
|
||||
{
|
||||
*result = dt2;
|
||||
}
|
||||
else if (DATETIME_IS_INVALID(dt2))
|
||||
{
|
||||
*result = dt1;
|
||||
}
|
||||
else
|
||||
{
|
||||
*result = ((dt2 < dt1) ? dt2 : dt1);
|
||||
}
|
||||
|
||||
return (result);
|
||||
} /* datetime_smaller() */
|
||||
@@ -764,17 +754,11 @@ datetime_larger(DateTime *datetime1, DateTime *datetime2)
|
||||
dt2 = SetDateTime(dt2);
|
||||
|
||||
if (DATETIME_IS_INVALID(dt1))
|
||||
{
|
||||
*result = dt2;
|
||||
}
|
||||
else if (DATETIME_IS_INVALID(dt2))
|
||||
{
|
||||
*result = dt1;
|
||||
}
|
||||
else
|
||||
{
|
||||
*result = ((dt2 > dt1) ? dt2 : dt1);
|
||||
}
|
||||
|
||||
return (result);
|
||||
} /* datetime_larger() */
|
||||
@@ -812,9 +796,7 @@ datetime_mi(DateTime *datetime1, DateTime *datetime2)
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
result->time = JROUND(dt1 - dt2);
|
||||
}
|
||||
result->month = 0;
|
||||
|
||||
return (result);
|
||||
@@ -894,13 +876,9 @@ datetime_pl_span(DateTime *datetime, TimeSpan *span)
|
||||
if (tm->tm_mday > mdays[tm->tm_mon - 1])
|
||||
{
|
||||
if ((tm->tm_mon == 2) && isleap(tm->tm_year))
|
||||
{
|
||||
tm->tm_mday = (mdays[tm->tm_mon - 1] + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
tm->tm_mday = mdays[tm->tm_mon - 1];
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DATEDEBUG
|
||||
@@ -912,9 +890,7 @@ datetime_pl_span(DateTime *datetime, TimeSpan *span)
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
DATETIME_INVALID(dt);
|
||||
}
|
||||
}
|
||||
|
||||
*result = dt;
|
||||
@@ -1241,15 +1217,11 @@ datetime_age(DateTime *datetime1, DateTime *datetime2)
|
||||
}
|
||||
|
||||
if (tm2timespan(tm, fsec, result) != 0)
|
||||
{
|
||||
elog(ERROR, "Unable to decode datetime", NULL);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ERROR, "Unable to decode datetime", NULL);
|
||||
}
|
||||
|
||||
return (result);
|
||||
} /* datetime_age() */
|
||||
@@ -1676,9 +1648,7 @@ datetime_part(text *units, DateTime *datetime)
|
||||
|
||||
type = DecodeUnits(0, lowunits, &val);
|
||||
if (type == IGNORE)
|
||||
{
|
||||
type = DecodeSpecial(0, lowunits, &val);
|
||||
}
|
||||
|
||||
#ifdef DATEDEBUG
|
||||
if (type == IGNORE)
|
||||
@@ -1843,9 +1813,7 @@ timespan_part(text *units, TimeSpan *timespan)
|
||||
|
||||
type = DecodeUnits(0, lowunits, &val);
|
||||
if (type == IGNORE)
|
||||
{
|
||||
type = DecodeSpecial(0, lowunits, &val);
|
||||
}
|
||||
|
||||
#ifdef DATEDEBUG
|
||||
if (type == IGNORE)
|
||||
@@ -2701,9 +2669,7 @@ ParseDateTime(char *timestr, char *lowstr,
|
||||
* day later
|
||||
*/
|
||||
else
|
||||
{
|
||||
ftype[nf] = DTK_NUMBER;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2761,9 +2727,7 @@ ParseDateTime(char *timestr, char *lowstr,
|
||||
/* otherwise something wrong... */
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* ignore punctuation but use as delimiter */
|
||||
}
|
||||
@@ -2774,17 +2738,13 @@ ParseDateTime(char *timestr, char *lowstr,
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* force in a delimiter */
|
||||
*lp++ = '\0';
|
||||
nf++;
|
||||
if (nf > MAXDATEFIELDS)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
#ifdef DATEDEBUG
|
||||
printf("ParseDateTime- set field[%d] to %s type %d\n", (nf - 1), field[nf - 1], ftype[nf - 1]);
|
||||
#endif
|
||||
@@ -3361,9 +3321,7 @@ DecodeTime(char *str, int fmask, int *tmask, struct tm * tm, double *fsec)
|
||||
str = cp + 1;
|
||||
tm->tm_sec = strtol(str, &cp, 10);
|
||||
if (*cp == '\0')
|
||||
{
|
||||
*fsec = 0;
|
||||
}
|
||||
else if (*cp == '.')
|
||||
{
|
||||
str = cp;
|
||||
@@ -3372,9 +3330,7 @@ DecodeTime(char *str, int fmask, int *tmask, struct tm * tm, double *fsec)
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* do a sanity check */
|
||||
@@ -3498,19 +3454,13 @@ DecodeNumber(int flen, char *str, int fmask, int *tmask, struct tm * tm, double
|
||||
*tmask = DTK_M(YEAR);
|
||||
tm->tm_year = val;
|
||||
if (tm->tm_year < 70)
|
||||
{
|
||||
tm->tm_year += 2000;
|
||||
}
|
||||
else if (tm->tm_year < 100)
|
||||
{
|
||||
tm->tm_year += 1900;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
} /* DecodeNumber() */
|
||||
@@ -3583,9 +3533,7 @@ DecodeNumberField(int len, char *str, int fmask, int *tmask, struct tm * tm, dou
|
||||
if (cp == (str + 4))
|
||||
return -1;
|
||||
if (*cp == '.')
|
||||
{
|
||||
*fsec = strtod(cp, NULL);
|
||||
}
|
||||
*(str + 4) = '\0';
|
||||
tm->tm_min = strtod((str + 2), &cp);
|
||||
*(str + 2) = '\0';
|
||||
@@ -3593,9 +3541,7 @@ DecodeNumberField(int len, char *str, int fmask, int *tmask, struct tm * tm, dou
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
} /* DecodeNumberField() */
|
||||
@@ -3631,9 +3577,7 @@ DecodeTimezone(char *str, int *tzp)
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
min = 0;
|
||||
}
|
||||
|
||||
tz = (hr * 60 + min) * 60;
|
||||
if (*str == '-')
|
||||
@@ -3658,9 +3602,7 @@ DecodeSpecial(int field, char *lowtoken, int *val)
|
||||
#if USE_DATE_CACHE
|
||||
if ((datecache[field] != NULL)
|
||||
&& (strncmp(lowtoken, datecache[field]->token, TOKMAXLEN) == 0))
|
||||
{
|
||||
tp = datecache[field];
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif
|
||||
@@ -3942,9 +3884,7 @@ DecodeUnits(int field, char *lowtoken, int *val)
|
||||
#if USE_DATE_CACHE
|
||||
if ((deltacache[field] != NULL)
|
||||
&& (strncmp(lowtoken, deltacache[field]->token, TOKMAXLEN) == 0))
|
||||
{
|
||||
tp = deltacache[field];
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif
|
||||
@@ -3962,13 +3902,9 @@ DecodeUnits(int field, char *lowtoken, int *val)
|
||||
{
|
||||
type = tp->type;
|
||||
if ((type == TZ) || (type == DTZ))
|
||||
{
|
||||
*val = FROMVAL(tp);
|
||||
}
|
||||
else
|
||||
{
|
||||
*val = tp->value;
|
||||
}
|
||||
}
|
||||
|
||||
return (type);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/filename.c,v 1.14 1998/02/26 04:37:03 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/filename.c,v 1.15 1998/06/15 19:29:34 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -111,14 +111,10 @@ filename_in(char *file)
|
||||
ind = len + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ERROR, "Couldn't find %s in your environment", environment);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ind = 0;
|
||||
}
|
||||
strcat(str, file + ind);
|
||||
return (str);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.32 1998/05/09 22:39:55 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.33 1998/06/15 19:29:34 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -254,9 +254,7 @@ path_decode(int opentype, int npts, char *str, int *isopen, char **ss, Point *p)
|
||||
s++;
|
||||
}
|
||||
else
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
}
|
||||
*ss = s;
|
||||
|
||||
@@ -960,9 +958,7 @@ line_parallel(LINE *l1, LINE *l2)
|
||||
return (FPeq(l1->m, l2->m));
|
||||
#endif
|
||||
if (FPzero(l1->B))
|
||||
{
|
||||
return (FPzero(l2->B));
|
||||
}
|
||||
|
||||
return (FPeq(l2->A, l1->A * (l2->B / l1->B)));
|
||||
} /* line_parallel() */
|
||||
@@ -977,13 +973,9 @@ line_perp(LINE *l1, LINE *l2)
|
||||
return (FPeq(l1->m / l2->m, -1.0));
|
||||
#endif
|
||||
if (FPzero(l1->A))
|
||||
{
|
||||
return (FPzero(l2->B));
|
||||
}
|
||||
else if (FPzero(l1->B))
|
||||
{
|
||||
return (FPzero(l2->A));
|
||||
}
|
||||
|
||||
return (FPeq(((l1->A * l2->B) / (l1->B * l2->A)), -1.0));
|
||||
} /* line_perp() */
|
||||
@@ -1396,9 +1388,7 @@ path_distance(PATH *p1, PATH *p2)
|
||||
min = tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
pfree(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
return (min);
|
||||
@@ -2007,9 +1997,7 @@ dist_ps(Point *pt, LSEG *lseg)
|
||||
* and through the input point
|
||||
*/
|
||||
if (lseg->p[1].x == lseg->p[0].x)
|
||||
{
|
||||
m = 0;
|
||||
}
|
||||
else if (lseg->p[1].y == lseg->p[0].y)
|
||||
{ /* slope is infinite */
|
||||
m = (double) DBL_MAX;
|
||||
@@ -2140,9 +2128,7 @@ dist_sl(LSEG *lseg, LINE *line)
|
||||
result = d2;
|
||||
}
|
||||
else
|
||||
{
|
||||
pfree(d2);
|
||||
}
|
||||
}
|
||||
|
||||
return (result);
|
||||
@@ -2998,9 +2984,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);
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------
|
||||
@@ -3717,9 +3701,7 @@ poly_center(POLYGON *poly)
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
result = NULL;
|
||||
}
|
||||
|
||||
return (result);
|
||||
} /* poly_center() */
|
||||
@@ -3935,9 +3917,7 @@ circle_in(char *str)
|
||||
while (isspace(*cp))
|
||||
cp++;
|
||||
if (*cp == LDELIM)
|
||||
{
|
||||
s = cp;
|
||||
}
|
||||
}
|
||||
|
||||
if (!pair_decode(s, &circle->center.x, &circle->center.y, &s))
|
||||
@@ -3962,9 +3942,7 @@ circle_in(char *str)
|
||||
s++;
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ERROR, "Bad circle external representation '%s'", str);
|
||||
}
|
||||
}
|
||||
|
||||
if (*s != '\0')
|
||||
@@ -4511,9 +4489,7 @@ poly_circle(POLYGON *poly)
|
||||
circle->center.y /= poly->npts;
|
||||
|
||||
for (i = 0; i < poly->npts; i++)
|
||||
{
|
||||
circle->radius += point_dt(&poly->p[i], &circle->center);
|
||||
}
|
||||
circle->radius /= poly->npts;
|
||||
|
||||
if (FPzero(circle->radius))
|
||||
@@ -4570,23 +4546,17 @@ point_inside(Point *p, int npts, Point plist[])
|
||||
y = plist[i].y - p->y;
|
||||
|
||||
if ((cross = lseg_crossing(x, y, px, py)) == HIT_IT)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
crossnum += cross;
|
||||
|
||||
px = x;
|
||||
py = y;
|
||||
}
|
||||
if ((cross = lseg_crossing(x0, y0, px, py)) == HIT_IT)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
crossnum += cross;
|
||||
if (crossnum != 0)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
} /* point_inside() */
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.42 1998/02/26 04:37:12 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.43 1998/06/15 19:29:35 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -131,9 +131,7 @@ abstime2tm(AbsoluteTime time, int *tzp, struct tm * tm, char *tzn)
|
||||
|
||||
#ifdef USE_POSIX_TIME
|
||||
if (tzp != NULL)
|
||||
{
|
||||
tx = localtime((time_t *) &time);
|
||||
}
|
||||
else
|
||||
{
|
||||
tx = gmtime((time_t *) &time);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/name.c,v 1.12 1998/05/29 13:31:52 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/name.c,v 1.13 1998/06/15 19:29:35 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -219,9 +219,7 @@ NameComputeLength(Name name)
|
||||
for (length = 0, charP = name->data;
|
||||
length < NAMEDATALEN && *charP != '\0';
|
||||
length++, charP++)
|
||||
{
|
||||
;
|
||||
}
|
||||
return (uint32) length;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/not_in.c,v 1.8 1998/01/31 04:38:45 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/not_in.c,v 1.9 1998/06/15 19:29:36 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -89,9 +89,7 @@ int4notin(int16 not_in_arg, char *relation_and_attr)
|
||||
|
||||
integer_value = DatumGetInt16(value);
|
||||
if (left_side_argument == integer_value)
|
||||
{
|
||||
retval = false;
|
||||
}
|
||||
}
|
||||
|
||||
/* close the relation */
|
||||
@@ -120,9 +118,7 @@ my_varattno(Relation rd, char *a)
|
||||
for (i = 0; i < rd->rd_rel->relnatts; i++)
|
||||
{
|
||||
if (!namestrcmp(&rd->rd_att->attrs[i]->attname, a))
|
||||
{
|
||||
return (i + 1);
|
||||
}
|
||||
}
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.23 1998/02/26 04:37:14 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.24 1998/06/15 19:29:36 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -236,9 +236,7 @@ ftoa(double value, char *ascii, int width, int prec1, char format)
|
||||
/* output left of dp */
|
||||
expon--;
|
||||
if (*p)
|
||||
{
|
||||
*a++ = *p++;
|
||||
}
|
||||
else
|
||||
*a++ = '0';
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidint2.c,v 1.5 1998/02/26 04:37:17 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidint2.c,v 1.6 1998/06/15 19:29:36 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -31,13 +31,9 @@ oidint2in(char *o)
|
||||
|
||||
oi->oi_oid = (Oid) pg_atoi(o, sizeof(Oid), '/');
|
||||
if (*p == '\0')
|
||||
{
|
||||
oi->oi_int2 = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
oi->oi_int2 = (int16) pg_atoi(++p, sizeof(int2), '\0');
|
||||
}
|
||||
|
||||
return (oi);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidint4.c,v 1.5 1998/02/26 04:37:17 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidint4.c,v 1.6 1998/06/15 19:29:36 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -30,13 +30,9 @@ oidint4in(char *o)
|
||||
|
||||
oi->oi_oid = (Oid) pg_atoi(o, sizeof(Oid), '/');
|
||||
if (*p == '\0')
|
||||
{
|
||||
oi->oi_int4 = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
oi->oi_int4 = pg_atoi(++p, sizeof(int4), '\0');
|
||||
}
|
||||
|
||||
return (oi);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Edmund Mergl <E.Mergl@bawue.de>
|
||||
*
|
||||
* $Id: oracle_compat.c,v 1.13 1998/04/27 17:08:19 scrappy Exp $
|
||||
* $Id: oracle_compat.c,v 1.14 1998/06/15 19:29:36 momjian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -54,9 +54,7 @@ lower(text *string)
|
||||
ptr_ret = VARDATA(ret);
|
||||
|
||||
while (m--)
|
||||
{
|
||||
*ptr_ret++ = tolower((unsigned char)*ptr++);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -94,9 +92,7 @@ upper(text *string)
|
||||
ptr_ret = VARDATA(ret);
|
||||
|
||||
while (m--)
|
||||
{
|
||||
*ptr_ret++ = toupper((unsigned char)*ptr++);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -141,13 +137,9 @@ initcap(text *string)
|
||||
while (m--)
|
||||
{
|
||||
if (*(ptr_ret - 1) == ' ' || *(ptr_ret - 1) == ' ')
|
||||
{
|
||||
*ptr_ret++ = toupper((unsigned char)*ptr++);
|
||||
}
|
||||
else
|
||||
{
|
||||
*ptr_ret++ = tolower((unsigned char)*ptr++);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -202,9 +194,7 @@ lpad(text *string1, int4 len, text *string2)
|
||||
ptr1 = VARDATA(string1);
|
||||
|
||||
while (n--)
|
||||
{
|
||||
*ptr_ret++ = *ptr1++;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -250,9 +240,7 @@ rpad(text *string1, int4 len, text *string2)
|
||||
ptr_ret = VARDATA(ret);
|
||||
|
||||
while (n--)
|
||||
{
|
||||
*ptr_ret++ = *ptr1++;
|
||||
}
|
||||
|
||||
ptr2 = VARDATA(string2);
|
||||
|
||||
@@ -306,15 +294,11 @@ btrim(text *string, text *set)
|
||||
while (ptr2 <= end2)
|
||||
{
|
||||
if (*ptr == *ptr2)
|
||||
{
|
||||
break;
|
||||
}
|
||||
++ptr2;
|
||||
}
|
||||
if (*ptr != *ptr2)
|
||||
{
|
||||
break;
|
||||
}
|
||||
ptr++;
|
||||
ptr2 = VARDATA(set);
|
||||
}
|
||||
@@ -329,15 +313,11 @@ btrim(text *string, text *set)
|
||||
while (ptr2 <= end2)
|
||||
{
|
||||
if (*end == *ptr2)
|
||||
{
|
||||
break;
|
||||
}
|
||||
++ptr2;
|
||||
}
|
||||
if (*end != *ptr2)
|
||||
{
|
||||
break;
|
||||
}
|
||||
--end;
|
||||
ptr2 = VARDATA(set);
|
||||
}
|
||||
@@ -391,15 +371,11 @@ ltrim(text *string, text *set)
|
||||
while (ptr2 <= end2)
|
||||
{
|
||||
if (*ptr == *ptr2)
|
||||
{
|
||||
break;
|
||||
}
|
||||
++ptr2;
|
||||
}
|
||||
if (*ptr != *ptr2)
|
||||
{
|
||||
break;
|
||||
}
|
||||
ptr++;
|
||||
ptr2 = VARDATA(set);
|
||||
}
|
||||
@@ -455,15 +431,11 @@ rtrim(text *string, text *set)
|
||||
while (ptr2 <= end2)
|
||||
{
|
||||
if (*ptr == *ptr2)
|
||||
{
|
||||
break;
|
||||
}
|
||||
++ptr2;
|
||||
}
|
||||
if (*ptr != *ptr2)
|
||||
{
|
||||
break;
|
||||
}
|
||||
--ptr;
|
||||
ptr2 = VARDATA(set);
|
||||
}
|
||||
@@ -479,9 +451,7 @@ rtrim(text *string, text *set)
|
||||
ptr_ret = VARDATA(ret) + m - 1;
|
||||
|
||||
while (m--)
|
||||
{
|
||||
*ptr_ret-- = *ptr--;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -524,9 +494,7 @@ substr(text *string, int4 m, int4 n)
|
||||
ptr_ret = VARDATA(ret);
|
||||
|
||||
while (len--)
|
||||
{
|
||||
*ptr_ret++ = *ptr++;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regexp.c,v 1.17 1998/04/26 04:07:48 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regexp.c,v 1.18 1998/06/15 19:29:36 momjian Exp $
|
||||
*
|
||||
* Alistair Crooks added the code for the regex caching
|
||||
* agc - cached the regular expressions used - there's a good chance
|
||||
@@ -97,15 +97,11 @@ RE_compile_and_execute(struct varlena * text_re, char *text, int cflags)
|
||||
for (oldest = 0, i = 1; i < rec; i++)
|
||||
{
|
||||
if (rev[i].cre_lru < rev[oldest].cre_lru)
|
||||
{
|
||||
oldest = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
oldest = rec++;
|
||||
}
|
||||
|
||||
/* if there was an old re, then de-allocate the space it used */
|
||||
if (rev[oldest].cre_s != (char *) NULL)
|
||||
@@ -115,9 +111,7 @@ RE_compile_and_execute(struct varlena * text_re, char *text, int cflags)
|
||||
rev[i].cre_lru =
|
||||
(rev[i].cre_lru - rev[oldest].cre_lru) / 2;
|
||||
if (rev[i].cre_lru > lru)
|
||||
{
|
||||
lru = rev[i].cre_lru;
|
||||
}
|
||||
}
|
||||
pg95_regfree(&rev[oldest].cre_re);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.18 1998/04/26 04:07:55 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.19 1998/06/15 19:29:37 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -72,9 +72,7 @@ regprocin(char *proname)
|
||||
RelationGetTupleDescriptor(proc),
|
||||
&isnull);
|
||||
if (isnull)
|
||||
{
|
||||
elog(FATAL, "regprocin: null procedure %s", proname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
result = (RegProcedure) 0;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.18 1998/02/26 04:37:21 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.19 1998/06/15 19:29:37 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -506,13 +506,9 @@ hashsel(Oid operatorObjectId,
|
||||
}
|
||||
ntuples = ((Form_pg_class) GETSTRUCT(atp))->reltuples;
|
||||
if (ntuples > 0)
|
||||
{
|
||||
resultData = 1.0 / (float64data) ntuples;
|
||||
}
|
||||
else
|
||||
{
|
||||
resultData = (float64data) (1.0 / 100.0);
|
||||
}
|
||||
result = &resultData;
|
||||
|
||||
}
|
||||
@@ -573,13 +569,9 @@ hashnpage(Oid operatorObjectId,
|
||||
|
||||
ntuples = ((Form_pg_class) GETSTRUCT(atp))->reltuples;
|
||||
if (ntuples > 0)
|
||||
{
|
||||
tempData = 1.0 / (float64data) ntuples;
|
||||
}
|
||||
else
|
||||
{
|
||||
tempData = (float64data) (1.0 / 100.0);
|
||||
}
|
||||
temp = &tempData;
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.32 1998/05/29 13:33:24 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.33 1998/06/15 19:29:38 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -98,9 +98,7 @@ bpcharin(char *s, int dummy, int16 atttypmod)
|
||||
|
||||
/* blank pad the string if necessary */
|
||||
for (; i < len; i++)
|
||||
{
|
||||
*r++ = ' ';
|
||||
}
|
||||
return (result);
|
||||
}
|
||||
|
||||
@@ -186,9 +184,7 @@ printf("'\n");
|
||||
|
||||
/* blank pad the string if necessary */
|
||||
for (; i < rlen; i++)
|
||||
{
|
||||
*r++ = ' ';
|
||||
}
|
||||
|
||||
return (result);
|
||||
} /* bpchar() */
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.35 1998/05/29 13:33:58 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.36 1998/06/15 19:29:38 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -657,13 +657,9 @@ byteaGetBit(text *v, int32 n)
|
||||
byte = byteaGetByte(v, byteNo);
|
||||
|
||||
if (byte & (1 << bitNo))
|
||||
{
|
||||
return ((int32) 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
return ((int32) 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
@@ -729,9 +725,7 @@ byteaSetBit(text *v, int32 n, int32 newBit)
|
||||
* sanity check!
|
||||
*/
|
||||
if (newBit != 0 && newBit != 1)
|
||||
{
|
||||
elog(ERROR, "byteaSetByte: new bit must be 0 or 1");
|
||||
}
|
||||
|
||||
/*
|
||||
* get the byte where the bit we want is stored.
|
||||
@@ -744,13 +738,9 @@ byteaSetBit(text *v, int32 n, int32 newBit)
|
||||
* calculate the new value for that byte
|
||||
*/
|
||||
if (newBit == 0)
|
||||
{
|
||||
newByte = oldByte & (~(1 << bitNo));
|
||||
}
|
||||
else
|
||||
{
|
||||
newByte = oldByte | (1 << bitNo);
|
||||
}
|
||||
|
||||
/*
|
||||
* NOTE: 'byteaSetByte' creates a copy of 'v' & sets the byte.
|
||||
|
||||
16
src/backend/utils/cache/catcache.c
vendored
16
src/backend/utils/cache/catcache.c
vendored
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.28 1998/06/15 18:39:40 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.29 1998/06/15 19:29:38 momjian Exp $
|
||||
*
|
||||
* Notes:
|
||||
* XXX This needs to use exception.h to handle recovery when
|
||||
@@ -172,9 +172,7 @@ CatalogCacheInitializeCache(struct catcache * cache,
|
||||
if (cp)
|
||||
relation = heap_open(cp->relationId);
|
||||
else
|
||||
{
|
||||
relation = heap_openr(cache->cc_relname);
|
||||
}
|
||||
|
||||
didopen = 1;
|
||||
}
|
||||
@@ -325,9 +323,7 @@ comphash(long l, char *v)
|
||||
|
||||
i = 0;
|
||||
while (l--)
|
||||
{
|
||||
i += *v++;
|
||||
}
|
||||
return (i);
|
||||
}
|
||||
|
||||
@@ -643,9 +639,7 @@ SystemCacheRelationFlushed(Oid relId)
|
||||
for (cache = Caches; PointerIsValid(cache); cache = cache->cc_next)
|
||||
{
|
||||
if (cache->relationId == relId)
|
||||
{
|
||||
cache->relationId = InvalidOid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -769,15 +763,11 @@ InitSysCache(char *relname,
|
||||
{
|
||||
cp->cc_key[i] = key[i];
|
||||
if (!key[i])
|
||||
{
|
||||
elog(FATAL, "InitSysCache: called with 0 key[%d]", i);
|
||||
}
|
||||
if (key[i] < 0)
|
||||
{
|
||||
if (key[i] != ObjectIdAttributeNumber)
|
||||
{
|
||||
elog(FATAL, "InitSysCache: called with %d key[%d]", key[i], i);
|
||||
}
|
||||
else
|
||||
{
|
||||
cp->cc_klen[i] = sizeof(Oid);
|
||||
@@ -990,9 +980,7 @@ SearchSysCache(struct catcache * cache,
|
||||
*/
|
||||
MemoryContextSwitchTo((MemoryContext) CacheCxt);
|
||||
if (HeapTupleIsValid(ntp))
|
||||
{
|
||||
ntp = heap_copytuple(ntp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1150,9 +1138,7 @@ RelationInvalidateCatalogCacheTuple(Relation relation,
|
||||
|
||||
/* OPT inline simplification of CatalogCacheIdInvalidate */
|
||||
if (!PointerIsValid(function))
|
||||
{
|
||||
function = CatalogCacheIdInvalidate;
|
||||
}
|
||||
|
||||
(*function) (ccp->id,
|
||||
CatalogCacheComputeTupleHashIndex(ccp, relation, tuple),
|
||||
|
||||
6
src/backend/utils/cache/fcache.c
vendored
6
src/backend/utils/cache/fcache.c
vendored
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.11 1998/02/26 04:37:28 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.12 1998/06/15 19:29:39 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -288,9 +288,7 @@ init_fcache(Oid foid,
|
||||
retval->nargs = retval->func.fn_nargs;
|
||||
}
|
||||
else
|
||||
{
|
||||
retval->func.fn_addr = (func_ptr) NULL;
|
||||
}
|
||||
|
||||
|
||||
return (retval);
|
||||
@@ -316,7 +314,5 @@ setFcache(Node *node, Oid foid, List *argList, ExprContext *econtext)
|
||||
fnode->func_fcache = fcache;
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ERROR, "init_fcache: node must be Oper or Func!");
|
||||
}
|
||||
}
|
||||
|
||||
10
src/backend/utils/cache/inval.c
vendored
10
src/backend/utils/cache/inval.c
vendored
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.10 1998/02/23 17:43:23 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.11 1998/06/15 19:29:39 momjian Exp $
|
||||
*
|
||||
* Note - this code is real crufty...
|
||||
*
|
||||
@@ -140,9 +140,7 @@ LocalInvalidInvalidate(LocalInvalid invalid, void (*function) ())
|
||||
&((InvalidationUserData *) invalid)->dataP[-1];
|
||||
|
||||
if (PointerIsValid(function))
|
||||
{
|
||||
(*function) ((Pointer) &entryDataP->userData);
|
||||
}
|
||||
|
||||
invalid = (Pointer) entryDataP->nextP;
|
||||
|
||||
@@ -485,17 +483,11 @@ RelationInvalidateRelationCache(Relation relation,
|
||||
* ----------------
|
||||
*/
|
||||
if (relationId == MyRelationRelationId)
|
||||
{
|
||||
objectId = tuple->t_oid;
|
||||
}
|
||||
else if (relationId == MyAttributeRelationId)
|
||||
{
|
||||
objectId = ((AttributeTupleForm) GETSTRUCT(tuple))->attrelid;
|
||||
}
|
||||
else if (relationId == MyAMRelationId)
|
||||
{
|
||||
objectId = tuple->t_oid;
|
||||
}
|
||||
else if (relationId == MyAMOPRelationId)
|
||||
{
|
||||
; /* objectId is unused */
|
||||
|
||||
4
src/backend/utils/cache/lsyscache.c
vendored
4
src/backend/utils/cache/lsyscache.c
vendored
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.13 1998/02/26 04:37:30 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.14 1998/06/15 19:29:40 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Eventually, the index information should go through here, too.
|
||||
@@ -251,9 +251,7 @@ op_mergesortable(Oid opno, Oid ltype, Oid rtype, Oid *leftOp, Oid *rightOp)
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
18
src/backend/utils/cache/relcache.c
vendored
18
src/backend/utils/cache/relcache.c
vendored
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.39 1998/06/15 18:39:40 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.40 1998/06/15 19:29:40 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -380,9 +380,7 @@ scan_pg_rel_seq(RelationBuildDescInfo buildinfo)
|
||||
* ----------------
|
||||
*/
|
||||
if (!HeapTupleIsValid(pg_class_tuple))
|
||||
{
|
||||
return_tuple = pg_class_tuple;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* ------------------
|
||||
@@ -907,13 +905,9 @@ RelationBuildDesc(RelationBuildDescInfo buildinfo)
|
||||
* ----------------
|
||||
*/
|
||||
if (relp->relhasrules)
|
||||
{
|
||||
RelationBuildRuleLock(relation);
|
||||
}
|
||||
else
|
||||
{
|
||||
relation->rd_rules = NULL;
|
||||
}
|
||||
|
||||
/* Triggers */
|
||||
if (relp->reltriggers > 0)
|
||||
@@ -926,9 +920,7 @@ RelationBuildDesc(RelationBuildDescInfo buildinfo)
|
||||
* ----------------
|
||||
*/
|
||||
if (OidIsValid(relam))
|
||||
{
|
||||
IndexedAccessMethodInitialize(relation);
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
* initialize the relation lock manager information
|
||||
@@ -993,9 +985,7 @@ IndexedAccessMethodInitialize(Relation relation)
|
||||
support = (RegProcedure *) palloc(supportSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
support = (RegProcedure *) NULL;
|
||||
}
|
||||
|
||||
IndexSupportInitialize(strategy, support,
|
||||
relation->rd_att->attrs[0]->attrelid,
|
||||
@@ -1346,9 +1336,7 @@ RelationFlushRelation(Relation *relationPtr,
|
||||
int j;
|
||||
|
||||
for (j = 0; j < relation->rd_rules->numLocks; j++)
|
||||
{
|
||||
pfree(relation->rd_rules->rules[j]);
|
||||
}
|
||||
pfree(relation->rd_rules->rules);
|
||||
pfree(relation->rd_rules);
|
||||
}
|
||||
@@ -1460,9 +1448,7 @@ RelationFlushIndexes(Relation *r,
|
||||
if (relation->rd_rel->relkind == RELKIND_INDEX && /* XXX style */
|
||||
(!OidIsValid(accessMethodId) ||
|
||||
relation->rd_rel->relam == accessMethodId))
|
||||
{
|
||||
RelationFlushRelation(&relation, false);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1588,9 +1574,7 @@ RelationPurgeLocalRelation(bool xactCommitted)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
smgrunlink(DEFAULT_SMGR, reln);
|
||||
}
|
||||
}
|
||||
else if (!IsBootstrapProcessingMode() && !(reln->rd_istemp))
|
||||
|
||||
|
||||
44
src/backend/utils/cache/syscache.c
vendored
44
src/backend/utils/cache/syscache.c
vendored
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.17 1998/05/09 23:45:29 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.18 1998/06/15 19:29:40 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* These routines allow the parser/planner/executor to perform
|
||||
@@ -406,30 +406,22 @@ SearchSysCacheTuple(int cacheId,/* cache selection code */
|
||||
return ((HeapTuple) NULL);
|
||||
}
|
||||
|
||||
if (!AMI_OVERRIDE)
|
||||
{
|
||||
Assert(PointerIsValid(SysCache[cacheId]));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!PointerIsValid(SysCache[cacheId]))
|
||||
{
|
||||
SysCache[cacheId] =
|
||||
InitSysCache(cacheinfo[cacheId].name,
|
||||
cacheinfo[cacheId].indname,
|
||||
cacheId,
|
||||
cacheinfo[cacheId].nkeys,
|
||||
cacheinfo[cacheId].key,
|
||||
cacheinfo[cacheId].iScanFunc);
|
||||
if (!PointerIsValid(SysCache[cacheId]))
|
||||
{
|
||||
elog(ERROR,
|
||||
"InitCatalogCache: Can't init cache %.16s(%d)",
|
||||
cacheinfo[cacheId].name,
|
||||
cacheId);
|
||||
}
|
||||
Assert(AMI_OVERRIDE || PointerIsValid(SysCache[cacheId]));
|
||||
|
||||
}
|
||||
if (!PointerIsValid(SysCache[cacheId]))
|
||||
{
|
||||
SysCache[cacheId] =
|
||||
InitSysCache(cacheinfo[cacheId].name,
|
||||
cacheinfo[cacheId].indname,
|
||||
cacheId,
|
||||
cacheinfo[cacheId].nkeys,
|
||||
cacheinfo[cacheId].key,
|
||||
cacheinfo[cacheId].iScanFunc);
|
||||
if (!PointerIsValid(SysCache[cacheId]))
|
||||
elog(ERROR,
|
||||
"InitCatalogCache: Can't init cache %.16s(%d)",
|
||||
cacheinfo[cacheId].name,
|
||||
cacheId);
|
||||
}
|
||||
|
||||
tp = SearchSysCache(SysCache[cacheId], key1, key2, key3, key4);
|
||||
@@ -559,9 +551,7 @@ SearchSysCacheGetAttribute(int cacheId,
|
||||
}
|
||||
|
||||
if (attributeByValue)
|
||||
{
|
||||
returnValue = (void *) attributeValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
char *tmp;
|
||||
@@ -662,9 +652,7 @@ TypeDefaultRetrieve(Oid typId)
|
||||
returnValue = (void *) i32;
|
||||
}
|
||||
else
|
||||
{
|
||||
returnValue = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.28 1998/05/19 18:05:50 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.29 1998/06/15 19:29:41 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -63,9 +63,7 @@ elog(int lev, const char *fmt,...)
|
||||
|
||||
va_start(ap, fmt);
|
||||
if (lev == DEBUG && Debugfile < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
switch (lev)
|
||||
{
|
||||
case NOIND:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.17 1998/01/31 04:38:57 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.18 1998/06/15 19:29:42 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -149,9 +149,7 @@ handle_load(char *filename, char *funcname)
|
||||
if (file_scanner == (DynamicFileList *) NULL)
|
||||
{
|
||||
if (stat(filename, &stat_buf) == -1)
|
||||
{
|
||||
elog(ERROR, "stat failed on file %s", filename);
|
||||
}
|
||||
|
||||
for (file_scanner = file_list;
|
||||
file_scanner != (DynamicFileList *) NULL
|
||||
@@ -168,9 +166,7 @@ handle_load(char *filename, char *funcname)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
file_scanner = (DynamicFileList *) NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* File not loaded yet.
|
||||
@@ -202,13 +198,9 @@ handle_load(char *filename, char *funcname)
|
||||
{
|
||||
load_error = (char *) pg_dlerror();
|
||||
if (file_scanner == file_list)
|
||||
{
|
||||
file_list = (DynamicFileList *) NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
file_tail->next = (DynamicFileList *) NULL;
|
||||
}
|
||||
|
||||
free((char *) file_scanner);
|
||||
elog(ERROR, "Load of file %s failed: %s", filename, load_error);
|
||||
@@ -226,9 +218,7 @@ handle_load(char *filename, char *funcname)
|
||||
retval = (func_ptr) pg_dlsym(file_scanner->handle, funcname);
|
||||
|
||||
if (retval == (func_ptr) NULL)
|
||||
{
|
||||
elog(ERROR, "Can't find function %s in file %s", funcname, filename);
|
||||
}
|
||||
|
||||
return (retval);
|
||||
}
|
||||
@@ -254,9 +244,7 @@ load_file(char *filename)
|
||||
int done = 0;
|
||||
|
||||
if (stat(filename, &stat_buf) == -1)
|
||||
{
|
||||
elog(ERROR, "stat failed on file %s", filename);
|
||||
}
|
||||
|
||||
if (file_list != (DynamicFileList *) NULL
|
||||
&& !NOT_EQUAL(stat_buf, *file_list))
|
||||
@@ -272,17 +260,11 @@ load_file(char *filename)
|
||||
while (!done)
|
||||
{
|
||||
if (file_scanner->next == (DynamicFileList *) NULL)
|
||||
{
|
||||
done = 1;
|
||||
}
|
||||
else if (!NOT_EQUAL(stat_buf, *(file_scanner->next)))
|
||||
{
|
||||
done = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
file_scanner = file_scanner->next;
|
||||
}
|
||||
}
|
||||
|
||||
if (file_scanner->next != (DynamicFileList *) NULL)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.16 1998/03/07 06:03:28 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.17 1998/06/15 19:29:44 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -50,9 +50,7 @@ fmgr_pl(char *arg0,...)
|
||||
{
|
||||
va_start(pvar, arg0);
|
||||
for (i = 1; i < fmgr_pl_finfo->fn_nargs; i++)
|
||||
{
|
||||
values.data[i] = va_arg(pvar, char *);
|
||||
}
|
||||
va_end(pvar);
|
||||
}
|
||||
}
|
||||
@@ -91,9 +89,7 @@ fmgr_c(FmgrInfo *finfo,
|
||||
* instead.
|
||||
*/
|
||||
if (finfo->fn_plhandler != NULL)
|
||||
{
|
||||
return (*(finfo->fn_plhandler)) (finfo, values, isNull);
|
||||
}
|
||||
|
||||
switch (n_arguments)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.13 1998/02/26 04:37:49 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.14 1998/06/15 19:29:46 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -165,9 +165,7 @@ hash_create(int nelem, HASHCTL *info, int flags)
|
||||
MemSet(hashp, 0, sizeof(HTAB));
|
||||
|
||||
if (flags & HASH_FUNCTION)
|
||||
{
|
||||
hashp->hash = info->hash;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* default */
|
||||
@@ -185,9 +183,7 @@ hash_create(int nelem, HASHCTL *info, int flags)
|
||||
|
||||
/* hash table already exists, we're just attaching to it */
|
||||
if (flags & HASH_ATTACH)
|
||||
{
|
||||
return (hashp);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
@@ -204,9 +200,7 @@ hash_create(int nelem, HASHCTL *info, int flags)
|
||||
{
|
||||
hashp->hctl = (HHDR *) hashp->alloc((unsigned long) sizeof(HHDR));
|
||||
if (!hashp->hctl)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
if (!hdefault(hashp))
|
||||
@@ -227,9 +221,7 @@ hash_create(int nelem, HASHCTL *info, int flags)
|
||||
hctl->sshift = my_log2(info->ssize);
|
||||
}
|
||||
if (flags & HASH_FFACTOR)
|
||||
{
|
||||
hctl->ffactor = info->ffactor;
|
||||
}
|
||||
|
||||
/*
|
||||
* SHM hash tables have fixed maximum size (allocate a maximal sized
|
||||
@@ -251,9 +243,7 @@ hash_create(int nelem, HASHCTL *info, int flags)
|
||||
hctl->datasize = info->datasize;
|
||||
}
|
||||
if (flags & HASH_ALLOC)
|
||||
{
|
||||
hashp->alloc = info->alloc;
|
||||
}
|
||||
|
||||
if (init_htab(hashp, nelem))
|
||||
{
|
||||
@@ -327,9 +317,7 @@ init_htab(HTAB *hashp, int nelem)
|
||||
nsegs = 1 << my_log2(nsegs);
|
||||
|
||||
if (nsegs > hctl->dsize)
|
||||
{
|
||||
hctl->dsize = nsegs;
|
||||
}
|
||||
|
||||
/* Use two low order bits of points ???? */
|
||||
|
||||
@@ -452,9 +440,7 @@ call_hash(HTAB *hashp, char *k, int len)
|
||||
|
||||
bucket = hash_val & hctl->high_mask;
|
||||
if (bucket > hctl->max_bucket)
|
||||
{
|
||||
bucket = bucket & hctl->low_mask;
|
||||
}
|
||||
|
||||
return (bucket);
|
||||
}
|
||||
@@ -534,9 +520,7 @@ hash_search(HTAB *hashp,
|
||||
curr = GET_BUCKET(hashp, currIndex);
|
||||
|
||||
if (!memcmp((char *) &(curr->key), keyPtr, hctl->keysize))
|
||||
{
|
||||
break;
|
||||
}
|
||||
prevIndexPtr = &(curr->next);
|
||||
currIndex = *prevIndexPtr;
|
||||
#if HASH_STATISTICS
|
||||
@@ -608,9 +592,7 @@ hash_search(HTAB *hashp,
|
||||
|
||||
/* no free elements. allocate another chunk of buckets */
|
||||
if (!bucket_alloc(hashp))
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
currIndex = hctl->freeBucketIndex;
|
||||
}
|
||||
Assert(currIndex != INVALID_INDEX);
|
||||
@@ -754,13 +736,9 @@ expand_table(HTAB *hashp)
|
||||
|
||||
/* Allocate new segment if necessary */
|
||||
if (new_segnum >= hctl->dsize)
|
||||
{
|
||||
dir_realloc(hashp);
|
||||
}
|
||||
if (!(hashp->dir[new_segnum] = seg_alloc(hashp)))
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
hctl->nsegs++;
|
||||
}
|
||||
|
||||
@@ -851,9 +829,7 @@ seg_alloc(HTAB *hashp)
|
||||
sizeof(SEGMENT) * hashp->hctl->ssize);
|
||||
|
||||
if (!segp)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
MemSet((char *) segp, 0,
|
||||
(long) sizeof(SEGMENT) * hashp->hctl->ssize);
|
||||
@@ -887,9 +863,7 @@ bucket_alloc(HTAB *hashp)
|
||||
hashp->alloc((unsigned long) BUCKET_ALLOC_INCR * bucketSize);
|
||||
|
||||
if (!tmpBucket)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
tmpIndex = MAKE_HASHOFFSET(hashp, tmpBucket);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.9 1998/06/09 17:13:05 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.10 1998/06/15 19:29:47 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -110,9 +110,7 @@ ValidateBinary(char *path)
|
||||
if (pwp)
|
||||
{
|
||||
if (pwp->pw_gid == buf.st_gid)
|
||||
{
|
||||
++in_grp;
|
||||
}
|
||||
else if (pwp->pw_name &&
|
||||
(gp = getgrgid(buf.st_gid)))
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.28 1998/05/29 17:00:21 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.29 1998/06/15 19:29:49 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* InitPostgres() is the function called from PostgresMain
|
||||
@@ -295,9 +295,7 @@ InitCommunication()
|
||||
|
||||
postid = getenv("POSTID");
|
||||
if (!PointerIsValid(postid))
|
||||
{
|
||||
MyBackendTag = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
MyBackendTag = atoi(postid);
|
||||
@@ -307,9 +305,7 @@ InitCommunication()
|
||||
|
||||
ipc_key = getenv("IPC_KEY");
|
||||
if (!PointerIsValid(ipc_key))
|
||||
{
|
||||
key = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
key = atoi(ipc_key);
|
||||
@@ -367,9 +363,7 @@ InitCommunication()
|
||||
* ----------------
|
||||
*/
|
||||
if (MyBackendTag == -1)
|
||||
{
|
||||
MyBackendTag = 1;
|
||||
}
|
||||
|
||||
key = PrivateIPCKey;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.9 1998/05/29 13:43:14 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.10 1998/06/15 19:29:50 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -144,9 +144,7 @@ ExpandDatabasePath(char *dbpath)
|
||||
}
|
||||
/* no path delimiter? then add the default path prefixes */
|
||||
else
|
||||
{
|
||||
sprintf(buf, "%s%cbase%c%s", DataDir, SEP_CHAR, SEP_CHAR, dbpath);
|
||||
}
|
||||
|
||||
path = palloc(strlen(buf) + 1);
|
||||
strcpy(path, buf);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/aset.c,v 1.8 1997/09/08 20:57:46 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/aset.c,v 1.9 1998/06/15 19:29:51 momjian Exp $
|
||||
*
|
||||
* NOTE
|
||||
* XXX This is a preliminary implementation which lacks fail-fast
|
||||
@@ -130,9 +130,7 @@ AllocSetReset(AllocSet set)
|
||||
AssertArg(AllocSetIsValid(set));
|
||||
|
||||
while (AllocPointerIsValid(pointer = AllocSetGetFirst(set)))
|
||||
{
|
||||
AllocSetFree(set, pointer);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NOT_USED
|
||||
@@ -144,9 +142,7 @@ AllocSetReset_debug(char *file, int line, AllocSet set)
|
||||
AssertArg(AllocSetIsValid(set));
|
||||
|
||||
while (AllocPointerIsValid(pointer = AllocSetGetFirst(set)))
|
||||
{
|
||||
AllocSetFree(set, pointer);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -189,9 +185,7 @@ AllocSetAlloc(AllocSet set, Size size)
|
||||
alloc = (AllocElem) malloc(sizeof(*alloc) + size);
|
||||
|
||||
if (!PointerIsValid(alloc))
|
||||
{
|
||||
elog(FATAL, "palloc failure: memory exhausted");
|
||||
}
|
||||
|
||||
/* add to allocation list */
|
||||
OrderedElemPushInto(&alloc->elemData, &set->setData);
|
||||
@@ -298,9 +292,7 @@ AllocSetIterate(AllocSet set,
|
||||
{
|
||||
|
||||
if (PointerIsValid(function))
|
||||
{
|
||||
(*function) (pointer);
|
||||
}
|
||||
count += 1;
|
||||
}
|
||||
|
||||
@@ -319,9 +311,7 @@ AllocSetCount(AllocSet set)
|
||||
for (pointer = AllocSetGetFirst(set);
|
||||
AllocPointerIsValid(pointer);
|
||||
pointer = AllocPointerGetNext(pointer))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -346,9 +336,7 @@ AllocSetGetFirst(AllocSet set)
|
||||
alloc = (AllocElem) OrderedSetGetHead(&set->setData);
|
||||
|
||||
if (!AllocElemIsValid(alloc))
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
return (AllocElemGetAllocPointer(alloc));
|
||||
}
|
||||
@@ -369,9 +357,7 @@ AllocPointerGetNext(AllocPointer pointer)
|
||||
OrderedElemGetSuccessor(&AllocPointerGetAllocElem(pointer)->elemData);
|
||||
|
||||
if (!AllocElemIsValid(alloc))
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
return (AllocElemGetAllocPointer(alloc));
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.7 1998/02/26 04:38:21 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.8 1998/06/15 19:29:52 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -151,9 +151,7 @@ EnableMemoryContext(bool on)
|
||||
AssertArg(BoolIsValid(on));
|
||||
|
||||
if (BypassEnable(&MemoryContextEnableCount, on))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
processing = true;
|
||||
|
||||
@@ -188,9 +186,7 @@ EnableMemoryContext(bool on)
|
||||
OrderedElemPop(&TopGlobalMemoryData.elemData);
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalMemoryDestroy(context);
|
||||
}
|
||||
/* what is needed for the top? */
|
||||
}
|
||||
|
||||
@@ -493,15 +489,11 @@ GlobalMemoryDump(GlobalMemory this)
|
||||
|
||||
context = (GlobalMemory) OrderedElemGetPredecessor(&this->elemData);
|
||||
if (PointerIsValid(context))
|
||||
{
|
||||
printf("\tpredecessor=%s\n", GlobalMemoryGetName(context));
|
||||
}
|
||||
|
||||
context = (GlobalMemory) OrderedElemGetSuccessor(&this->elemData);
|
||||
if (PointerIsValid(context))
|
||||
{
|
||||
printf("\tsucessor=%s\n", GlobalMemoryGetName(context));
|
||||
}
|
||||
|
||||
AllocSetDump(&this->setData); /* XXX is this right interface */
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Attic/oset.c,v 1.7 1998/02/11 19:13:17 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Attic/oset.c,v 1.8 1998/06/15 19:29:53 momjian Exp $
|
||||
*
|
||||
* NOTE
|
||||
* XXX This is a preliminary implementation which lacks fail-fast
|
||||
@@ -68,9 +68,7 @@ OrderedSetGetHead(OrderedSet set)
|
||||
|
||||
elem = set->head;
|
||||
if (elem->next)
|
||||
{
|
||||
return (OrderedElemGetBase(elem));
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@@ -85,9 +83,7 @@ OrderedSetGetTail(OrderedSet set)
|
||||
|
||||
elem = set->tail;
|
||||
if (elem->prev)
|
||||
{
|
||||
return (OrderedElemGetBase(elem));
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@@ -101,9 +97,7 @@ OrderedElemGetPredecessor(OrderedElem elem)
|
||||
{
|
||||
elem = elem->prev;
|
||||
if (elem->prev)
|
||||
{
|
||||
return (OrderedElemGetBase(elem));
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@@ -115,9 +109,7 @@ OrderedElemGetSuccessor(OrderedElem elem)
|
||||
{
|
||||
elem = elem->next;
|
||||
if (elem->next)
|
||||
{
|
||||
return (OrderedElemGetBase(elem));
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.11 1998/06/15 18:39:44 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.12 1998/06/15 19:29:53 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -594,9 +594,7 @@ GetPortalByName(char *name)
|
||||
AssertState(PortalManagerEnabled);
|
||||
|
||||
if (PointerIsValid(name))
|
||||
{
|
||||
PortalHashTableLookup(name, portal);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!PortalIsValid(BlankPortal))
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.40 1998/06/15 18:39:45 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.41 1998/06/15 19:29:54 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Sorts the first relation into the second relation.
|
||||
@@ -1072,9 +1072,7 @@ resettape(FILE *file)
|
||||
|
||||
file = freopen(tp->tl_name, "w+", file);
|
||||
if (file == NULL)
|
||||
{
|
||||
elog(FATAL, "could not freopen temporary file");
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.15 1998/04/24 14:42:42 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.16 1998/06/15 19:29:58 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -44,9 +44,7 @@ setheapoverride(bool on)
|
||||
HeapSpecialCommandId = GetCurrentCommandId();
|
||||
}
|
||||
else
|
||||
{
|
||||
HeapSpecialTransactionId = InvalidTransactionId;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* !defined(GOODAMI) */
|
||||
|
||||
Reference in New Issue
Block a user