- merging in Dr. George's tree with ours

- src/backend/access
                - no changes
        - src/backend/utils
                - mostly cosmetic changes
                - ESCAPE_PATCH Added
        - src/Makefile.global changes merged
This commit is contained in:
Marc G. Fournier 1996-07-22 21:58:28 +00:00
parent 672f6ece23
commit 18a7989e1a
11 changed files with 87 additions and 52 deletions

View File

@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.8 1996/07/20 08:34:08 scrappy Exp $
# $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.9 1996/07/22 21:54:49 scrappy Exp $
#
# NOTES
# This is seen by any Makefiles that include mk/postgres.mk. To
@ -67,10 +67,6 @@ SRCDIR= /home/staff/scrappy/cvs/postgres95/src
LEX = flex
LDADD+= -L/usr/local/lib -lfl
# Uncomment the following to bring in changes by OpenLink
# See README.OPENLINK for applied patches
# CFLAGS+= -DOPENLINK_PATCHES
# POSTGRESLOGIN is the login name of the user who gets special
# privileges within the database. By default it is "postgres", but
# you can change it to any existing login name (such as your own
@ -290,7 +286,13 @@ LDFLAGS+= $(LDFLAGS_BE)
# enable patches to array update code
CFLAGS += -DARRAY_PATCH
# enable patches to null insert/update code
CFLAGS += -DNULL_PATCH
# enable patches to array escape conversion code
CFLAGS += -DESCAPE_PATCH
# enable patches for varchar and fsync
CFLAGS += -DOPENLINK_PATCHES
##############################################################################
#
# Miscellaneous configuration

View File

@ -8,7 +8,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh,v 1.2 1996/07/16 07:13:25 scrappy Exp $
# $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh,v 1.3 1996/07/22 21:55:40 scrappy Exp $
#
# NOTES
# Passes any -D options on to cpp prior to generating the list
@ -81,7 +81,7 @@ cat > $HFILE <<FuNkYfMgRsTuFf
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: Gen_fmgrtab.sh,v 1.2 1996/07/16 07:13:25 scrappy Exp $
* $Id: Gen_fmgrtab.sh,v 1.3 1996/07/22 21:55:40 scrappy Exp $
*
* NOTES
* ******************************
@ -175,7 +175,7 @@ cat > $TABCFILE <<FuNkYfMgRtAbStUfF
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh,v 1.2 1996/07/16 07:13:25 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh,v 1.3 1996/07/22 21:55:40 scrappy Exp $
*
* NOTES
*
@ -195,12 +195,14 @@ cat > $TABCFILE <<FuNkYfMgRtAbStUfF
#ifdef WIN32
#include <limits.h>
#else
# if defined(PORTNAME_BSD44_derived) || defined(PORTNAME_bsdi) || defined(PORTNAME_bsdi_2_1)
# if defined(PORTNAME_BSD44_derived) || \
defined(PORTNAME_bsdi) || \
defined(PORTNAME_bsdi_2_1)
# include <machine/limits.h>
# define MAXINT INT_MAX
# else
# include <values.h> /* for MAXINT */
# endif /* PORTNAME_BSD44_derived || PORTNAME_bsdi || PORTNAME_bsdi_2_1 */
# endif /* bsd descendents */
#endif /* WIN32 */
#include "utils/fmgrtab.h"

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.2 1996/07/20 07:58:44 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.3 1996/07/22 21:56:00 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -224,6 +224,14 @@ _ArrayCount(char *str, int dim[], int typdelim)
bool done = false;
while (!done) {
switch (*q) {
#ifdef ESCAPE_PATCH
case '\\':
/* skip escaped characters (\ and ") inside strings */
if (scanning_string && *(q+1)) {
q++;
}
break;
#endif
case '\"':
scanning_string = ! scanning_string;
break;

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/geo-ops.c,v 1.1.1.1 1996/07/09 06:22:04 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/geo-ops.c,v 1.2 1996/07/22 21:56:01 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -717,8 +717,8 @@ long path_inter(PATH *p1, PATH *p2)
int i, j;
LSEG seg1, seg2;
b1.xh = b1.yh = b2.xh = b2.yh = DBL_MAX;
b1.xl = b1.yl = b2.xl = b2.yl = -DBL_MAX;
b1.xh = b1.yh = b2.xh = b2.yh = (double)DBL_MAX;
b1.xl = b1.yl = b2.xl = b2.yl = -(double)DBL_MAX;
for (i = 0; i < p1->npts; ++i) {
b1.xh = Max(p1->p[i].x, b1.xh);
b1.yh = Max(p1->p[i].y, b1.yh);
@ -955,7 +955,7 @@ double *point_slope(Point *pt1, Point *pt2)
result = PALLOCTYPE(double);
if (point_vert(pt1, pt2))
*result = DBL_MAX;
*result = (double)DBL_MAX;
else
*result = (pt1->y - pt2->y) / (pt1->x - pt1->x);
return(result);
@ -965,7 +965,7 @@ double *point_slope(Point *pt1, Point *pt2)
double point_sl(Point *pt1, Point *pt2)
{
return( point_vert(pt1, pt2)
? DBL_MAX
? (double)DBL_MAX
: (pt1->y - pt2->y) / (pt1->x - pt2->x) );
}
@ -1124,7 +1124,7 @@ double *lseg_distance(LSEG *l1, LSEG *l2)
*result = 0.0;
return(result);
}
*result = DBL_MAX;
*result = (double)DBL_MAX;
d = dist_ps(&l1->p[0], l2);
*result = Min(*result, *d);
PFREE(d);
@ -1148,7 +1148,7 @@ double lseg_dt(LSEG *l1, LSEG *l2)
if (lseg_intersect(l1, l2))
return(0.0);
result = DBL_MAX;
result = (double)DBL_MAX;
d = dist_ps(&l1->p[0], l2);
result = Min(result, *d);
PFREE(d);
@ -1231,7 +1231,7 @@ double *dist_ps(Point *pt, LSEG *lseg)
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 = DBL_MAX;
m = (double)DBL_MAX;
else m = (-1) * (lseg->p[1].y - lseg->p[0].y) /
(lseg->p[1].x - lseg->p[0].x);
ln = line_construct_pm(pt, m);
@ -1512,8 +1512,8 @@ long on_pl(Point *pt, LINE *line)
*/
long on_ps(Point *pt, LSEG *lseg)
{
return( point_dt(pt, &lseg->p[0]) + point_dt(pt, &lseg->p[1])
== point_dt(&lseg->p[0], &lseg->p[1]) );
return( FPeq (point_dt(pt, &lseg->p[0]) + point_dt(pt, &lseg->p[1]),
point_dt(&lseg->p[0], &lseg->p[1])) );
}
long on_pb(Point *pt, BOX *box)

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/misc.c,v 1.2 1996/07/16 07:13:33 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/misc.c,v 1.3 1996/07/22 21:56:02 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -17,8 +17,12 @@
#include "catalog/pg_type.h"
#include "utils/builtins.h"
#if !defined(PORTNAME_linux) && !defined(PORTNAME_BSD44_derived) && \
!defined(PORTNAME_irix5) && !defined(PORTNAME_bsdi) && !defined(PORTNAME_bsdi_2_1) && !defined(PORTNAME_aix)
#if !defined(PORTNAME_aix) && \
!defined(PORTNAME_BSD44_derived) && \
!defined(PORTNAME_bsdi) && \
!defined(PORTNAME_bsdi_2_1) && \
!defined(PORTNAME_irix5) && \
!defined(PORTNAME_linux)
extern int random();
extern int srandom(unsigned);
#endif

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.2 1996/07/20 08:36:19 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.3 1996/07/22 21:56:03 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -291,23 +291,24 @@ tryabsdate(char *fields[], int nf, struct tm *tm, int *tzp)
(void) ftime(&now);
*tzp = now.timezone;
#else /* USE_POSIX_TIME */
#if defined(PORTNAME_hpux) || \
defined(PORTNAME_aix) || \
#if defined(PORTNAME_aix) || \
defined(PORTNAME_hpux) || \
defined(PORTNAME_i386_solaris) || \
defined(PORTNAME_irix5) || \
defined(WIN32) || \
defined(PORTNAME_sparc_solaris) || defined(PORTNAME_i386_solaris)
defined(PORTNAME_sparc_solaris) || \
defined(WIN32)
tzset();
#ifndef WIN32
*tzp = timezone / 60; /* this is an X/Open-ism */
#else
*tzp = _timezone / 60; /* this is an X/Open-ism */
#endif /* WIN32 */
#else /* PORTNAME_hpux || PORTNAME_aix || PORTNAME_sparc_solaris || PORTNAME_irix5 */
#else /* PORTNAME_aix || PORTNAME_hpux || ... */
time_t now = time((time_t *) NULL);
struct tm *tmnow = localtime(&now);
*tzp = - tmnow->tm_gmtoff / 60; /* tm_gmtoff is Sun/DEC-ism */
#endif /* PORTNAME_hpux || PORTNAME_aix */
#endif /* PORTNAME_aix || PORTNAME_hpux || ... */
#endif /* USE_POSIX_TIME */
tm->tm_mday = tm->tm_mon = tm->tm_year = -1; /* mandatory */

View File

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.2 1996/07/16 07:13:35 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.3 1996/07/22 21:56:03 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -132,7 +132,9 @@ ltoa(int32 l, char *a)
int
ftoa(double value, char *ascii, int width, int prec1, char format)
{
#if defined(PORTNAME_BSD44_derived) || defined(PORTNAME_bsdi) || defined(PORTNAME_bsdi_2_1)
#if defined(PORTNAME_BSD44_derived) || \
defined(PORTNAME_bsdi) || \
defined(PORTNAME_bsdi_2_1)
char out[256];
char fmt[256];
int ret;

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.3 1996/07/19 07:14:14 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.4 1996/07/22 21:56:04 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -219,23 +219,35 @@ int textlen (text* t)
* takes two text* and returns a text* that is the concatentation of
* the two
*/
/*
* Rewrited by Sapa, sapa@hq.icb.chel.su. 8-Jul-96.
*/
text*
textcat(text* t1, text* t2)
{
int len1, len2, newlen;
char *ptr;
text* result;
/* Check for NULL strings... */
if (t1 == NULL) return t2;
if (t2 == NULL) return t1;
len1 = textlen (t1);
len2 = textlen (t2);
newlen = len1 + len2 + VARHDRSZ;
result = (text*) palloc (newlen);
/* Check for ZERO-LENGTH strings... */
/* I use <= instead of == , I know - it's paranoia, but... */
if((len1 = VARSIZE(t1) - VARHDRSZ) <= 0) return t2;
if((len2 = VARSIZE(t2) - VARHDRSZ) <= 0) return t1;
result = (text *)palloc(newlen = len1 + len2 + VARHDRSZ);
/* Fill data field of result string... */
memcpy(ptr = VARDATA(result), VARDATA(t1), len1);
memcpy(ptr + len1, VARDATA(t2), len2);
/* Set size of result string... */
VARSIZE(result) = newlen;
memcpy (VARDATA(result), VARDATA(t1), len1);
memcpy (VARDATA(result) + len1, VARDATA(t2), len2);
return result;
}

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.3 1996/07/19 06:13:58 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.4 1996/07/22 21:58:26 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -48,9 +48,11 @@ elog(int lev, char *fmt, ... )
char buf[ELOG_MAXLEN], line[ELOG_MAXLEN];
register char *bp, *cp;
extern int errno, sys_nerr;
#if !defined(PORTNAME_BSD44_derived) && !defined(PORTNAME_bsdi) && !defined(PORTNAME_bsdi_2_1)
#if !defined(PORTNAME_BSD44_derived) && \
!defined(PORTNAME_bsdi) && \
!defined(PORTNAME_bsdi_2_1)
extern char *sys_errlist[];
#endif /* !PORTNAME_BSD44_derived */
#endif /* bsd derived */
#ifndef PG_STANDALONE
extern FILE *Pfout;
#endif /* !PG_STANDALONE */

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/exc.c,v 1.2 1996/07/16 07:13:49 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/exc.c,v 1.3 1996/07/22 21:58:28 scrappy Exp $
*
* NOTE
* XXX this code needs improvement--check for state violations and
@ -90,9 +90,11 @@ ExcPrint(Exception *excP,
{
extern int errno;
extern int sys_nerr;
#if !defined(PORTNAME_BSD44_derived) && !defined(PORTNAME_bsdi) && !defined(PORTNAME_bsdi_2_1)
#if !defined(PORTNAME_BSD44_derived) && \
!defined(PORTNAME_bsdi) && \
!defined(PORTNAME_bsdi_2_1)
extern char *sys_errlist[];
#endif /* !PORTNAME_BSD44_derived */
#endif /* ! bsd_derived */
#ifdef lint
data = data;

View File

@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: exc.h,v 1.1.1.1 1996/07/09 06:22:01 scrappy Exp $
* $Id: exc.h,v 1.2 1996/07/22 21:55:41 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -23,10 +23,10 @@ extern Index ExcLineNumber;
* ExcMessage and Exception are now defined in c.h
*/
#if defined(PORTNAME_linux) \
|| defined(PORTNAME_hpux) \
|| defined(PORTNAME_next)\
|| defined(WIN32)
#if defined(PORTNAME_hpux) || \
defined(PORTNAME_linux) || \
defined(PORTNAME_next) || \
defined(WIN32)
typedef jmp_buf ExcContext;
#else
typedef sigjmp_buf ExcContext;