diff options
Diffstat (limited to 'src/backend/tcop')
-rw-r--r-- | src/backend/tcop/Makefile | 4 | ||||
-rw-r--r-- | src/backend/tcop/aclchk.c | 8 | ||||
-rw-r--r-- | src/backend/tcop/fastpath.c | 4 | ||||
-rw-r--r-- | src/backend/tcop/postgres.c | 28 | ||||
-rw-r--r-- | src/backend/tcop/pquery.c | 6 | ||||
-rw-r--r-- | src/backend/tcop/utility.c | 4 |
6 files changed, 33 insertions, 21 deletions
diff --git a/src/backend/tcop/Makefile b/src/backend/tcop/Makefile index bc31448ab0f..4dd7fbcb5f6 100644 --- a/src/backend/tcop/Makefile +++ b/src/backend/tcop/Makefile @@ -4,7 +4,7 @@ # Makefile for tcop # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/backend/tcop/Makefile,v 1.3 1996/11/03 06:52:27 scrappy Exp $ +# $Header: /cvsroot/pgsql/src/backend/tcop/Makefile,v 1.4 1996/11/08 05:59:20 momjian Exp $ # #------------------------------------------------------------------------- @@ -14,7 +14,7 @@ include ../../Makefile.global INCLUDE_OPT = -I../port/$(PORTNAME) \ -I../../include -CFLAGS+=$(INCLUDE_OPT) +CFLAGS+=$(INCLUDE_OPT) -Wno-error OBJS = aclchk.o dest.o fastpath.o postgres.o pquery.o utility.o diff --git a/src/backend/tcop/aclchk.c b/src/backend/tcop/aclchk.c index f8d43fad005..342d373a456 100644 --- a/src/backend/tcop/aclchk.c +++ b/src/backend/tcop/aclchk.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/Attic/aclchk.c,v 1.3 1996/11/03 06:52:29 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/Attic/aclchk.c,v 1.4 1996/11/08 05:59:23 momjian Exp $ * * NOTES * See acl.h. @@ -22,12 +22,14 @@ #include "access/htup.h" #include "access/tupmacs.h" #include "utils/builtins.h" +#include "utils/memutils.h" #include "utils/palloc.h" #include "catalog/indexing.h" #include "catalog/catalog.h" #include "catalog/catname.h" #include "catalog/pg_group.h" #include "catalog/pg_operator.h" +#include "catalog/pg_proc.h" #include "catalog/pg_user.h" #include "utils/syscache.h" #include "parser/catalog_utils.h" @@ -189,7 +191,7 @@ char* get_groname(AclId grosysid) { HeapTuple htp; - char *name; + char *name = NULL; htp = SearchSysCacheTuple(GROSYSID, PointerGetDatum(grosysid), 0,0,0); @@ -460,7 +462,7 @@ pg_ownercheck(char *usename, int cacheid) { HeapTuple htp; - AclId user_id, owner_id; + AclId user_id, owner_id = 0; htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename), 0,0,0); diff --git a/src/backend/tcop/fastpath.c b/src/backend/tcop/fastpath.c index 273caa49421..611adb3a19f 100644 --- a/src/backend/tcop/fastpath.c +++ b/src/backend/tcop/fastpath.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/fastpath.c,v 1.2 1996/11/03 06:52:32 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/fastpath.c,v 1.3 1996/11/08 05:59:26 momjian Exp $ * * NOTES * This cruft is the server side of PQfn. @@ -57,6 +57,8 @@ * *------------------------------------------------------------------------- */ +#include <string.h> + #include "postgres.h" #include "tcop/tcopdebug.h" diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index c5e1ef8ec8f..8d30dcc3caf 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.14 1996/11/04 04:53:31 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.15 1996/11/08 05:59:31 momjian Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -16,16 +16,21 @@ *------------------------------------------------------------------------- */ #include "libpq/pqsignal.h" /* substitute for <signal.h> */ + #if defined(linux) #ifndef __USE_POSIX #define __USE_POSIX #endif #endif /* defined(linux) */ -#include <setjmp.h> + +#include <unistd.h> #include <stdio.h> #include <string.h> #include <time.h> +#include <setjmp.h> #include <sys/time.h> +#include <sys/types.h> +#include <fcntl.h> #include <sys/param.h> /* for MAXHOSTNAMELEN on most */ #ifndef MAXHOSTNAMELEN #include <netdb.h> /* for MAXHOSTNAMELEN on some */ @@ -279,7 +284,7 @@ static char SocketBackend(char *inBuf, int multiplexedBackend) { char qtype[2]; - char result; + char result = '\0'; /* ---------------- * get input from the frontend @@ -782,7 +787,7 @@ PostgresMain(int argc, char *argv[]) int flagE; int flag; - char *DBName; + char *DBName = NULL; int errs = 0; char firstchar; @@ -793,11 +798,11 @@ PostgresMain(int argc, char *argv[]) char* hostName; /* the host name of the backend server */ char hostbuf[MAXHOSTNAMELEN]; int serverSock; - int serverPortnum; + int serverPortnum = 0; int nSelected; /* number of descriptors ready from select(); */ - int maxFd; /* max file descriptor + 1 */ + int maxFd = 0; /* max file descriptor + 1 */ fd_set rmask, basemask; - FrontEnd *newFE, *currentFE; + FrontEnd *newFE, *currentFE = NULL; int numFE = 0; /* keep track of number of active frontends */ Port *newPort; int newFd; @@ -1157,7 +1162,8 @@ PostgresMain(int argc, char *argv[]) #endif /* WIN32 */ if (multiplexedBackend) { - if (StreamServerPort(hostName, serverPortnum, &serverSock) != STATUS_OK) + if (serverPortnum == 0 || + StreamServerPort(hostName, serverPortnum, &serverSock) != STATUS_OK) { fprintf(stderr, "Postgres: cannot create stream port %d\n", serverPortnum); exit(1); @@ -1250,7 +1256,7 @@ PostgresMain(int argc, char *argv[]) */ if (IsUnderPostmaster == false) { puts("\nPOSTGRES backend interactive interface"); - puts("$Revision: 1.14 $ $Date: 1996/11/04 04:53:31 $"); + puts("$Revision: 1.15 $ $Date: 1996/11/08 05:59:31 $"); } /* ---------------- @@ -1503,7 +1509,7 @@ ShowUsage() fprintf(StatFp, "! system usage stats:\n"); fprintf(StatFp, - "!\t%d.%06d elapsed %d.%06d user %d.%06d system sec\n", + "!\t%ld.%06ld elapsed %ld.%06ld user %ld.%06ld system sec\n", elapse_t.tv_sec - Save_t.tv_sec, elapse_t.tv_usec - Save_t.tv_usec, r.ru_utime.tv_sec - Save_r.ru_utime.tv_sec, @@ -1511,7 +1517,7 @@ ShowUsage() r.ru_stime.tv_sec - Save_r.ru_stime.tv_sec, r.ru_stime.tv_usec - Save_r.ru_stime.tv_usec); fprintf(StatFp, - "!\t[%d.%06d user %d.%06d sys total]\n", + "!\t[%ld.%06ld user %ld.%06ld sys total]\n", user.tv_sec, user.tv_usec, sys.tv_sec, sys.tv_usec); #ifndef NEED_RUSAGE fprintf(StatFp, diff --git a/src/backend/tcop/pquery.c b/src/backend/tcop/pquery.c index 3cd3197e1e8..e36ef730fe7 100644 --- a/src/backend/tcop/pquery.c +++ b/src/backend/tcop/pquery.c @@ -7,10 +7,12 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.3 1996/11/03 06:52:35 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.4 1996/11/08 05:59:34 momjian Exp $ * *------------------------------------------------------------------------- */ +#include <string.h> + #include "postgres.h" #include "tcop/tcopdebug.h" @@ -209,7 +211,7 @@ ProcessQueryDesc(QueryDesc *queryDesc) bool isRetrieveIntoPortal; bool isRetrieveIntoRelation; - char* intoName; + char* intoName = NULL; CommandDest dest; /* ---------------- diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 8dd10bb59ba..13bf1a506a6 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.5 1996/11/03 06:52:36 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.6 1996/11/08 05:59:35 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -34,7 +34,7 @@ #include "commands/explain.h" #include "nodes/parsenodes.h" -#include "parse.h" +#include "../backend/parser/parse.h" #include "utils/builtins.h" #include "utils/acl.h" #include "utils/palloc.h" |