Finished merging in src/backend from Dr. George's source tree

This commit is contained in:
Marc G. Fournier 1996-07-23 02:23:54 +00:00
parent e11744e164
commit 7344d69898
9 changed files with 150 additions and 25 deletions

View File

@ -7,7 +7,7 @@
* Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.3 1996/07/16 07:12:27 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.4 1996/07/23 02:23:05 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -137,7 +137,7 @@ AttributeTupleForm attrtypes[MAXATTR]; /* points to attribute info */
static char *values[MAXATTR]; /* cooresponding attribute values */
int numattr; /* number of attributes for cur. rel */
#ifdef OPENLINK_PATCHES
extern int fsyncOff; /* do not fsync the database */
extern int fsyncOff; /* do not fsync the database */
#endif
#if defined(WIN32) || defined(PORTNAME_next)
@ -187,7 +187,9 @@ typedef void (*sig_func)();
* error handling / abort routines
* ----------------
*/
#if !defined(PORTNAME_bsdi) && !defined(PORTNAME_bsdi_2_1)
# if !defined(PORTNAME_BSD44_derived) && \
!defined(PORTNAME_bsdi) && \
!defined(PORTNAME_bsdi_2_1)
void err()
{
Warnings++;
@ -266,7 +268,7 @@ BootstrapMain(int argc, char *argv[])
Quiet = 0;
Noversion = 0;
dbName = NULL;
#ifdef OPENLINK_PATCHES
while ((flag = getopt(argc, argv, "dCOQP:F")) != EOF) {
#else
@ -279,6 +281,11 @@ BootstrapMain(int argc, char *argv[])
case 'C':
Noversion = 1;
break;
#ifdef OPENLINK_PATCHES
case 'F':
fsyncOff = 1;
break;
#endif
case 'O':
override = true;
break;
@ -288,12 +295,6 @@ BootstrapMain(int argc, char *argv[])
case 'P':/* specify port */
portFd = atoi(optarg);
break;
#ifdef OPENLINK_PATCHES
case 'F':
fsyncOff = 1;
break;
#endif
break;
default:
usage();
break;

View File

@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.1.1.1 1996/07/09 06:21:19 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.2 1996/07/23 02:23:15 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -650,6 +650,10 @@ GetIndexRelations(Oid main_relation_oid,
heap_endscan(scandesc);
heap_close(pg_index_rel);
/* We cannot trust to relhasindex of the main_relation now, so... */
if ( *n_indices == 0 )
return;
*index_rels = (Relation *) palloc(*n_indices * sizeof(Relation));
for (i = 0, scan = head; i < *n_indices; i++, scan = scan->next) {
@ -726,6 +730,67 @@ CopyReadAttribute(int attno, FILE *fp, bool *isnull, char *delim)
}
}else if (c == '\\') {
c = getc(fp);
#ifdef ESCAPE_PATCH
#define ISOCTAL(c) (((c) >= '0') && ((c) <= '7'))
#define VALUE(c) ((c) - '0')
if (feof(fp)) {
*isnull = (bool) false;
return(NULL);
}
switch (c) {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7': {
int val;
val = VALUE(c);
c = getc(fp);
if (ISOCTAL(c)) {
val = (val<<3) + VALUE(c);
c = getc(fp);
if (ISOCTAL(c)) {
val = (val<<3) + VALUE(c);
} else {
if (feof(fp)) {
*isnull = (bool) false;
return(NULL);
}
ungetc(c, fp);
}
} else {
if (feof(fp)) {
*isnull = (bool) false;
return(NULL);
}
ungetc(c, fp);
}
c = val & 0377;
}
break;
case 'b':
c = '\b';
break;
case 'f':
c = '\f';
break;
case 'n':
c = '\n';
break;
case 'r':
c = '\r';
break;
case 't':
c = '\t';
break;
case 'v':
c = '\v';
break;
}
#endif
}else if (inString(c,delim) || c == '\n') {
done = 1;
}
@ -743,6 +808,39 @@ CopyReadAttribute(int attno, FILE *fp, bool *isnull, char *delim)
}
}
#ifdef ESCAPE_PATCH
static void
CopyAttributeOut(FILE *fp, char *string, char *delim)
{
char c;
int is_array = false;
int len = strlen(string);
/* XXX - This is a kludge, we should check the data type */
if (len && (string[0] == '{') && (string[len-1] == '}')) {
is_array = true;
}
for ( ; c = *string; string++) {
if ((c == delim[0]) || (c == '\n')) {
fputc('\\', fp);
} else if ((c == '\\') && is_array) {
if (*(string+1) == '\\') {
/* translate \\ to \\\\ */
fputc('\\', fp);
fputc('\\', fp);
fputc('\\', fp);
string++;
} else if (*(string+1) == '"') {
/* translate \" to \\\" */
fputc('\\', fp);
fputc('\\', fp);
}
}
fputc(*string, fp);
}
}
#else
static void
CopyAttributeOut(FILE *fp, char *string, char *delim)
{
@ -756,6 +854,7 @@ CopyAttributeOut(FILE *fp, char *string, char *delim)
fputc(string[i], fp);
}
}
#endif
/*
* Returns the number of tuples in a relation. Unfortunately, currently

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.1.1.1 1996/07/09 06:21:31 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.2 1996/07/23 02:23:25 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -551,6 +551,7 @@ StreamServerPort(char *hostName, short portName, int *fdP)
{
struct sockaddr_in sin;
int fd;
int one = 1;
#ifdef WIN32
/* This is necessary to make it possible for a backend to use
@ -575,7 +576,17 @@ StreamServerPort(char *hostName, short portName, int *fdP)
pqdebug("%s", PQerrormsg);
return(STATUS_ERROR);
}
if((setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *)&one,
sizeof(one))) == -1) {
(void) sprintf(PQerrormsg,
"FATAL: StreamServerPort: setsockopt (SO_REUSEADDR) failed: errno=%d\n",
errno);
fputs(PQerrormsg, stderr);
pqdebug("%s", PQerrormsg);
return(STATUS_ERROR);
}
sin.sin_family = AF_INET;
sin.sin_port = htons(portName);

View File

@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/parser/Attic/Makefile.inc,v 1.1.1.1 1996/07/09 06:21:39 scrappy Exp $
# $Header: /cvsroot/pgsql/src/backend/parser/Attic/Makefile.inc,v 1.2 1996/07/23 02:23:32 scrappy Exp $
#
#-------------------------------------------------------------------------
@ -34,13 +34,13 @@ $(objdir)/scan.o: scan.c
SRCS_PARSER+= analyze.c catalog_utils.c dbcommands.c gram.c \
keywords.c parser.c parse_query.c scan.c scansup.c
keywords.c parser.c parse_query.c scan.c scansup.c sysfunc.c
CLEANFILES+= scan.c ${PARSEYACCS}
POSTGRES_DEPEND+= scan.c $(PARSEYACCS)
HEADERS+= catalog_utils.h io.h parse_query.h parsetree.h \
dbcommands.h keywords.h
dbcommands.h keywords.h sysfunc.c

View File

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.1.1.1 1996/07/09 06:21:40 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.2 1996/07/23 02:23:33 scrappy Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@ -515,7 +515,7 @@ fetch_how_many: Iconst
{ $$ = $1;
if ($1 <= 0) elog(WARN,"Please specify nonnegative count for fetch"); }
| ALL { $$ = 0; /* 0 means fetch all tuples*/}
| /*EMPTY*/ { $$ = 0; /*default*/ }
| /*EMPTY*/ { $$ = 1; /*default*/ }
;
/*****************************************************************************

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.1.1.1 1996/07/09 06:21:41 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.2 1996/07/23 02:23:34 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -29,6 +29,7 @@
#include "nodes/parsenodes.h"
#include "parser/keywords.h"
#include "parser/scansup.h"
#include "parser/sysfunc.h"
#include "parse.h"
#include "utils/elog.h"
#include "utils/palloc.h"
@ -61,6 +62,8 @@ digit [0-9]
letter [_A-Za-z]
letter_or_digit [_A-Za-z0-9]
sysfunc SYS_{letter}{letter_or_digit}*
identifier {letter}{letter_or_digit}*
self [,()\[\].;$\:\+\-\*\/\<\>\=\|]
@ -83,6 +86,11 @@ space [ \t\n\f]
other .
%%
{sysfunc} {
yylval.str = pstrdup(SystemFunctionHandler((char *)yytext));
return (SCONST);
}
{comment} { /* ignore */ }
"::" { return TYPECAST; }

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scansup.c,v 1.1.1.1 1996/07/09 06:21:41 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/scansup.c,v 1.2 1996/07/23 02:23:35 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -134,7 +134,11 @@ scanstr(char *s)
}
}
default:
elog (WARN, "Bad escape sequence, s[i] = %d", s[i]);
#ifdef ESCAPE_PATCH
newStr[j] = s[i];
#else
elog (WARN, "Bad escape sequence, s[i] = %d", s[i]);
#endif
} /* switch */
} /* s[i] == '\\' */
else

View File

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.2 1996/07/16 07:13:07 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.3 1996/07/23 02:23:47 scrappy Exp $
*
* NOTES
*
@ -49,7 +49,9 @@
#define MAXINT INT_MAX
#else
#include <netdb.h> /* for MAXHOSTNAMELEN on some */
# 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

View File

@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.1.1.1 1996/07/09 06:21:52 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.2 1996/07/23 02:23:54 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -319,7 +319,7 @@ nodeHandleRIRAttributeRule(Node **nodePtr,
if (name_to_look_for.data[0]) {
Node *n;
n = FindMatchingTLEntry(targetlist, &name_to_look_for);
n = FindMatchingTLEntry(targetlist, (char *)&name_to_look_for);
if (n == NULL) {
*nodePtr = make_null(((Var*) node)->vartype);
} else {