Commit 18a7989e authored by Marc G. Fournier's avatar Marc G. Fournier

- 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
parent 672f6ece
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
# #
# IDENTIFICATION # 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 # NOTES
# This is seen by any Makefiles that include mk/postgres.mk. To # This is seen by any Makefiles that include mk/postgres.mk. To
...@@ -67,10 +67,6 @@ SRCDIR= /home/staff/scrappy/cvs/postgres95/src ...@@ -67,10 +67,6 @@ SRCDIR= /home/staff/scrappy/cvs/postgres95/src
LEX = flex LEX = flex
LDADD+= -L/usr/local/lib -lfl 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 # POSTGRESLOGIN is the login name of the user who gets special
# privileges within the database. By default it is "postgres", but # privileges within the database. By default it is "postgres", but
# you can change it to any existing login name (such as your own # you can change it to any existing login name (such as your own
...@@ -290,6 +286,12 @@ LDFLAGS+= $(LDFLAGS_BE) ...@@ -290,6 +286,12 @@ LDFLAGS+= $(LDFLAGS_BE)
# enable patches to array update code # enable patches to array update code
CFLAGS += -DARRAY_PATCH 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
############################################################################## ##############################################################################
# #
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# #
# #
# IDENTIFICATION # 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 # NOTES
# Passes any -D options on to cpp prior to generating the list # Passes any -D options on to cpp prior to generating the list
...@@ -81,7 +81,7 @@ cat > $HFILE <<FuNkYfMgRsTuFf ...@@ -81,7 +81,7 @@ cat > $HFILE <<FuNkYfMgRsTuFf
* *
* Copyright (c) 1994, Regents of the University of California * 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 * NOTES
* ****************************** * ******************************
...@@ -175,7 +175,7 @@ cat > $TABCFILE <<FuNkYfMgRtAbStUfF ...@@ -175,7 +175,7 @@ cat > $TABCFILE <<FuNkYfMgRtAbStUfF
* *
* *
* IDENTIFICATION * 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 * NOTES
* *
...@@ -195,12 +195,14 @@ cat > $TABCFILE <<FuNkYfMgRtAbStUfF ...@@ -195,12 +195,14 @@ cat > $TABCFILE <<FuNkYfMgRtAbStUfF
#ifdef WIN32 #ifdef WIN32
#include <limits.h> #include <limits.h>
#else #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> # include <machine/limits.h>
# define MAXINT INT_MAX # define MAXINT INT_MAX
# else # else
# include <values.h> /* for MAXINT */ # include <values.h> /* for MAXINT */
# endif /* PORTNAME_BSD44_derived || PORTNAME_bsdi || PORTNAME_bsdi_2_1 */ # endif /* bsd descendents */
#endif /* WIN32 */ #endif /* WIN32 */
#include "utils/fmgrtab.h" #include "utils/fmgrtab.h"
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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) ...@@ -224,6 +224,14 @@ _ArrayCount(char *str, int dim[], int typdelim)
bool done = false; bool done = false;
while (!done) { while (!done) {
switch (*q) { switch (*q) {
#ifdef ESCAPE_PATCH
case '\\':
/* skip escaped characters (\ and ") inside strings */
if (scanning_string && *(q+1)) {
q++;
}
break;
#endif
case '\"': case '\"':
scanning_string = ! scanning_string; scanning_string = ! scanning_string;
break; break;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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) ...@@ -717,8 +717,8 @@ long path_inter(PATH *p1, PATH *p2)
int i, j; int i, j;
LSEG seg1, seg2; LSEG seg1, seg2;
b1.xh = b1.yh = b2.xh = b2.yh = DBL_MAX; b1.xh = b1.yh = b2.xh = b2.yh = (double)DBL_MAX;
b1.xl = b1.yl = b2.xl = b2.yl = -DBL_MAX; b1.xl = b1.yl = b2.xl = b2.yl = -(double)DBL_MAX;
for (i = 0; i < p1->npts; ++i) { for (i = 0; i < p1->npts; ++i) {
b1.xh = Max(p1->p[i].x, b1.xh); b1.xh = Max(p1->p[i].x, b1.xh);
b1.yh = Max(p1->p[i].y, b1.yh); b1.yh = Max(p1->p[i].y, b1.yh);
...@@ -955,7 +955,7 @@ double *point_slope(Point *pt1, Point *pt2) ...@@ -955,7 +955,7 @@ double *point_slope(Point *pt1, Point *pt2)
result = PALLOCTYPE(double); result = PALLOCTYPE(double);
if (point_vert(pt1, pt2)) if (point_vert(pt1, pt2))
*result = DBL_MAX; *result = (double)DBL_MAX;
else else
*result = (pt1->y - pt2->y) / (pt1->x - pt1->x); *result = (pt1->y - pt2->y) / (pt1->x - pt1->x);
return(result); return(result);
...@@ -965,7 +965,7 @@ double *point_slope(Point *pt1, Point *pt2) ...@@ -965,7 +965,7 @@ double *point_slope(Point *pt1, Point *pt2)
double point_sl(Point *pt1, Point *pt2) double point_sl(Point *pt1, Point *pt2)
{ {
return( point_vert(pt1, pt2) return( point_vert(pt1, pt2)
? DBL_MAX ? (double)DBL_MAX
: (pt1->y - pt2->y) / (pt1->x - pt2->x) ); : (pt1->y - pt2->y) / (pt1->x - pt2->x) );
} }
...@@ -1124,7 +1124,7 @@ double *lseg_distance(LSEG *l1, LSEG *l2) ...@@ -1124,7 +1124,7 @@ double *lseg_distance(LSEG *l1, LSEG *l2)
*result = 0.0; *result = 0.0;
return(result); return(result);
} }
*result = DBL_MAX; *result = (double)DBL_MAX;
d = dist_ps(&l1->p[0], l2); d = dist_ps(&l1->p[0], l2);
*result = Min(*result, *d); *result = Min(*result, *d);
PFREE(d); PFREE(d);
...@@ -1148,7 +1148,7 @@ double lseg_dt(LSEG *l1, LSEG *l2) ...@@ -1148,7 +1148,7 @@ double lseg_dt(LSEG *l1, LSEG *l2)
if (lseg_intersect(l1, l2)) if (lseg_intersect(l1, l2))
return(0.0); return(0.0);
result = DBL_MAX; result = (double)DBL_MAX;
d = dist_ps(&l1->p[0], l2); d = dist_ps(&l1->p[0], l2);
result = Min(result, *d); result = Min(result, *d);
PFREE(d); PFREE(d);
...@@ -1231,7 +1231,7 @@ double *dist_ps(Point *pt, LSEG *lseg) ...@@ -1231,7 +1231,7 @@ double *dist_ps(Point *pt, LSEG *lseg)
if (lseg->p[1].x == lseg->p[0].x) if (lseg->p[1].x == lseg->p[0].x)
m = 0; m = 0;
else if (lseg->p[1].y == lseg->p[0].y) /* slope is infinite */ 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) / else m = (-1) * (lseg->p[1].y - lseg->p[0].y) /
(lseg->p[1].x - lseg->p[0].x); (lseg->p[1].x - lseg->p[0].x);
ln = line_construct_pm(pt, m); ln = line_construct_pm(pt, m);
...@@ -1512,8 +1512,8 @@ long on_pl(Point *pt, LINE *line) ...@@ -1512,8 +1512,8 @@ long on_pl(Point *pt, LINE *line)
*/ */
long on_ps(Point *pt, LSEG *lseg) long on_ps(Point *pt, LSEG *lseg)
{ {
return( point_dt(pt, &lseg->p[0]) + point_dt(pt, &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]) ); point_dt(&lseg->p[0], &lseg->p[1])) );
} }
long on_pb(Point *pt, BOX *box) long on_pb(Point *pt, BOX *box)
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 @@ ...@@ -17,8 +17,12 @@
#include "catalog/pg_type.h" #include "catalog/pg_type.h"
#include "utils/builtins.h" #include "utils/builtins.h"
#if !defined(PORTNAME_linux) && !defined(PORTNAME_BSD44_derived) && \ #if !defined(PORTNAME_aix) && \
!defined(PORTNAME_irix5) && !defined(PORTNAME_bsdi) && !defined(PORTNAME_bsdi_2_1) && !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 random();
extern int srandom(unsigned); extern int srandom(unsigned);
#endif #endif
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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) ...@@ -291,23 +291,24 @@ tryabsdate(char *fields[], int nf, struct tm *tm, int *tzp)
(void) ftime(&now); (void) ftime(&now);
*tzp = now.timezone; *tzp = now.timezone;
#else /* USE_POSIX_TIME */ #else /* USE_POSIX_TIME */
#if defined(PORTNAME_hpux) || \ #if defined(PORTNAME_aix) || \
defined(PORTNAME_aix) || \ defined(PORTNAME_hpux) || \
defined(PORTNAME_i386_solaris) || \
defined(PORTNAME_irix5) || \ defined(PORTNAME_irix5) || \
defined(WIN32) || \ defined(PORTNAME_sparc_solaris) || \
defined(PORTNAME_sparc_solaris) || defined(PORTNAME_i386_solaris) defined(WIN32)
tzset(); tzset();
#ifndef WIN32 #ifndef WIN32
*tzp = timezone / 60; /* this is an X/Open-ism */ *tzp = timezone / 60; /* this is an X/Open-ism */
#else #else
*tzp = _timezone / 60; /* this is an X/Open-ism */ *tzp = _timezone / 60; /* this is an X/Open-ism */
#endif /* WIN32 */ #endif /* WIN32 */
#else /* PORTNAME_hpux || PORTNAME_aix || PORTNAME_sparc_solaris || PORTNAME_irix5 */ #else /* PORTNAME_aix || PORTNAME_hpux || ... */
time_t now = time((time_t *) NULL); time_t now = time((time_t *) NULL);
struct tm *tmnow = localtime(&now); struct tm *tmnow = localtime(&now);
*tzp = - tmnow->tm_gmtoff / 60; /* tm_gmtoff is Sun/DEC-ism */ *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 */ #endif /* USE_POSIX_TIME */
tm->tm_mday = tm->tm_mon = tm->tm_year = -1; /* mandatory */ tm->tm_mday = tm->tm_mon = tm->tm_year = -1; /* mandatory */
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * 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) ...@@ -132,7 +132,9 @@ ltoa(int32 l, char *a)
int int
ftoa(double value, char *ascii, int width, int prec1, char format) 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 out[256];
char fmt[256]; char fmt[256];
int ret; int ret;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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) ...@@ -219,23 +219,35 @@ int textlen (text* t)
* takes two text* and returns a text* that is the concatentation of * takes two text* and returns a text* that is the concatentation of
* the two * the two
*/ */
/*
* Rewrited by Sapa, sapa@hq.icb.chel.su. 8-Jul-96.
*/
text* text*
textcat(text* t1, text* t2) textcat(text* t1, text* t2)
{ {
int len1, len2, newlen; int len1, len2, newlen;
char *ptr;
text* result; text* result;
/* Check for NULL strings... */
if (t1 == NULL) return t2; if (t1 == NULL) return t2;
if (t2 == NULL) return t1; if (t2 == NULL) return t1;
len1 = textlen (t1); /* Check for ZERO-LENGTH strings... */
len2 = textlen (t2); /* I use <= instead of == , I know - it's paranoia, but... */
newlen = len1 + len2 + VARHDRSZ; if((len1 = VARSIZE(t1) - VARHDRSZ) <= 0) return t2;
result = (text*) palloc (newlen); 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; VARSIZE(result) = newlen;
memcpy (VARDATA(result), VARDATA(t1), len1);
memcpy (VARDATA(result) + len1, VARDATA(t2), len2);
return result; return result;
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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, ... ) ...@@ -48,9 +48,11 @@ elog(int lev, char *fmt, ... )
char buf[ELOG_MAXLEN], line[ELOG_MAXLEN]; char buf[ELOG_MAXLEN], line[ELOG_MAXLEN];
register char *bp, *cp; register char *bp, *cp;
extern int errno, sys_nerr; 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[]; extern char *sys_errlist[];
#endif /* !PORTNAME_BSD44_derived */ #endif /* bsd derived */
#ifndef PG_STANDALONE #ifndef PG_STANDALONE
extern FILE *Pfout; extern FILE *Pfout;
#endif /* !PG_STANDALONE */ #endif /* !PG_STANDALONE */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTE
* XXX this code needs improvement--check for state violations and * XXX this code needs improvement--check for state violations and
...@@ -90,9 +90,11 @@ ExcPrint(Exception *excP, ...@@ -90,9 +90,11 @@ ExcPrint(Exception *excP,
{ {
extern int errno; extern int errno;
extern int sys_nerr; 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[]; extern char *sys_errlist[];
#endif /* !PORTNAME_BSD44_derived */ #endif /* ! bsd_derived */
#ifdef lint #ifdef lint
data = data; data = data;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * 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; ...@@ -23,10 +23,10 @@ extern Index ExcLineNumber;
* ExcMessage and Exception are now defined in c.h * ExcMessage and Exception are now defined in c.h
*/ */
#if defined(PORTNAME_linux) \ #if defined(PORTNAME_hpux) || \
|| defined(PORTNAME_hpux) \ defined(PORTNAME_linux) || \
|| defined(PORTNAME_next)\ defined(PORTNAME_next) || \
|| defined(WIN32) defined(WIN32)
typedef jmp_buf ExcContext; typedef jmp_buf ExcContext;
#else #else
typedef sigjmp_buf ExcContext; typedef sigjmp_buf ExcContext;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment