Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 18a7989

Browse files
committed
- 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
1 parent 672f6ec commit 18a7989

File tree

11 files changed

+87
-52
lines changed

11 files changed

+87
-52
lines changed

src/Makefile.global

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.8 1996/07/20 08:34:08 scrappy Exp $
10+
# $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.9 1996/07/22 21:54:49 scrappy Exp $
1111
#
1212
# NOTES
1313
# This is seen by any Makefiles that include mk/postgres.mk. To
@@ -67,10 +67,6 @@ SRCDIR= /home/staff/scrappy/cvs/postgres95/src
6767
LEX = flex
6868
LDADD+= -L/usr/local/lib -lfl
6969

70-
# Uncomment the following to bring in changes by OpenLink
71-
# See README.OPENLINK for applied patches
72-
# CFLAGS+= -DOPENLINK_PATCHES
73-
7470
# POSTGRESLOGIN is the login name of the user who gets special
7571
# privileges within the database. By default it is "postgres", but
7672
# you can change it to any existing login name (such as your own
@@ -290,7 +286,13 @@ LDFLAGS+= $(LDFLAGS_BE)
290286

291287
# enable patches to array update code
292288
CFLAGS += -DARRAY_PATCH
293-
289+
# enable patches to null insert/update code
290+
CFLAGS += -DNULL_PATCH
291+
# enable patches to array escape conversion code
292+
CFLAGS += -DESCAPE_PATCH
293+
# enable patches for varchar and fsync
294+
CFLAGS += -DOPENLINK_PATCHES
295+
294296
##############################################################################
295297
#
296298
# Miscellaneous configuration

src/backend/utils/Gen_fmgrtab.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
#
1010
# IDENTIFICATION
11-
# $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh,v 1.2 1996/07/16 07:13:25 scrappy Exp $
11+
# $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh,v 1.3 1996/07/22 21:55:40 scrappy Exp $
1212
#
1313
# NOTES
1414
# Passes any -D options on to cpp prior to generating the list
@@ -81,7 +81,7 @@ cat > $HFILE <<FuNkYfMgRsTuFf
8181
*
8282
* Copyright (c) 1994, Regents of the University of California
8383
*
84-
* $Id: Gen_fmgrtab.sh,v 1.2 1996/07/16 07:13:25 scrappy Exp $
84+
* $Id: Gen_fmgrtab.sh,v 1.3 1996/07/22 21:55:40 scrappy Exp $
8585
*
8686
* NOTES
8787
* ******************************
@@ -175,7 +175,7 @@ cat > $TABCFILE <<FuNkYfMgRtAbStUfF
175175
*
176176
*
177177
* IDENTIFICATION
178-
* $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh,v 1.2 1996/07/16 07:13:25 scrappy Exp $
178+
* $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh,v 1.3 1996/07/22 21:55:40 scrappy Exp $
179179
*
180180
* NOTES
181181
*
@@ -195,12 +195,14 @@ cat > $TABCFILE <<FuNkYfMgRtAbStUfF
195195
#ifdef WIN32
196196
#include <limits.h>
197197
#else
198-
# if defined(PORTNAME_BSD44_derived) || defined(PORTNAME_bsdi) || defined(PORTNAME_bsdi_2_1)
198+
# if defined(PORTNAME_BSD44_derived) || \
199+
defined(PORTNAME_bsdi) || \
200+
defined(PORTNAME_bsdi_2_1)
199201
# include <machine/limits.h>
200202
# define MAXINT INT_MAX
201203
# else
202204
# include <values.h> /* for MAXINT */
203-
# endif /* PORTNAME_BSD44_derived || PORTNAME_bsdi || PORTNAME_bsdi_2_1 */
205+
# endif /* bsd descendents */
204206
#endif /* WIN32 */
205207
206208
#include "utils/fmgrtab.h"

src/backend/utils/adt/arrayfuncs.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.2 1996/07/20 07:58:44 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.3 1996/07/22 21:56:00 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -224,6 +224,14 @@ _ArrayCount(char *str, int dim[], int typdelim)
224224
bool done = false;
225225
while (!done) {
226226
switch (*q) {
227+
#ifdef ESCAPE_PATCH
228+
case '\\':
229+
/* skip escaped characters (\ and ") inside strings */
230+
if (scanning_string && *(q+1)) {
231+
q++;
232+
}
233+
break;
234+
#endif
227235
case '\"':
228236
scanning_string = ! scanning_string;
229237
break;

src/backend/utils/adt/geo-ops.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/geo-ops.c,v 1.1.1.1 1996/07/09 06:22:04 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/geo-ops.c,v 1.2 1996/07/22 21:56:01 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -717,8 +717,8 @@ long path_inter(PATH *p1, PATH *p2)
717717
int i, j;
718718
LSEG seg1, seg2;
719719

720-
b1.xh = b1.yh = b2.xh = b2.yh = DBL_MAX;
721-
b1.xl = b1.yl = b2.xl = b2.yl = -DBL_MAX;
720+
b1.xh = b1.yh = b2.xh = b2.yh = (double)DBL_MAX;
721+
b1.xl = b1.yl = b2.xl = b2.yl = -(double)DBL_MAX;
722722
for (i = 0; i < p1->npts; ++i) {
723723
b1.xh = Max(p1->p[i].x, b1.xh);
724724
b1.yh = Max(p1->p[i].y, b1.yh);
@@ -955,7 +955,7 @@ double *point_slope(Point *pt1, Point *pt2)
955955

956956
result = PALLOCTYPE(double);
957957
if (point_vert(pt1, pt2))
958-
*result = DBL_MAX;
958+
*result = (double)DBL_MAX;
959959
else
960960
*result = (pt1->y - pt2->y) / (pt1->x - pt1->x);
961961
return(result);
@@ -965,7 +965,7 @@ double *point_slope(Point *pt1, Point *pt2)
965965
double point_sl(Point *pt1, Point *pt2)
966966
{
967967
return( point_vert(pt1, pt2)
968-
? DBL_MAX
968+
? (double)DBL_MAX
969969
: (pt1->y - pt2->y) / (pt1->x - pt2->x) );
970970
}
971971

@@ -1124,7 +1124,7 @@ double *lseg_distance(LSEG *l1, LSEG *l2)
11241124
*result = 0.0;
11251125
return(result);
11261126
}
1127-
*result = DBL_MAX;
1127+
*result = (double)DBL_MAX;
11281128
d = dist_ps(&l1->p[0], l2);
11291129
*result = Min(*result, *d);
11301130
PFREE(d);
@@ -1148,7 +1148,7 @@ double lseg_dt(LSEG *l1, LSEG *l2)
11481148

11491149
if (lseg_intersect(l1, l2))
11501150
return(0.0);
1151-
result = DBL_MAX;
1151+
result = (double)DBL_MAX;
11521152
d = dist_ps(&l1->p[0], l2);
11531153
result = Min(result, *d);
11541154
PFREE(d);
@@ -1231,7 +1231,7 @@ double *dist_ps(Point *pt, LSEG *lseg)
12311231
if (lseg->p[1].x == lseg->p[0].x)
12321232
m = 0;
12331233
else if (lseg->p[1].y == lseg->p[0].y) /* slope is infinite */
1234-
m = DBL_MAX;
1234+
m = (double)DBL_MAX;
12351235
else m = (-1) * (lseg->p[1].y - lseg->p[0].y) /
12361236
(lseg->p[1].x - lseg->p[0].x);
12371237
ln = line_construct_pm(pt, m);
@@ -1512,8 +1512,8 @@ long on_pl(Point *pt, LINE *line)
15121512
*/
15131513
long on_ps(Point *pt, LSEG *lseg)
15141514
{
1515-
return( point_dt(pt, &lseg->p[0]) + point_dt(pt, &lseg->p[1])
1516-
== point_dt(&lseg->p[0], &lseg->p[1]) );
1515+
return( FPeq (point_dt(pt, &lseg->p[0]) + point_dt(pt, &lseg->p[1]),
1516+
point_dt(&lseg->p[0], &lseg->p[1])) );
15171517
}
15181518

15191519
long on_pb(Point *pt, BOX *box)

src/backend/utils/adt/misc.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/misc.c,v 1.2 1996/07/16 07:13:33 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/misc.c,v 1.3 1996/07/22 21:56:02 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -17,8 +17,12 @@
1717
#include "catalog/pg_type.h"
1818
#include "utils/builtins.h"
1919

20-
#if !defined(PORTNAME_linux) && !defined(PORTNAME_BSD44_derived) && \
21-
!defined(PORTNAME_irix5) && !defined(PORTNAME_bsdi) && !defined(PORTNAME_bsdi_2_1) && !defined(PORTNAME_aix)
20+
#if !defined(PORTNAME_aix) && \
21+
!defined(PORTNAME_BSD44_derived) && \
22+
!defined(PORTNAME_bsdi) && \
23+
!defined(PORTNAME_bsdi_2_1) && \
24+
!defined(PORTNAME_irix5) && \
25+
!defined(PORTNAME_linux)
2226
extern int random();
2327
extern int srandom(unsigned);
2428
#endif

src/backend/utils/adt/nabstime.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.2 1996/07/20 08:36:19 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.3 1996/07/22 21:56:03 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -291,23 +291,24 @@ tryabsdate(char *fields[], int nf, struct tm *tm, int *tzp)
291291
(void) ftime(&now);
292292
*tzp = now.timezone;
293293
#else /* USE_POSIX_TIME */
294-
#if defined(PORTNAME_hpux) || \
295-
defined(PORTNAME_aix) || \
294+
#if defined(PORTNAME_aix) || \
295+
defined(PORTNAME_hpux) || \
296+
defined(PORTNAME_i386_solaris) || \
296297
defined(PORTNAME_irix5) || \
297-
defined(WIN32) || \
298-
defined(PORTNAME_sparc_solaris) || defined(PORTNAME_i386_solaris)
298+
defined(PORTNAME_sparc_solaris) || \
299+
defined(WIN32)
299300
tzset();
300301
#ifndef WIN32
301302
*tzp = timezone / 60; /* this is an X/Open-ism */
302303
#else
303304
*tzp = _timezone / 60; /* this is an X/Open-ism */
304305
#endif /* WIN32 */
305-
#else /* PORTNAME_hpux || PORTNAME_aix || PORTNAME_sparc_solaris || PORTNAME_irix5 */
306+
#else /* PORTNAME_aix || PORTNAME_hpux || ... */
306307
time_t now = time((time_t *) NULL);
307308
struct tm *tmnow = localtime(&now);
308309

309310
*tzp = - tmnow->tm_gmtoff / 60; /* tm_gmtoff is Sun/DEC-ism */
310-
#endif /* PORTNAME_hpux || PORTNAME_aix */
311+
#endif /* PORTNAME_aix || PORTNAME_hpux || ... */
311312
#endif /* USE_POSIX_TIME */
312313

313314
tm->tm_mday = tm->tm_mon = tm->tm_year = -1; /* mandatory */

src/backend/utils/adt/numutils.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.2 1996/07/16 07:13:35 scrappy Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.3 1996/07/22 21:56:03 scrappy Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -132,7 +132,9 @@ ltoa(int32 l, char *a)
132132
int
133133
ftoa(double value, char *ascii, int width, int prec1, char format)
134134
{
135-
#if defined(PORTNAME_BSD44_derived) || defined(PORTNAME_bsdi) || defined(PORTNAME_bsdi_2_1)
135+
#if defined(PORTNAME_BSD44_derived) || \
136+
defined(PORTNAME_bsdi) || \
137+
defined(PORTNAME_bsdi_2_1)
136138
char out[256];
137139
char fmt[256];
138140
int ret;

src/backend/utils/adt/varlena.c

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.3 1996/07/19 07:14:14 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.4 1996/07/22 21:56:04 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -219,23 +219,35 @@ int textlen (text* t)
219219
* takes two text* and returns a text* that is the concatentation of
220220
* the two
221221
*/
222+
223+
/*
224+
* Rewrited by Sapa, sapa@hq.icb.chel.su. 8-Jul-96.
225+
*/
226+
222227
text*
223228
textcat(text* t1, text* t2)
224229
{
225230
int len1, len2, newlen;
231+
char *ptr;
226232
text* result;
227233

234+
/* Check for NULL strings... */
228235
if (t1 == NULL) return t2;
229236
if (t2 == NULL) return t1;
230237

231-
len1 = textlen (t1);
232-
len2 = textlen (t2);
233-
newlen = len1 + len2 + VARHDRSZ;
234-
result = (text*) palloc (newlen);
238+
/* Check for ZERO-LENGTH strings... */
239+
/* I use <= instead of == , I know - it's paranoia, but... */
240+
if((len1 = VARSIZE(t1) - VARHDRSZ) <= 0) return t2;
241+
if((len2 = VARSIZE(t2) - VARHDRSZ) <= 0) return t1;
242+
243+
result = (text *)palloc(newlen = len1 + len2 + VARHDRSZ);
244+
245+
/* Fill data field of result string... */
246+
memcpy(ptr = VARDATA(result), VARDATA(t1), len1);
247+
memcpy(ptr + len1, VARDATA(t2), len2);
235248

249+
/* Set size of result string... */
236250
VARSIZE(result) = newlen;
237-
memcpy (VARDATA(result), VARDATA(t1), len1);
238-
memcpy (VARDATA(result) + len1, VARDATA(t2), len2);
239251

240252
return result;
241253
}

src/backend/utils/error/elog.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.3 1996/07/19 06:13:58 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.4 1996/07/22 21:58:26 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -48,9 +48,11 @@ elog(int lev, char *fmt, ... )
4848
char buf[ELOG_MAXLEN], line[ELOG_MAXLEN];
4949
register char *bp, *cp;
5050
extern int errno, sys_nerr;
51-
#if !defined(PORTNAME_BSD44_derived) && !defined(PORTNAME_bsdi) && !defined(PORTNAME_bsdi_2_1)
51+
#if !defined(PORTNAME_BSD44_derived) && \
52+
!defined(PORTNAME_bsdi) && \
53+
!defined(PORTNAME_bsdi_2_1)
5254
extern char *sys_errlist[];
53-
#endif /* !PORTNAME_BSD44_derived */
55+
#endif /* bsd derived */
5456
#ifndef PG_STANDALONE
5557
extern FILE *Pfout;
5658
#endif /* !PG_STANDALONE */

src/backend/utils/error/exc.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/exc.c,v 1.2 1996/07/16 07:13:49 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/exc.c,v 1.3 1996/07/22 21:58:28 scrappy Exp $
1111
*
1212
* NOTE
1313
* XXX this code needs improvement--check for state violations and
@@ -90,9 +90,11 @@ ExcPrint(Exception *excP,
9090
{
9191
extern int errno;
9292
extern int sys_nerr;
93-
#if !defined(PORTNAME_BSD44_derived) && !defined(PORTNAME_bsdi) && !defined(PORTNAME_bsdi_2_1)
93+
#if !defined(PORTNAME_BSD44_derived) && \
94+
!defined(PORTNAME_bsdi) && \
95+
!defined(PORTNAME_bsdi_2_1)
9496
extern char *sys_errlist[];
95-
#endif /* !PORTNAME_BSD44_derived */
97+
#endif /* ! bsd_derived */
9698

9799
#ifdef lint
98100
data = data;

src/backend/utils/exc.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: exc.h,v 1.1.1.1 1996/07/09 06:22:01 scrappy Exp $
9+
* $Id: exc.h,v 1.2 1996/07/22 21:55:41 scrappy Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -23,10 +23,10 @@ extern Index ExcLineNumber;
2323
* ExcMessage and Exception are now defined in c.h
2424
*/
2525

26-
#if defined(PORTNAME_linux) \
27-
|| defined(PORTNAME_hpux) \
28-
|| defined(PORTNAME_next)\
29-
|| defined(WIN32)
26+
#if defined(PORTNAME_hpux) || \
27+
defined(PORTNAME_linux) || \
28+
defined(PORTNAME_next) || \
29+
defined(WIN32)
3030
typedef jmp_buf ExcContext;
3131
#else
3232
typedef sigjmp_buf ExcContext;

0 commit comments

Comments
 (0)