summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/bootstrap/Makefile4
-rw-r--r--src/backend/commands/define.c5
-rw-r--r--src/backend/executor/execJunk.c4
-rw-r--r--src/backend/executor/execTuples.c4
-rw-r--r--src/backend/executor/nodeGroup.c3
-rw-r--r--src/backend/executor/nodeNestloop.c3
-rw-r--r--src/backend/executor/nodeSeqscan.c4
-rw-r--r--src/backend/executor/nodeSort.c5
-rw-r--r--src/backend/executor/nodeUnique.c8
-rw-r--r--src/backend/libpq/pqcomm.c6
-rw-r--r--src/backend/main/main.c4
-rw-r--r--src/backend/nodes/copyfuncs.c6
-rw-r--r--src/backend/nodes/equalfuncs.c4
-rw-r--r--src/backend/nodes/outfuncs.c4
-rw-r--r--src/backend/nodes/read.c6
-rw-r--r--src/backend/nodes/readfuncs.c10
-rw-r--r--src/backend/optimizer/path/allpaths.c4
-rw-r--r--src/backend/optimizer/path/indxpath.c4
-rw-r--r--src/backend/optimizer/path/prune.c4
-rw-r--r--src/backend/optimizer/plan/createplan.c8
-rw-r--r--src/backend/parser/Makefile4
-rw-r--r--src/backend/parser/analyze.c23
-rw-r--r--src/backend/parser/catalog_utils.c4
-rw-r--r--src/backend/parser/dbcommands.c4
-rw-r--r--src/backend/parser/parser.c14
-rw-r--r--src/backend/parser/sysfunc.c4
-rw-r--r--src/backend/port/bsdi/port-protos.h5
-rw-r--r--src/backend/postmaster/postmaster.c24
-rw-r--r--src/backend/regex/regcomp.c9
-rw-r--r--src/backend/regex/regerror.c1
-rw-r--r--src/backend/regex/regexec.c1
-rw-r--r--src/backend/rewrite/rewriteSupport.c4
-rw-r--r--src/backend/storage/buffer/buf_init.c3
-rw-r--r--src/backend/storage/buffer/bufmgr.c4
-rw-r--r--src/backend/storage/buffer/localbuf.c4
-rw-r--r--src/backend/storage/file/fd.c7
-rw-r--r--src/backend/storage/ipc/ipc.c3
-rw-r--r--src/backend/storage/ipc/ipci.c11
-rw-r--r--src/backend/storage/ipc/shmem.c4
-rw-r--r--src/backend/storage/large_object/inv_api.c7
-rw-r--r--src/backend/storage/lmgr/lmgr.c3
-rw-r--r--src/backend/storage/lmgr/lock.c6
-rw-r--r--src/backend/storage/lmgr/proc.c8
-rw-r--r--src/backend/storage/page/bufpage.c3
-rw-r--r--src/backend/storage/smgr/md.c5
-rw-r--r--src/backend/storage/smgr/mm.c3
-rw-r--r--src/backend/storage/smgr/smgr.c6
-rw-r--r--src/backend/tcop/Makefile4
-rw-r--r--src/backend/tcop/aclchk.c8
-rw-r--r--src/backend/tcop/fastpath.c4
-rw-r--r--src/backend/tcop/postgres.c28
-rw-r--r--src/backend/tcop/pquery.c6
-rw-r--r--src/backend/tcop/utility.c4
-rw-r--r--src/backend/utils/adt/arrayfuncs.c32
-rw-r--r--src/backend/utils/adt/chunk.c30
-rw-r--r--src/backend/utils/adt/datum.c4
-rw-r--r--src/backend/utils/adt/filename.c4
-rw-r--r--src/backend/utils/adt/nabstime.c7
-rw-r--r--src/backend/utils/adt/regproc.c4
-rw-r--r--src/backend/utils/adt/sets.c4
-rw-r--r--src/backend/utils/adt/varlena.c4
-rw-r--r--src/backend/utils/cache/catcache.c4
-rw-r--r--src/backend/utils/cache/inval.c4
-rw-r--r--src/backend/utils/error/elog.c9
-rw-r--r--src/backend/utils/fmgr/fmgr.c4
-rw-r--r--src/backend/utils/hash/dynahash.c12
-rw-r--r--src/backend/utils/init/postinit.c4
-rw-r--r--src/backend/utils/mmgr/aset.c4
-rw-r--r--src/backend/utils/mmgr/mcxt.c8
-rw-r--r--src/backend/utils/mmgr/portalmem.c8
-rw-r--r--src/bin/pg_dump/pg_dump.c5
-rw-r--r--src/bin/pg_id/pg_id.c6
-rw-r--r--src/bin/pg_version/pg_version.c3
-rw-r--r--src/bin/psql/Makefile8
-rw-r--r--src/bin/psql/psql.c6
-rw-r--r--src/include/bootstrap/bootstrap.h8
-rw-r--r--src/include/commands/async.h3
-rw-r--r--src/include/config.h3
-rw-r--r--src/include/rewrite/locks.h5
-rw-r--r--src/include/storage/fd.h3
-rw-r--r--src/include/storage/lmgr.h5
-rw-r--r--src/include/storage/smgr.h5
-rw-r--r--src/interfaces/libpq/Makefile29
-rw-r--r--src/interfaces/libpq/fe-lobj.c3
-rw-r--r--src/interfaces/libpq/pqsignal.c4
85 files changed, 342 insertions, 228 deletions
diff --git a/src/backend/bootstrap/Makefile b/src/backend/bootstrap/Makefile
index 66ed86f3c5..b5dd5c5530 100644
--- a/src/backend/bootstrap/Makefile
+++ b/src/backend/bootstrap/Makefile
@@ -4,7 +4,7 @@
# Makefile for the bootstrap module
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.1 1996/10/27 09:46:59 bryanh Exp $
+# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.2 1996/11/08 05:55:46 momjian Exp $
#
#
# We must build bootparse.c and bootscanner.c with yacc and lex and sed,
@@ -26,7 +26,7 @@ INCLUDE_OPT = -I.. \
-I../include \
-I../../include
-CFLAGS += $(INCLUDE_OPT)
+CFLAGS += $(INCLUDE_OPT) -Wno-error
BOOTYACCS = bootstrap_tokens.h bootparse.c
diff --git a/src/backend/commands/define.c b/src/backend/commands/define.c
index 89ac127420..fe696b8efd 100644
--- a/src/backend/commands/define.c
+++ b/src/backend/commands/define.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.6 1996/11/06 08:21:34 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.7 1996/11/08 05:55:49 momjian Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
@@ -136,8 +136,9 @@ compute_full_attributes(const List *parameters, int32 *byte_pct_p,
*/
*byte_pct_p = atoi(param->val);
} else if (strcasecmp(param->name, "perbyte_cpu") == 0) {
+ count = 0;
if (sscanf(param->val, "%d", perbyte_cpu_p) == 0) {
- for (count = 0, ptr = param->val; *ptr != '\0'; ptr++)
+ for (ptr = param->val; *ptr != '\0'; ptr++)
if (*ptr == '!') count++;
}
*perbyte_cpu_p = (int) pow(10.0, (double) count);
diff --git a/src/backend/executor/execJunk.c b/src/backend/executor/execJunk.c
index dc1fc131b3..79e0e0278f 100644
--- a/src/backend/executor/execJunk.c
+++ b/src/backend/executor/execJunk.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.2 1996/10/31 10:11:23 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.3 1996/11/08 05:55:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -15,6 +15,8 @@
#include "postgres.h"
#include "utils/palloc.h"
+#include "access/heaptuple.h"
+#include "access/heapam.h"
#include "executor/executor.h"
#include "nodes/relation.h"
#include "optimizer/tlist.h" /* for MakeTLE */
diff --git a/src/backend/executor/execTuples.c b/src/backend/executor/execTuples.c
index 32188ceb47..d60c7c4b17 100644
--- a/src/backend/executor/execTuples.c
+++ b/src/backend/executor/execTuples.c
@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.2 1996/10/31 10:11:38 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.3 1996/11/08 05:56:01 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -116,6 +116,8 @@
* and the TupleTableSlot node in execnodes.h.
*
*/
+#include <string.h>
+
#include "postgres.h"
diff --git a/src/backend/executor/nodeGroup.c b/src/backend/executor/nodeGroup.c
index c6589e3567..7457794156 100644
--- a/src/backend/executor/nodeGroup.c
+++ b/src/backend/executor/nodeGroup.c
@@ -13,7 +13,7 @@
* columns. (ie. tuples from the same group are consecutive)
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.2 1996/10/31 10:11:59 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.3 1996/11/08 05:56:08 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -21,6 +21,7 @@
#include "access/heapam.h"
#include "catalog/catalog.h"
+#include "access/printtup.h"
#include "executor/executor.h"
#include "executor/nodeGroup.h"
diff --git a/src/backend/executor/nodeNestloop.c b/src/backend/executor/nodeNestloop.c
index e7efabb2c3..d83d306bba 100644
--- a/src/backend/executor/nodeNestloop.c
+++ b/src/backend/executor/nodeNestloop.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeNestloop.c,v 1.2 1996/10/31 10:12:14 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeNestloop.c,v 1.3 1996/11/08 05:56:15 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -20,6 +20,7 @@
#include "postgres.h"
#include "executor/executor.h"
+#include "executor/execdebug.h"
#include "executor/nodeNestloop.h"
#include "executor/nodeIndexscan.h"
diff --git a/src/backend/executor/nodeSeqscan.c b/src/backend/executor/nodeSeqscan.c
index 1a1c19a7f2..68cb6345a2 100644
--- a/src/backend/executor/nodeSeqscan.c
+++ b/src/backend/executor/nodeSeqscan.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeSeqscan.c,v 1.2 1996/10/31 10:12:20 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeSeqscan.c,v 1.3 1996/11/08 05:56:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -25,7 +25,9 @@
#include "postgres.h"
#include "executor/executor.h"
+#include "executor/execdebug.h"
#include "executor/nodeSeqscan.h"
+#include "access/heapam.h"
#include "parser/parsetree.h"
/* ----------------------------------------------------------------
diff --git a/src/backend/executor/nodeSort.c b/src/backend/executor/nodeSort.c
index b6b66ce75f..83d78073bb 100644
--- a/src/backend/executor/nodeSort.c
+++ b/src/backend/executor/nodeSort.c
@@ -7,17 +7,20 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeSort.c,v 1.3 1996/10/31 10:12:22 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeSort.c,v 1.4 1996/11/08 05:56:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "executor/executor.h"
+#include "executor/execdebug.h"
#include "executor/nodeSort.h"
+#include "access/heapam.h"
#include "utils/palloc.h"
#include "utils/psort.h"
#include "catalog/catalog.h"
+#include "catalog/heap.h"
#include "storage/bufmgr.h"
#include "optimizer/internal.h" /* for _TEMP_RELATION_ID_ */
diff --git a/src/backend/executor/nodeUnique.c b/src/backend/executor/nodeUnique.c
index 1a68f86097..18e25a443f 100644
--- a/src/backend/executor/nodeUnique.c
+++ b/src/backend/executor/nodeUnique.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.3 1996/10/31 10:12:26 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.4 1996/11/08 05:56:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -27,6 +27,8 @@
#include "executor/executor.h"
#include "executor/nodeUnique.h"
#include "optimizer/clauses.h"
+#include "access/heapam.h"
+#include "access/heaptuple.h"
#include "access/printtup.h" /* for typtoout() */
#include "utils/builtins.h" /* for namecpy()*/
@@ -128,6 +130,10 @@ ExecUnique(Unique *node)
tupDesc = ExecGetResultType(uniquestate);
typoutput = typtoout((Oid)tupDesc->attrs[uniqueAttrNum-1]->atttypid);
}
+ else { /* keep compiler quiet */
+ tupDesc = NULL;
+ typoutput = 0;
+ }
/* ----------------
* now loop, returning only non-duplicate tuples.
diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c
index ada4d4a30a..76707512c5 100644
--- a/src/backend/libpq/pqcomm.c
+++ b/src/backend/libpq/pqcomm.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.5 1996/11/06 08:48:30 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.6 1996/11/08 05:56:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -181,7 +181,7 @@ pq_flush()
int
pq_getstr(char *s, int maxlen)
{
- int c;
+ int c = '\0';
if (Pfin == (FILE *) NULL) {
/* elog(DEBUG, "Input descriptor is null"); */
@@ -266,7 +266,7 @@ PQputline(char *s)
int
pq_getnchar(char *s, int off, int maxlen)
{
- int c;
+ int c = '\0';
if (Pfin == (FILE *) NULL) {
/* elog(DEBUG, "Input descriptor is null"); */
diff --git a/src/backend/main/main.c b/src/backend/main/main.c
index 0c8dbc478d..4d2710b827 100644
--- a/src/backend/main/main.c
+++ b/src/backend/main/main.c
@@ -7,12 +7,12 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.1.1.1 1996/07/09 06:21:32 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.2 1996/11/08 05:56:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include <string.h>
-#include "c.h"
+#include "postgres.h"
#include "miscadmin.h"
#include "bootstrap/bootstrap.h" /* for BootstrapMain() */
#include "tcop/tcopprot.h" /* for PostgresMain() */
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index 4f49138edf..e61a13eab0 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.2 1996/08/19 13:32:14 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.3 1996/11/08 05:56:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -39,7 +39,7 @@ List *
listCopy(List *list)
{
List *newlist=NIL;
- List *l, *nl;
+ List *l, *nl=NIL;
foreach(l, list) {
if (newlist==NIL) {
@@ -1653,7 +1653,7 @@ copyObject(void *from)
case T_List:
{
List *list=from, *l;
- List *newlist = NIL, *nl;
+ List *newlist = NIL, *nl=NIL;
foreach(l, list) {
if (newlist==NIL) {
newlist = nl = lcons(copyObject(lfirst(l)),NIL);
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c
index 54cafe47dc..57226d5302 100644
--- a/src/backend/nodes/equalfuncs.c
+++ b/src/backend/nodes/equalfuncs.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.2 1996/08/26 06:30:51 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.3 1996/11/08 05:56:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -570,7 +570,7 @@ _equalValue(Value *a, Value *b)
bool
equal(void *a, void *b)
{
- bool retval;
+ bool retval=false;
if (a == b)
return(true);
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
index 5281d52691..aa9f3fdbab 100644
--- a/src/backend/nodes/outfuncs.c
+++ b/src/backend/nodes/outfuncs.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.1.1.1 1996/07/09 06:21:33 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.2 1996/11/08 05:56:43 momjian Exp $
*
* NOTES
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -548,7 +548,7 @@ static void
_outExpr(StringInfo str, Expr *node)
{
char buf[500];
- char *opstr;
+ char *opstr = NULL;
sprintf(buf, "EXPR");
appendStringInfo(str,buf);
diff --git a/src/backend/nodes/read.c b/src/backend/nodes/read.c
index dbcc59a6f9..d2fa81cac3 100644
--- a/src/backend/nodes/read.c
+++ b/src/backend/nodes/read.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/read.c,v 1.1.1.1 1996/07/09 06:21:33 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/read.c,v 1.2 1996/11/08 05:56:48 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -64,7 +64,7 @@ stringToNode(char *str)
static NodeTag
nodeTokenType(char *token, int length)
{
- NodeTag retval;
+ NodeTag retval = 0;
/*
* Check if the token is a number (decimal or integer,
@@ -168,7 +168,7 @@ nodeRead(bool read_car_only)
{
char *token;
NodeTag type;
- Node *this_value, *return_value;
+ Node *this_value = NULL, *return_value = NULL;
int tok_len;
char tmp;
bool make_dotted_pair_cell = false;
diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c
index f0d9e3b1af..692e14a84a 100644
--- a/src/backend/nodes/readfuncs.c
+++ b/src/backend/nodes/readfuncs.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.2 1996/07/31 02:18:48 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.3 1996/11/08 05:56:49 momjian Exp $
*
* NOTES
* Most of the read functions for plan nodes are tested. (In fact, they
@@ -1047,7 +1047,7 @@ _readEState()
token = lsptok(NULL, &length); /* get @ */
token = lsptok(NULL, &length); /* now read it */
- sscanf(token, "%x", &local_node->es_result_relation_info);
+ sscanf(token, "%x",(unsigned int *)&local_node->es_result_relation_info);
return(local_node);
}
@@ -1117,13 +1117,13 @@ _readRel()
token = lsptok(NULL, &length); /* get @ */
token = lsptok(NULL, &length); /* now read it */
- sscanf(token, "%x", &local_node->unorderedpath);
+ sscanf(token, "%x", (unsigned int *)&local_node->unorderedpath);
token = lsptok(NULL, &length); /* get :cheapestpath */
token = lsptok(NULL, &length); /* get @ */
token = lsptok(NULL, &length); /* now read it */
- sscanf(token, "%x", &local_node->cheapestpath);
+ sscanf(token, "%x", (unsigned int *)&local_node->cheapestpath);
token = lsptok(NULL, &length); /* get :clauseinfo */
@@ -1792,7 +1792,7 @@ parsePlanString()
{
char *token;
int length;
- void *return_value;
+ void *return_value = NULL;
token = lsptok(NULL, &length);
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c
index d984765b4d..9b0bca2a05 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.2 1996/11/06 09:29:03 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.3 1996/11/08 05:56:52 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -255,7 +255,7 @@ print_path(Query *root, Path *path, int indent)
{
char *ptype = NULL;
JoinPath *jp;
- bool join;
+ bool join = false;
int i;
for(i=0; i < indent; i++)
diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c
index 57d26dc235..41cbdf985d 100644
--- a/src/backend/optimizer/path/indxpath.c
+++ b/src/backend/optimizer/path/indxpath.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.3 1996/09/10 06:48:12 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.4 1996/11/08 05:56:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -981,6 +981,7 @@ indexable_joinclauses(Rel *rel, Rel *index, List *joininfo_list)
* the list of clause info contains join clauses and restriction clauses.
* This routine returns the restriction clauses only.
*/
+#ifdef NOT_USED
static List *
extract_restrict_clauses(List *clausegroup)
{
@@ -996,6 +997,7 @@ extract_restrict_clauses(List *clausegroup)
}
return restrict_cls;
}
+#endif
/*
* index-innerjoin--
diff --git a/src/backend/optimizer/path/prune.c b/src/backend/optimizer/path/prune.c
index 70f9b209e0..6f8a28c958 100644
--- a/src/backend/optimizer/path/prune.c
+++ b/src/backend/optimizer/path/prune.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.1.1.1 1996/07/09 06:21:36 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.2 1996/11/08 05:57:01 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -95,7 +95,7 @@ prune_rel_paths(List *rel_list)
{
List *x = NIL;
List *y = NIL;
- Path *path;
+ Path *path = NULL;
Rel *rel = (Rel*)NULL;
JoinPath *cheapest = (JoinPath*)NULL;
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c
index 762cdf984b..2c576a9647 100644
--- a/src/backend/optimizer/plan/createplan.c
+++ b/src/backend/optimizer/plan/createplan.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.5 1996/11/06 09:29:10 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.6 1996/11/08 05:57:08 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -156,7 +156,7 @@ static Scan *
create_scan_node(Path *best_path, List *tlist)
{
- Scan *node;
+ Scan *node = NULL ;
List *scan_clauses;
/*
@@ -208,7 +208,7 @@ create_join_node(JoinPath *best_path, List *tlist)
Plan *inner_node;
List *inner_tlist;
List *clauses;
- Join *retval;
+ Join *retval = NULL;
outer_node = create_plan((Path*)best_path->outerjoinpath);
outer_tlist = outer_node->targetlist;
@@ -803,7 +803,7 @@ make_temp(List *tlist,
int temptype)
{
List *temp_tlist;
- Temp *retval;
+ Temp *retval = NULL;
/* Create a new target list for the temporary, with keys set. */
temp_tlist = set_temp_tlist_operators(new_unsorted_tlist(tlist),
diff --git a/src/backend/parser/Makefile b/src/backend/parser/Makefile
index 69705bb4ac..452c11932c 100644
--- a/src/backend/parser/Makefile
+++ b/src/backend/parser/Makefile
@@ -4,7 +4,7 @@
# Makefile for parser
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.1 1996/10/27 09:49:05 bryanh Exp $
+# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.2 1996/11/08 05:57:18 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -16,7 +16,7 @@ INCLUDE_OPT = -I.. \
-I../include \
-I../../include
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS+=$(INCLUDE_OPT) -Wno-error
OBJS = analyze.o catalog_utils.o dbcommands.o gram.o \
keywords.o parser.o parse_query.o scan.o scansup.o sysfunc.o
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index 95b1a81da1..ead5d0a79a 100644
--- a/src/backend/parser/analyze.c
+++ b/src/backend/parser/analyze.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.12 1996/11/06 06:48:20 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.13 1996/11/08 05:57:25 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -274,7 +274,6 @@ static Query *
transformInsertStmt(ParseState *pstate, AppendStmt *stmt)
{
Query *qry = makeNode(Query); /* make a new query tree */
- List *targetlist;
qry->commandType = CMD_INSERT;
pstate->p_is_insert = true;
@@ -531,7 +530,7 @@ transformCursorStmt(ParseState *pstate, CursorStmt *stmt)
static Node *
transformExpr(ParseState *pstate, Node *expr)
{
- Node *result;
+ Node *result = NULL;
if (expr==NULL)
return NULL;
@@ -809,7 +808,7 @@ makeRangeTable(ParseState *pstate, char *relname, List *frmList)
Oid
exprType(Node *expr)
{
- Oid type;
+ Oid type = (Oid)0;
switch(nodeTag(expr)) {
case T_Func:
@@ -1426,7 +1425,7 @@ static Resdom *
find_tl_elt(ParseState *pstate, char *refname, char *colname, List *tlist)
{
List *i;
- int real_rtable_pos;
+ int real_rtable_pos = 0;
if(refname)
real_rtable_pos = refnameRangeTablePosn(pstate->p_rtable, refname);
@@ -1471,7 +1470,7 @@ any_ordering_op(int restype)
static List *
transformGroupClause(ParseState *pstate, List *grouplist)
{
- List *glist = NIL, *gl;
+ List *glist = NIL, *gl = NIL;
while (grouplist != NIL) {
GroupClause *grpcl = makeNode(GroupClause);
@@ -1505,7 +1504,7 @@ transformSortClause(ParseState *pstate,
char* uniqueFlag)
{
List *sortlist = NIL;
- List *s, *i;
+ List *s = NIL, *i;
while(orderlist != NIL) {
SortBy *sortby = lfirst(orderlist);
@@ -1555,7 +1554,7 @@ transformSortClause(ParseState *pstate,
}
}
else {
- TargetEntry *tlelt;
+ TargetEntry *tlelt = NULL;
char* uniqueAttrName = uniqueFlag;
/* only create sort clause with the specified unique attribute */
@@ -1873,12 +1872,12 @@ static Node *
ParseFunc(ParseState *pstate, char *funcname, List *fargs, int *curr_resno)
{
Oid rettype = (Oid)0;
- Oid argrelid;
+ Oid argrelid = (Oid)0;
Oid funcid = (Oid)0;
List *i = NIL;
Node *first_arg= NULL;
- char *relname;
- char *refname;
+ char *relname = NULL;
+ char *refname = NULL;
Relation rd;
Oid relid;
int nargs;
@@ -1889,7 +1888,7 @@ ParseFunc(ParseState *pstate, char *funcname, List *fargs, int *curr_resno)
bool retset;
bool exists;
bool attisset = false;
- Oid toid;
+ Oid toid = (Oid)0;
Expr *expr;
if (fargs) {
diff --git a/src/backend/parser/catalog_utils.c b/src/backend/parser/catalog_utils.c
index d26cf1c134..00745e32c4 100644
--- a/src/backend/parser/catalog_utils.c
+++ b/src/backend/parser/catalog_utils.c
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.7 1996/11/06 06:48:23 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.8 1996/11/08 05:57:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1423,7 +1423,7 @@ FindDelimiter(char *typename)
void
op_error(char *op, int arg1, int arg2)
{
- Type tp1, tp2;
+ Type tp1 = NULL, tp2 = NULL;
if (check_typeid(arg1)) {
tp1 = get_id_type(arg1);
diff --git a/src/backend/parser/dbcommands.c b/src/backend/parser/dbcommands.c
index 07543fb8dc..029491c293 100644
--- a/src/backend/parser/dbcommands.c
+++ b/src/backend/parser/dbcommands.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/Attic/dbcommands.c,v 1.1.1.1 1996/07/09 06:21:40 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/dbcommands.c,v 1.2 1996/11/08 05:57:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -153,7 +153,7 @@ check_permissions(char *command,
{
Relation dbrel;
HeapTuple dbtup, utup;
- Oid dbowner;
+ Oid dbowner = (Oid)0;
char use_createdb;
bool dbfound;
bool use_super;
diff --git a/src/backend/parser/parser.c b/src/backend/parser/parser.c
index 344fe3b448..3d1a5542d6 100644
--- a/src/backend/parser/parser.c
+++ b/src/backend/parser/parser.c
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.5 1996/11/06 06:48:26 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.6 1996/11/08 05:57:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -37,12 +37,18 @@
#include "nodes/makefuncs.h"
#include "optimizer/clauses.h"
+void init_io(); /* from scan.l */
+void parser_init(Oid *typev, int nargs); /* from gram.y */
+int yyparse(); /* from gram.c */
+
char *parseString; /* the char* which holds the string to be parsed */
char *parseCh; /* a pointer used during parsing to walk down ParseString*/
List *parsetree = NIL;
+#ifdef SETS_FIXED
static void fixupsets();
+#endif
static void define_sets();
/*
* parser-- returns a list of parse trees
@@ -99,6 +105,7 @@ parser(char *str, Oid *typev, int nargs)
return queryList;
}
+#ifdef SETS_FIXED
static void
fixupsets(Query *parse)
{
@@ -110,6 +117,7 @@ fixupsets(Query *parse)
return;
define_sets(parse);
}
+#endif
/* Recursively find all of the Consts in the parsetree. Some of
* these may represent a set. The value of the Const will be the
@@ -180,7 +188,7 @@ parser_typecast(Value *expr, TypeName *typename, int typlen)
char type_string[16];
int32 len;
char *cp = NULL;
- char *const_string;
+ char *const_string = NULL;
bool string_palloced = false;
switch(nodeTag(expr)) {
@@ -297,7 +305,7 @@ parser_typecast2(Node *expr, int exprType, Type tp, int typlen)
int32 len = tlen(tp);
char *cp = NULL;
- char *const_string;
+ char *const_string = NULL;
bool string_palloced = false;
Assert(IsA(expr,Const));
diff --git a/src/backend/parser/sysfunc.c b/src/backend/parser/sysfunc.c
index 7d58582ff8..da00e7ef60 100644
--- a/src/backend/parser/sysfunc.c
+++ b/src/backend/parser/sysfunc.c
@@ -33,10 +33,10 @@ char *Sysfunc_system_date(void)
time(&cur_time_secs);
cur_time_expanded = localtime(&cur_time_secs);
#if defined(EUROPEAN_DATES)
- sprintf(buf, "%02.2d-%02.2d-%04.4d", cur_time_expanded->tm_mday,
+ sprintf(buf, "%2.2d-%2.2d-%4.4d", cur_time_expanded->tm_mday,
cur_time_expanded->tm_mon+1, cur_time_expanded->tm_year+1900);
#else
- sprintf(buf, "%02.2d-%02.2d-%04.4d", cur_time_expanded->tm_mon+1,
+ sprintf(buf, "%2.2d-%2.2d-%4.4d", cur_time_expanded->tm_mon+1,
cur_time_expanded->tm_mday, cur_time_expanded->tm_year+1900);
#endif
return &buf[0];
diff --git a/src/backend/port/bsdi/port-protos.h b/src/backend/port/bsdi/port-protos.h
index 072ad8ddf6..0f65780bdc 100644
--- a/src/backend/port/bsdi/port-protos.h
+++ b/src/backend/port/bsdi/port-protos.h
@@ -18,7 +18,12 @@
/* dynloader.c */
+#define SAVE_MAXPATHLEN MAXPATHLEN
+#undef MAXPATHLEN /* prevent compiler warning */
#include <sys/param.h>
+#undef MAXPATHLEN
+#define MAXPATHLEN SAVE_MAXPATHLEN
+#undef SAVE_MAXPATHLEN
#if _BSDI_VERSION >= 199510
# include <dlfcn.h>
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 0f810b879e..b845a9ac95 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.20 1996/11/03 04:48:26 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.21 1996/11/08 05:57:41 momjian Exp $
*
* NOTES
*
@@ -32,10 +32,16 @@
*
*-------------------------------------------------------------------------
*/
+ /* moved here to prevent double define */
+#include <sys/param.h> /* for MAXHOSTNAMELEN on most */
+#ifndef MAXHOSTNAMELEN
+#include <netdb.h> /* for MAXHOSTNAMELEN on some */
+#endif
+
#include "postgres.h"
+#include <signal.h> /* for other stuff */
#include "libpq/pqsignal.h" /* substitute for <signal.h> */
-
#include <string.h>
#include <stdlib.h>
@@ -47,10 +53,6 @@
#include <sys/types.h> /* for fd_set stuff */
#include <sys/stat.h> /* for umask */
#include <sys/time.h>
-#include <sys/param.h> /* for MAXHOSTNAMELEN on most */
-#ifndef MAXHOSTNAMELEN
-#include <netdb.h> /* for MAXHOSTNAMELEN on some */
-#endif
#include <sys/socket.h>
#if defined(USE_LIMITS_H)
# include <machine/limits.h>
@@ -1098,8 +1100,8 @@ DoExec(StartupInfo *packet, int portFd)
av[ac] = (char *) NULL;
if (DebugLvl > 1) {
- fprintf(stderr, "%s child[%d]: execv(",
- progname, getpid());
+ fprintf(stderr, "%s child[%ld]: execv(",
+ progname, (long)getpid());
for (i = 0; i < ac; ++i)
fprintf(stderr, "%s, ", av[i]);
fprintf(stderr, ")\n");
@@ -1166,10 +1168,10 @@ dumpstatus(SIGNAL_ARGS)
Port *port = DLE_VAL(curr);
fprintf(stderr, "%s: dumpstatus:\n", progname);
- fprintf(stderr, "\tsock %d: nBytes=%d, laddr=0x%x, raddr=0x%x\n",
+ fprintf(stderr, "\tsock %d: nBytes=%d, laddr=0x%lx, raddr=0x%lx\n",
port->sock, port->nBytes,
- port->laddr,
- port->raddr);
+ port->laddr.sin_addr.s_addr,
+ port->raddr.sin_addr.s_addr);
curr = DLGetSucc(curr);
}
}
diff --git a/src/backend/regex/regcomp.c b/src/backend/regex/regcomp.c
index 88445cd50d..d59e71d101 100644
--- a/src/backend/regex/regcomp.c
+++ b/src/backend/regex/regcomp.c
@@ -47,6 +47,7 @@ static char sccsid[] = "@(#)regcomp.c 8.5 (Berkeley) 3/20/94";
#include <ctype.h>
#include <limits.h>
#include <stdlib.h>
+#include <assert.h>
#include <regex/regex.h>
#include <regex/utils.h>
@@ -284,8 +285,8 @@ register struct parse *p;
int stop; /* character this ERE should end at */
{
register char c;
- register sopno prevback;
- register sopno prevfwd;
+ register sopno prevback = 0;
+ register sopno prevfwd = 0;
register sopno conc;
register int first = 1; /* is this the first alternative? */
@@ -1592,8 +1593,8 @@ struct parse *p;
register struct re_guts *g;
{
register sop *scan;
- sop *start;
- register sop *newstart;
+ sop *start = 0;
+ register sop *newstart = 0;
register sopno newlen;
register sop s;
register char *cp;
diff --git a/src/backend/regex/regerror.c b/src/backend/regex/regerror.c
index dbfcc25061..fef668fadf 100644
--- a/src/backend/regex/regerror.c
+++ b/src/backend/regex/regerror.c
@@ -47,6 +47,7 @@ static char sccsid[] = "@(#)regerror.c 8.4 (Berkeley) 3/20/94";
#include <ctype.h>
#include <limits.h>
#include <stdlib.h>
+#include <assert.h>
#include <regex/regex.h>
#include <regex/utils.h>
diff --git a/src/backend/regex/regexec.c b/src/backend/regex/regexec.c
index a34f3f8daf..115a17667b 100644
--- a/src/backend/regex/regexec.c
+++ b/src/backend/regex/regexec.c
@@ -54,6 +54,7 @@ static char sccsid[] = "@(#)regexec.c 8.3 (Berkeley) 3/20/94";
#include <string.h>
#include <limits.h>
#include <ctype.h>
+#include <assert.h>
#include <regex/regex.h>
#include <regex/utils.h>
diff --git a/src/backend/rewrite/rewriteSupport.c b/src/backend/rewrite/rewriteSupport.c
index 64f6b1e43a..2ae8bcc889 100644
--- a/src/backend/rewrite/rewriteSupport.c
+++ b/src/backend/rewrite/rewriteSupport.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.2 1996/10/11 03:25:00 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.3 1996/11/08 05:58:06 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -36,6 +36,7 @@
* given a rule oid, look it up and return the rule-event-qual and
* list of parsetrees for the rule (in parseTrees)
*/
+#ifdef NOT_USED
static Node *
RuleIdGetActionInfo(Oid ruleoid, bool *instead_flag, Query **parseTrees)
{
@@ -84,6 +85,7 @@ RuleIdGetActionInfo(Oid ruleoid, bool *instead_flag, Query **parseTrees)
*parseTrees = ruleparse;
return rule_evqual;
}
+#endif
int
IsDefinedRewriteRule(char *ruleName)
diff --git a/src/backend/storage/buffer/buf_init.c b/src/backend/storage/buffer/buf_init.c
index a26611ff56..cf017fabed 100644
--- a/src/backend/storage/buffer/buf_init.c
+++ b/src/backend/storage/buffer/buf_init.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_init.c,v 1.2 1996/11/03 04:56:58 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_init.c,v 1.3 1996/11/08 05:58:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -31,6 +31,7 @@
#include "storage/lmgr.h"
#include "miscadmin.h"
#include "utils/builtins.h"
+#include "utils/dynahash.h"
#include "utils/hsearch.h"
#include "utils/memutils.h"
#include "executor/execdebug.h" /* for NDirectFileRead */
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index dccee668da..007f7275ba 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.4 1996/11/03 04:57:00 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.5 1996/11/08 05:58:11 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -48,6 +48,7 @@
*/
#include <sys/file.h>
#include <stdio.h>
+#include <string.h>
#include <math.h>
#include <signal.h>
@@ -69,6 +70,7 @@
#include "utils/hsearch.h"
#include "utils/palloc.h"
#include "utils/memutils.h"
+#include "utils/relcache.h"
#include "executor/execdebug.h" /* for NDirectFileRead */
#include "catalog/catalog.h"
diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c
index 627dba9c1f..b79f23ecd7 100644
--- a/src/backend/storage/buffer/localbuf.c
+++ b/src/backend/storage/buffer/localbuf.c
@@ -15,12 +15,13 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.2 1996/11/03 04:57:03 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.3 1996/11/08 05:58:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include <sys/file.h>
#include <stdio.h>
+#include <string.h>
#include <math.h>
#include <signal.h>
@@ -41,6 +42,7 @@
#include "utils/builtins.h"
#include "utils/hsearch.h"
#include "utils/memutils.h"
+#include "utils/relcache.h"
#include "executor/execdebug.h" /* for NDirectFileRead */
#include "catalog/catalog.h"
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index 2bdd701481..d112c989f7 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -6,7 +6,7 @@
* Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Id: fd.c,v 1.8 1996/11/06 06:48:51 scrappy Exp $
+ * $Id: fd.c,v 1.9 1996/11/08 05:58:21 momjian Exp $
*
* NOTES:
*
@@ -47,9 +47,10 @@
#include <sys/types.h>
#include <fcntl.h>
-#include "c.h"
+#include "postgres.h"
#include "miscadmin.h" /* for DataDir */
#include "utils/palloc.h"
+#include "storage/fd.h"
#ifdef sparc
/*
@@ -200,7 +201,7 @@ static File fileNameOpenFile(FileName fileName, int fileFlags, int fileMode);
static char *filepath(char *filename);
int
-pg_fsync(fd)
+pg_fsync(int fd)
{
extern int fsyncOff;
return fsyncOff ? 0 : fsync(fd);
diff --git a/src/backend/storage/ipc/ipc.c b/src/backend/storage/ipc/ipc.c
index b384f6a181..c512cbef1a 100644
--- a/src/backend/storage/ipc/ipc.c
+++ b/src/backend/storage/ipc/ipc.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.7 1996/11/06 06:49:01 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.8 1996/11/08 05:58:30 momjian Exp $
*
* NOTES
*
@@ -27,6 +27,7 @@
#include <sys/types.h>
#include <sys/file.h>
#include <stdio.h>
+#include <string.h>
#include <errno.h>
/* XXX - the following dependency should be moved into the defaults.mk file */
diff --git a/src/backend/storage/ipc/ipci.c b/src/backend/storage/ipc/ipci.c
index 70c73f14c5..2527daed7f 100644
--- a/src/backend/storage/ipc/ipci.c
+++ b/src/backend/storage/ipc/ipci.c
@@ -7,10 +7,14 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipci.c,v 1.3 1996/11/06 06:49:03 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipci.c,v 1.4 1996/11/08 05:58:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
+#include <string.h>
+#include <sys/types.h>
+#include <sys/ipc.h>
+
#include "postgres.h"
#include "storage/ipc.h"
@@ -22,11 +26,6 @@
#include "storage/lock.h"
#include "miscadmin.h" /* for DebugLvl */
-#if defined(sparc_solaris)
-#include <string.h>
-#include <sys/ipc.h>
-#endif
-
/*
* SystemPortAddressCreateMemoryKey --
* Returns a memory key given a port address.
diff --git a/src/backend/storage/ipc/shmem.c b/src/backend/storage/ipc/shmem.c
index 70d3cbe8d9..58a1e6f3cc 100644
--- a/src/backend/storage/ipc/shmem.c
+++ b/src/backend/storage/ipc/shmem.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.3 1996/11/03 05:06:57 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.4 1996/11/08 05:58:36 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -425,7 +425,7 @@ ShmemPIDDestroy(int pid)
{
BindingEnt * result,item;
bool found;
- SHMEM_OFFSET location;
+ SHMEM_OFFSET location = 0;
Assert(BindingTable);
diff --git a/src/backend/storage/large_object/inv_api.c b/src/backend/storage/large_object/inv_api.c
index 01c531ed4e..bde4c41b34 100644
--- a/src/backend/storage/large_object/inv_api.c
+++ b/src/backend/storage/large_object/inv_api.c
@@ -8,12 +8,14 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.4 1996/11/06 06:49:17 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.5 1996/11/08 05:58:41 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include <stdio.h> /* for sprintf() */
+#include <string.h>
#include <sys/file.h>
+
#include "postgres.h"
#include "miscadmin.h"
#include "libpq/libpq-fs.h"
@@ -32,9 +34,12 @@
#include "storage/itemptr.h"
#include "storage/bufpage.h"
#include "storage/bufmgr.h"
+#include "storage/smgr.h"
#include "utils/rel.h"
+#include "utils/relcache.h"
#include "utils/palloc.h"
#include "storage/large_object.h"
+#include "storage/lmgr.h"
#include "utils/syscache.h"
#include "utils/builtins.h" /* for namestrcpy() */
#include "catalog/heap.h"
diff --git a/src/backend/storage/lmgr/lmgr.c b/src/backend/storage/lmgr/lmgr.c
index 5567189733..a7120d7255 100644
--- a/src/backend/storage/lmgr/lmgr.c
+++ b/src/backend/storage/lmgr/lmgr.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.2 1996/11/03 05:07:26 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.3 1996/11/08 05:58:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -35,6 +35,7 @@
#include "storage/lmgr.h"
#include "utils/palloc.h"
+#include "utils/mcxt.h"
#include "utils/rel.h"
#include "catalog/catname.h"
diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c
index a0777b79cb..c3720c4c9a 100644
--- a/src/backend/storage/lmgr/lock.c
+++ b/src/backend/storage/lmgr/lock.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.4 1996/11/03 05:07:29 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.5 1996/11/08 05:58:51 momjian Exp $
*
* NOTES
* Outside modules can create a lock table and acquire/release
@@ -32,12 +32,16 @@
*-------------------------------------------------------------------------
*/
#include <stdio.h> /* for sprintf() */
+#include <string.h>
+
#include "postgres.h"
#include "storage/shmem.h"
#include "storage/spin.h"
#include "storage/proc.h"
#include "storage/lock.h"
+#include "utils/dynahash.h"
#include "utils/hsearch.h"
+#include "utils/memutils.h"
#include "utils/palloc.h"
#include "access/xact.h"
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c
index 59007edb9f..9424f0cae1 100644
--- a/src/backend/storage/lmgr/proc.c
+++ b/src/backend/storage/lmgr/proc.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.8 1996/11/06 06:49:24 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.9 1996/11/08 05:58:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -46,14 +46,17 @@
* This is so that we can support more backends. (system-wide semaphore
* sets run out pretty fast.) -ay 4/95
*
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.8 1996/11/06 06:49:24 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.9 1996/11/08 05:58:59 momjian Exp $
*/
#include <sys/time.h>
#ifndef WIN32
#include <unistd.h>
#endif /* WIN32 */
#include <string.h>
+#include <signal.h>
#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>
#if defined(sparc_solaris)
#include <sys/ipc.h>
@@ -69,6 +72,7 @@
#include "storage/buf.h"
#include "storage/lock.h"
+#include "storage/lmgr.h"
#include "storage/shmem.h"
#include "storage/spin.h"
#include "storage/proc.h"
diff --git a/src/backend/storage/page/bufpage.c b/src/backend/storage/page/bufpage.c
index 77267a152e..2cfc21f5c1 100644
--- a/src/backend/storage/page/bufpage.c
+++ b/src/backend/storage/page/bufpage.c
@@ -7,10 +7,11 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/page/bufpage.c,v 1.2 1996/11/03 05:07:44 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/page/bufpage.c,v 1.3 1996/11/08 05:59:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
+#include <string.h>
#include <sys/types.h>
#include <sys/file.h>
diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c
index 9b18e44df0..8a41bd345a 100644
--- a/src/backend/storage/smgr/md.c
+++ b/src/backend/storage/smgr/md.c
@@ -7,17 +7,20 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.7 1996/11/04 04:53:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.8 1996/11/08 05:59:07 momjian Exp $
*
*-------------------------------------------------------------------------
*/
+#include <unistd.h>
#include <stdio.h> /* for sprintf() */
+#include <string.h>
#include <sys/file.h>
#include "postgres.h"
#include "miscadmin.h" /* for DataDir */
#include "storage/block.h"
+#include "storage/fd.h"
#include "storage/smgr.h" /* where the declarations go */
#include "storage/fd.h"
#include "utils/mcxt.h"
diff --git a/src/backend/storage/smgr/mm.c b/src/backend/storage/smgr/mm.c
index 44be231185..fd6c32da3a 100644
--- a/src/backend/storage/smgr/mm.c
+++ b/src/backend/storage/smgr/mm.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/smgr/Attic/mm.c,v 1.3 1996/11/03 05:07:57 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/Attic/mm.c,v 1.4 1996/11/08 05:59:11 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -25,6 +25,7 @@
#include "storage/shmem.h"
#include "storage/spin.h"
+#include "utils/dynahash.h"
#include "utils/hsearch.h"
#include "utils/rel.h"
#include "utils/memutils.h"
diff --git a/src/backend/storage/smgr/smgr.c b/src/backend/storage/smgr/smgr.c
index 6fcba6448c..2aaa156e25 100644
--- a/src/backend/storage/smgr/smgr.c
+++ b/src/backend/storage/smgr/smgr.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.3 1996/11/03 05:08:00 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.4 1996/11/08 05:59:15 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -83,7 +83,6 @@ int
smgrinit()
{
int i;
- extern char *smgrout();
for (i = 0; i < NSmgr; i++) {
if (smgrsw[i].smgr_init) {
@@ -102,7 +101,6 @@ void
smgrshutdown(int dummy)
{
int i;
- extern char *smgrout();
for (i = 0; i < NSmgr; i++) {
if (smgrsw[i].smgr_shutdown) {
@@ -331,7 +329,6 @@ int
smgrcommit()
{
int i;
- extern char *smgrout();
for (i = 0; i < NSmgr; i++) {
if (smgrsw[i].smgr_commit) {
@@ -347,7 +344,6 @@ int
smgrabort()
{
int i;
- extern char *smgrout();
for (i = 0; i < NSmgr; i++) {
if (smgrsw[i].smgr_abort) {
diff --git a/src/backend/tcop/Makefile b/src/backend/tcop/Makefile
index bc31448ab0..4dd7fbcb5f 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 f8d43fad00..342d373a45 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 273caa4942..611adb3a19 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 c5e1ef8ec8..8d30dcc3ca 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 3cd3197e1e..e36ef730fe 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 8dd10bb59b..13bf1a506a 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"
diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c
index 71431fd337..34a379e7e3 100644
--- a/src/backend/utils/adt/arrayfuncs.c
+++ b/src/backend/utils/adt/arrayfuncs.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.9 1996/11/06 10:30:38 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.10 1996/11/08 05:59:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -47,15 +47,19 @@ static char *_ReadArrayStr(char *arrayStr, int nitems, int ndim, int dim[],
func_ptr inputproc, Oid typelem, char typdelim,
int typlen, bool typbyval, char typalign,
int *nbytes);
+#ifdef LOARRAY
static char *_ReadLOArray(char *str, int *nbytes, int *fd, bool *chunkFlag,
int ndim, int dim[], int baseSize);
+#endif
static void _CopyArrayEls(char **values, char *p, int nitems, int typlen,
char typalign, bool typbyval);
static void system_cache_lookup(Oid element_type, bool input, int *typlen,
bool *typbyval, char *typdelim, Oid *typelem, Oid *proc,
char *typalign);
static Datum _ArrayCast(char *value, bool byval, int len);
+#ifdef LOARRAY
static char *_AdvanceBy1word(char *str, char **word);
+#endif
static void _ArrayRange(int st[], int endp[], int bsize, char *destPtr,
ArrayType *array, int from);
static int _ArrayClipCount(int stI[], int endpI[], ArrayType *array);
@@ -63,8 +67,6 @@ static void _LOArrayRange(int st[], int endp[], int bsize, int srcfd,
int destfd, ArrayType *array, int isSrcLO, bool *isNull);
static void _ReadArray (int st[], int endp[], int bsize, int srcfd, int destfd,
ArrayType *array, int isDestLO, bool *isNull);
-static char *_array_set(ArrayType *array, struct varlena *indx_str,
- struct varlena *dataPtr);
static ArrayCastAndSet(char *src, bool typbyval, int typlen, char *dest);
@@ -90,7 +92,7 @@ array_in(char *string, /* input array in external form */
int i, nitems, dummy;
int32 nbytes;
char *dataPtr;
- ArrayType *retval;
+ ArrayType *retval = NULL;
int ndim, dim[MAXDIM], lBound[MAXDIM];
char typalign;
@@ -407,6 +409,7 @@ _ReadArrayStr(char *arrayStr,
* Read data about an array to be stored as a large object
*----------------------------------------------------------------------------
*/
+#ifdef LOARRAY
static char *
_ReadLOArray(char *str,
int *nbytes,
@@ -460,6 +463,7 @@ _ReadLOArray(char *str,
}
return(retStr);
}
+#endif
static void
_CopyArrayEls(char **values,
@@ -659,8 +663,8 @@ array_ref(ArrayType *array,
bool *isNull)
{
int i, ndim, *dim, *lb, offset, nbytes;
- struct varlena *v;
- char *retval;
+ struct varlena *v = NULL;
+ char *retval = NULL;
if (array == (ArrayType *) NULL) RETURN_NULL;
if (arraylen > 0) {
@@ -684,7 +688,7 @@ array_ref(ArrayType *array,
if (ARR_IS_LO(array)) {
char * lo_name;
- int fd;
+ int fd = 0;
/* We are assuming fixed element lengths here */
offset *= elmlen;
@@ -786,8 +790,8 @@ array_clip(ArrayType *array,
#ifdef LOARRAY
char * lo_name;
#endif
- char * newname;
- int fd, newfd, isDestLO = true, rsize;
+ char *newname = NULL;
+ int fd = 0, newfd = 0, isDestLO = true, rsize;
if (len < 0)
elog(WARN, "array_clip: array of variable length objects not supported");
@@ -863,7 +867,7 @@ array_clip(ArrayType *array,
}
/*-----------------------------------------------------------------------------
- * array_set :
+ * array_set :
* This routine sets the value of an array location (specified by an index array)
* to a new value specified by "dataPtr".
* result :
@@ -908,7 +912,7 @@ array_set(ArrayType *array,
offset = GetOffset( n, dim, lb, indx);
if (ARR_IS_LO(array)) {
- int fd;
+ int fd = 0;
struct varlena *v;
/* We are assuming fixed element lengths here */
@@ -1017,7 +1021,7 @@ array_assgn(ArrayType *array,
elog(WARN, "lowerIndex larger than upperIndx");
if (ARR_IS_LO(array)) {
- int fd, newfd;
+ int fd = 0, newfd = 0;
#ifdef LOARRAY
char * lo_name;
@@ -1156,6 +1160,7 @@ ArrayCastAndSet(char *src,
return(inc);
}
+#ifdef LOARRAY
static char *
_AdvanceBy1word(char *str, char **word)
{
@@ -1173,6 +1178,7 @@ _AdvanceBy1word(char *str, char **word)
retstr = NULL;
return retstr;
}
+#endif
int
SanityCheckInput(int ndim, int n, int dim[], int lb[], int indx[])
@@ -1371,7 +1377,7 @@ _LOtransfer(char **destfd,
{
#define MAX_READ (512 * 1024)
#define min(a, b) (a < b ? a : b)
- struct varlena *v;
+ struct varlena *v = NULL;
int tmp, inc, resid;
inc = nitems*size;
diff --git a/src/backend/utils/adt/chunk.c b/src/backend/utils/adt/chunk.c
index f6d3952289..f8f64a8231 100644
--- a/src/backend/utils/adt/chunk.c
+++ b/src/backend/utils/adt/chunk.c
@@ -6,11 +6,14 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/chunk.c,v 1.3 1996/11/06 10:30:40 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/chunk.c,v 1.4 1996/11/08 05:59:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include <ctype.h>
+#include <sys/types.h>
+#include <fcntl.h>
+
#include "postgres.h"
#include <libpq/be-fsstubs.h>
@@ -46,12 +49,14 @@ static int _FindBestChunk(int size, int dmax[], int dbest[], int dim,
int A[MAXPAT][MAXDIM+1], int N);
static int get_next(int d[], int k, int C, int dmax[]);
static void initialize_info(CHUNK_INFO *A, int ndim, int dim[], int chunk[]);
+#ifdef LOARRAY
static void _ConvertToChunkFile(int n, int baseSize, int dim[], int C[],
int srcfd, int destfd);
static void read_chunk(int chunk_no[], int C[], char a_chunk[], int srcfd,
int n, int baseSize, int PX[], int dist[]);
static int write_chunk(struct varlena * a_chunk, int ofile);
static int seek_and_read(int pos, int size, char buff[], int fp, int from);
+#endif
/*------------------------------------------------------------------------
* _ChunkArray ---
@@ -71,7 +76,9 @@ _ChunkArray(int fd,
int *nbytes,
char *chunkfile)
{
- int cfd;
+#ifdef LOARRAY
+int cfd = 0;
+#endif
int chunk[MAXDIM], csize;
bool reorgFlag;
@@ -86,17 +93,20 @@ _ChunkArray(int fd,
chunkfile = _array_newLO( &cfd, fileFlag );
else
cfd = LOopen(chunkfile, O_RDONLY);
-#endif
if (cfd < 0)
- elog(WARN, "Enable to open chunk file");
+ elog(WARN, "Unable to open chunk file");
+#endif
+
strcpy (cInfo.lo_name, chunkfile);
/* find chunk size */
csize = GetChunkSize(afd, ndim, dim, baseSize, chunk);
+#ifdef LOARRAY
if (reorgFlag)
/* copy data from input file to chunked file */
_ConvertToChunkFile(ndim, baseSize, dim, chunk, fd, cfd);
+#endif
initialize_info(&cInfo, ndim, dim, chunk);
*nbytes = sizeof(CHUNK_INFO);
@@ -231,8 +241,10 @@ get_next(int d[], int k, int C, int dmax[])
return(1);
}
+#ifdef LOARRAY
static char a_chunk[_PAGE_SIZE_ + 4]; /* 4 since a_chunk is in
varlena format */
+#endif
static void
initialize_info(CHUNK_INFO *A, int ndim, int dim[], int chunk[])
@@ -254,6 +266,7 @@ initialize_info(CHUNK_INFO *A, int ndim, int dim[], int chunk[])
*
*-------------------------------------------------------------------------
*/
+#ifdef LOARRAY
static void
_ConvertToChunkFile(int n,
int baseSize,
@@ -337,7 +350,7 @@ read_chunk(int chunk_no[],
static int
write_chunk(struct varlena * a_chunk, int ofile)
{
- int got_n;
+ int got_n = 0;
#ifdef LOARRAY
got_n = LOwrite (ofile, a_chunk);
#endif
@@ -354,7 +367,7 @@ write_chunk(struct varlena * a_chunk, int ofile)
static int
seek_and_read(int pos, int size, char buff[], int fp, int from)
{
- struct varlena *v;
+ struct varlena *v = NULL;
/* Assuming only one file */
if ( lo_lseek(fp, pos, from ) < 0)
@@ -369,6 +382,7 @@ seek_and_read(int pos, int size, char buff[], int fp, int from)
return(1);
}
+#endif /* LOARRAY */
/*----------------------------------------------------------------------------
* _ReadChunkArray --
@@ -453,7 +467,7 @@ _ReadChunkArray(int st[],
for (i = 0; i < n; range[i++] = 0);
j = n-1; bptr *= bsize;
if (isDestLO) {
- if (lo_lseek(destfp, bptr, SEEK_SET) < 0)
+ if (lo_lseek((int)destfp, bptr, SEEK_SET) < 0)
RETURN_NULL;
}
else
@@ -480,7 +494,7 @@ _ReadChunkArray(int st[],
block_seek += cdist[j];
bptr += adist[j]*bsize;
if (isDestLO) {
- if (lo_lseek(destfp, bptr, SEEK_SET) < 0)
+ if (lo_lseek((int)destfp, bptr, SEEK_SET) < 0)
RETURN_NULL;
}
else
diff --git a/src/backend/utils/adt/datum.c b/src/backend/utils/adt/datum.c
index f833e58a46..11efd89e7a 100644
--- a/src/backend/utils/adt/datum.c
+++ b/src/backend/utils/adt/datum.c
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/datum.c,v 1.2 1996/11/06 06:49:47 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/datum.c,v 1.3 1996/11/08 05:59:41 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -51,7 +51,7 @@ datumGetSize(Datum value, Oid type, bool byVal, Size len)
{
struct varlena *s;
- Size size;
+ Size size = 0;
if (byVal) {
if (len >= 0 && len <= sizeof(Datum)) {
diff --git a/src/backend/utils/adt/filename.c b/src/backend/utils/adt/filename.c
index 351a8e7693..7b5a1b8a19 100644
--- a/src/backend/utils/adt/filename.c
+++ b/src/backend/utils/adt/filename.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/filename.c,v 1.4 1996/11/06 10:30:51 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/filename.c,v 1.5 1996/11/08 05:59:43 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -28,7 +28,7 @@ char *
filename_in(char *file)
{
char *str, *getenv();
- int ind;
+ int ind = 0;
/*
* XXX - HACK CITY --- REDO
diff --git a/src/backend/utils/adt/nabstime.c b/src/backend/utils/adt/nabstime.c
index ecdfebd18c..5630b2f10c 100644
--- a/src/backend/utils/adt/nabstime.c
+++ b/src/backend/utils/adt/nabstime.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.6 1996/11/06 06:49:51 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.7 1996/11/08 05:59:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -589,8 +589,9 @@ qmktime(struct tm *tp)
* correction
*/
if (day > nmdays[mon])
- if (mon != 2 || year % 4 == 0 &&
- (year % 100 != 0 || year % 400 == 0) && day > 29)
+ if (mon != 2 ||
+ (year % 4 == 0 &&
+ ((year % 100 != 0 || year % 400 == 0)) && day > 29))
return -1; /* day too large for month */
/* split year into century and year-of-century */
diff --git a/src/backend/utils/adt/regproc.c b/src/backend/utils/adt/regproc.c
index 63010c3cd7..3facee2b2b 100644
--- a/src/backend/utils/adt/regproc.c
+++ b/src/backend/utils/adt/regproc.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.2 1996/11/06 06:49:59 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.3 1996/11/08 05:59:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -36,7 +36,7 @@ int32 regprocin(char *proname)
HeapScanDesc procscan;
HeapTuple proctup;
ScanKeyData key;
- RegProcedure result;
+ RegProcedure result = (Oid)0;
bool isnull;
if (proname == NULL)
diff --git a/src/backend/utils/adt/sets.c b/src/backend/utils/adt/sets.c
index fea167340e..7ab50498ca 100644
--- a/src/backend/utils/adt/sets.c
+++ b/src/backend/utils/adt/sets.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.2 1996/11/06 06:50:01 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.3 1996/11/08 05:59:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -44,7 +44,7 @@ SetDefine(char *querystr, char *typename)
char *procname = GENERICSETNAME;
char *fileName = "-";
char realprocname[16];
- HeapTuple tup, newtup;
+ HeapTuple tup, newtup = NULL;
Form_pg_proc proc;
Relation procrel;
int i;
diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c
index 230f987f8c..4e3d4e2674 100644
--- a/src/backend/utils/adt/varlena.c
+++ b/src/backend/utils/adt/varlena.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.7 1996/11/06 06:50:07 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.8 1996/11/08 05:59:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -133,7 +133,7 @@ byteaout(struct varlena *vlena)
vp = vlena->vl_dat;
for (i = vlena->vl_len - sizeof(int32); i != 0; i--) /* varlena? */
if (*vp == '\\') {
- *vp++;
+ vp++;
*rp++ = '\\';
*rp++ = '\\';
} else if (isascii(*vp) && isprint(*vp))
diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c
index 1e46de1686..9aefc80f9a 100644
--- a/src/backend/utils/cache/catcache.c
+++ b/src/backend/utils/cache/catcache.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.3 1996/10/24 07:59:46 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.4 1996/11/08 05:59:53 momjian Exp $
*
* Notes:
* XXX This needs to use exception.h to handle recovery when
@@ -744,7 +744,7 @@ SearchSysCache(struct catcache *cache,
CatCTup *nct;
CatCTup *nct2;
Dlelem *elt;
- HeapTuple ntp;
+ HeapTuple ntp = 0;
Buffer buffer;
Relation relation;
diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c
index 39c7e238e3..bf1ae04960 100644
--- a/src/backend/utils/cache/inval.c
+++ b/src/backend/utils/cache/inval.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.2 1996/11/06 10:31:24 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.3 1996/11/08 05:59:55 momjian Exp $
*
* Note - this code is real crufty...
*
@@ -449,7 +449,7 @@ RelationInvalidateRelationCache(Relation relation,
void (*function)())
{
Oid relationId;
- Oid objectId;
+ Oid objectId = (Oid)0;
/* ----------------
* get the relation object id
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index 17440ec148..fca7ee329f 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.8 1996/11/06 10:31:33 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.9 1996/11/08 05:59:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -58,7 +58,10 @@ elog(int lev, const char *fmt, ... )
#ifndef PG_STANDALONE
extern FILE *Pfout;
#endif /* !PG_STANDALONE */
- time_t tim, time();
+ time_t time();
+#ifdef ELOG_TIMESTAMPS
+ time_t tim;
+#endif
int len;
int i = 0;
@@ -231,7 +234,7 @@ DebugFileOpen()
fd = fileno(stderr);
if (fcntl(fd, F_GETFD, 0) < 0) {
sprintf(OutputFileName, "%s/pg.errors.%d",
- GetPGData(), getpid());
+ GetPGData(), (int)getpid());
fd = open(OutputFileName, O_CREAT|O_APPEND|O_WRONLY, 0666);
}
#endif /* WIN32 */
diff --git a/src/backend/utils/fmgr/fmgr.c b/src/backend/utils/fmgr/fmgr.c
index 6ae276944e..99fb7d8c9d 100644
--- a/src/backend/utils/fmgr/fmgr.c
+++ b/src/backend/utils/fmgr/fmgr.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.1.1.1 1996/07/09 06:22:08 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.2 1996/11/08 06:00:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -113,7 +113,7 @@ fmgr_c(func_ptr user_fn,
void
fmgr_info(Oid procedureId, func_ptr *function, int *nargs)
{
- func_ptr user_fn;
+ func_ptr user_fn = NULL;
FmgrCall *fcp;
HeapTuple procedureTuple;
FormData_pg_proc *procedureStruct;
diff --git a/src/backend/utils/hash/dynahash.c b/src/backend/utils/hash/dynahash.c
index f62f2ad47e..f5ac53b776 100644
--- a/src/backend/utils/hash/dynahash.c
+++ b/src/backend/utils/hash/dynahash.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.3 1996/11/06 10:31:43 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.4 1996/11/08 06:00:23 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -43,6 +43,7 @@
# include <sys/types.h>
# include <string.h>
# include "postgres.h"
+# include "utils/dynahash.h"
# include "utils/hsearch.h"
#ifndef FRONTEND
# include "utils/mcxt.h"
@@ -65,7 +66,6 @@
*/
static long *DynaHashAlloc(unsigned int size);
static void DynaHashFree(Pointer ptr);
-static int hash_clear(HTAB *hashp);
static uint32 call_hash(HTAB *hashp, char *k, int len);
static SEG_OFFSET seg_alloc(HTAB *hashp);
static int bucket_alloc(HTAB *hashp);
@@ -352,14 +352,6 @@ init_htab (HTAB *hashp, int nelem)
/********************** DESTROY ROUTINES ************************/
-static int
-hash_clear(HTAB *hashp)
-{
- elog(NOTICE,"hash_clear not implemented\n");
- return 0;
-}
-
-
void
hash_destroy (HTAB *hashp)
{
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c
index 430bfb04ec..c4fdbd8725 100644
--- a/src/backend/utils/init/postinit.c
+++ b/src/backend/utils/init/postinit.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.4 1996/11/06 10:31:59 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.5 1996/11/08 06:00:33 momjian Exp $
*
* NOTES
* InitPostgres() is the function called from PostgresMain
@@ -325,7 +325,7 @@ InitCommunication()
char *getenv(); /* XXX style */
char *postid;
char *postport;
- IPCKey key;
+ IPCKey key = 0;
/* ----------------
* try and get the backend tag from POSTID
diff --git a/src/backend/utils/mmgr/aset.c b/src/backend/utils/mmgr/aset.c
index 5b6ca20925..5e6b409483 100644
--- a/src/backend/utils/mmgr/aset.c
+++ b/src/backend/utils/mmgr/aset.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/aset.c,v 1.2 1996/11/06 10:32:04 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/aset.c,v 1.3 1996/11/08 06:00:48 momjian Exp $
*
* NOTE
* XXX This is a preliminary implementation which lacks fail-fast
@@ -368,7 +368,7 @@ AllocPointerGetNext(AllocPointer pointer)
void
AllocPointerDump(AllocPointer pointer)
{
- printf("\t%-10d@ %0#x\n", ((long*)pointer)[-1], pointer); /* XXX */
+ printf("\t%-10ld@ %0#lx\n", ((long*)pointer)[-1], (long)pointer); /* XXX */
}
/*
diff --git a/src/backend/utils/mmgr/mcxt.c b/src/backend/utils/mmgr/mcxt.c
index d9095af11f..e03948ff04 100644
--- a/src/backend/utils/mmgr/mcxt.c
+++ b/src/backend/utils/mmgr/mcxt.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.1.1.1 1996/07/09 06:22:09 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.2 1996/11/08 06:00:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -77,8 +77,9 @@ static Pointer GlobalMemoryRealloc(GlobalMemory this, Pointer pointer,
Size size);
static char *GlobalMemoryGetName(GlobalMemory this);
static void GlobalMemoryDump(GlobalMemory this);
+#ifdef NOT_USED
static void DumpGlobalMemories(void);
-
+#endif
/*
* Global Memory Methods
@@ -493,6 +494,7 @@ GlobalMemoryDump(GlobalMemory this)
* Exceptions:
* ???
*/
+#ifdef NOT_USED
static void
DumpGlobalMemories()
{
@@ -507,4 +509,4 @@ DumpGlobalMemories()
&context->elemData);
}
}
-
+#endif
diff --git a/src/backend/utils/mmgr/portalmem.c b/src/backend/utils/mmgr/portalmem.c
index 9dd621e322..f91d1f5c8b 100644
--- a/src/backend/utils/mmgr/portalmem.c
+++ b/src/backend/utils/mmgr/portalmem.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.2 1996/11/03 06:54:25 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.3 1996/11/08 06:00:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -465,6 +465,7 @@ AtEOXact_portals()
* PortalDump
* ----------------
*/
+#ifdef NOT_USED
static void
PortalDump(Portal *thisP)
{
@@ -473,11 +474,13 @@ PortalDump(Portal *thisP)
PortalVariableMemoryDump(PortalGetVariableMemory(*thisP));
PortalHeapMemoryDump(PortalGetHeapMemory(*thisP));
}
+#endif
/* ----------------
* DumpPortals
* ----------------
*/
+#ifdef NOT_USED
static void
DumpPortals()
{
@@ -485,7 +488,8 @@ DumpPortals()
HashTableWalk(PortalHashTable, PortalDump, 0);
}
-
+#endif
+
/* ----------------------------------------------------------------
* public portal interface functions
* ----------------------------------------------------------------
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index d7b4704109..0c35d51093 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -20,7 +20,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.12 1996/11/04 04:00:02 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.13 1996/11/08 06:01:03 momjian Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
@@ -1557,7 +1557,6 @@ dumpTuples(PGresult *res, FILE *fout, int* attrmap)
void
setMaxOid(FILE *fout)
{
- char query[255];
PGresult *res;
Oid max_oid;
@@ -1592,7 +1591,7 @@ setMaxOid(FILE *fout)
g_comment_start, max_oid, g_comment_end);
fprintf(fout, "CREATE TABLE pgdump_oid (dummy int4);\n");
fprintf(fout, "COPY pgdump_oid WITH OIDS FROM stdin;\n");
- fprintf(fout, "%-ld\t0\n", max_oid);
+ fprintf(fout, "%-d\t0\n", max_oid);
fprintf(fout, "\\.\n");
fprintf(fout, "DROP TABLE pgdump_oid;\n");
}
diff --git a/src/bin/pg_id/pg_id.c b/src/bin/pg_id/pg_id.c
index 251f8c0a40..4364fc1cf2 100644
--- a/src/bin/pg_id/pg_id.c
+++ b/src/bin/pg_id/pg_id.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/pg_id.c,v 1.2 1996/09/16 06:34:40 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/pg_id.c,v 1.3 1996/11/08 06:01:12 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -46,9 +46,9 @@ main(int argc, char **argv)
printf("NOUSER\n");
exit(1);
}
- printf("%d\n", pw->pw_uid);
+ printf("%ld\n", (long)pw->pw_uid);
} else {
- printf("%d\n", getuid());
+ printf("%ld\n", (long)getuid());
}
exit(0);
diff --git a/src/bin/pg_version/pg_version.c b/src/bin/pg_version/pg_version.c
index c213379502..e09cd3c8e6 100644
--- a/src/bin/pg_version/pg_version.c
+++ b/src/bin/pg_version/pg_version.c
@@ -7,10 +7,11 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_version/Attic/pg_version.c,v 1.3 1996/09/19 19:58:27 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_version/Attic/pg_version.c,v 1.4 1996/11/08 06:01:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
+#include <stdlib.h>
#include <stdio.h>
int Noversion = 0;
diff --git a/src/bin/psql/Makefile b/src/bin/psql/Makefile
index 9e2dd4d29b..2fd82e931d 100644
--- a/src/bin/psql/Makefile
+++ b/src/bin/psql/Makefile
@@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.8 1996/11/02 09:53:15 bryanh Exp $
+# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.9 1996/11/08 06:01:27 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -65,10 +65,10 @@ endif
all: psql
-psql: $(OBJS) $(LIBPQDIR)/libpq.a
- $(CC) $(LDFLAGS) -o psql -L$(LIBPQDIR) $(OBJS) -lpq $(LD_ADD)
+psql: $(OBJS) $(LIBPQDIR)/obj/libpq.a
+ $(CC) $(LDFLAGS) -o psql -L$(LIBPQDIR)/obj $(OBJS) -lpq $(LD_ADD)
-$(srcdir)/libpq/libpq.a:
+$(srcdir)/libpq/obj/libpq.a:
$(MAKE) -C $(LIBPQDIR) libpq.a
install:
diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c
index 5cf3762f41..95a111f193 100644
--- a/src/bin/psql/psql.c
+++ b/src/bin/psql/psql.c
@@ -7,17 +7,19 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.24 1996/11/04 09:17:55 bryanh Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.25 1996/11/08 06:01:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include <stdio.h>
#include <string.h>
#include <signal.h>
+#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
+#include "postgres.h"
#include "libpq-fe.h"
#include "stringutils.h"
@@ -800,7 +802,7 @@ do_edit(const char *filename_arg, char *query, int *retcode_p) {
fname=(char *)filename_arg;
error=false;
} else {
- sprintf(tmp, "/tmp/psql.%d.%d", geteuid(), getpid());
+ sprintf(tmp, "/tmp/psql.%ld.%ld", (long)geteuid(), (long)getpid());
fname=tmp;
unlink(tmp);
if (ql > 0) {
diff --git a/src/include/bootstrap/bootstrap.h b/src/include/bootstrap/bootstrap.h
index de180547ad..656bfe3f38 100644
--- a/src/include/bootstrap/bootstrap.h
+++ b/src/include/bootstrap/bootstrap.h
@@ -6,14 +6,16 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: bootstrap.h,v 1.2 1996/11/06 10:29:05 scrappy Exp $
+ * $Id: bootstrap.h,v 1.3 1996/11/08 06:01:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef BOOTSTRAP_H
#define BOOTSTRAP_H
-
+#include "access/funcindex.h"
+#include "access/itup.h"
+#include "utils/rel.h"
#define MAXATTR 40 /* max. number of attributes in a relation */
@@ -37,7 +39,7 @@ extern void index_register(char *heap,
uint16 nparams,
Datum *params,
FuncIndexInfo *finfo,
- PredInfo *predInfo);
+ PredInfo *predInfo);
extern void err_out(void);
extern void InsertOneTuple(Oid objectid);
diff --git a/src/include/commands/async.h b/src/include/commands/async.h
index d734651c15..c572c64243 100644
--- a/src/include/commands/async.h
+++ b/src/include/commands/async.h
@@ -6,13 +6,14 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: async.h,v 1.3 1996/11/06 10:29:30 scrappy Exp $
+ * $Id: async.h,v 1.4 1996/11/08 06:01:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef ASYNC_H
#define ASYNC_H
+#include <nodes/memnodes.h>
extern void Async_NotifyHandler(SIGNAL_ARGS);
extern void Async_Notify(char *relname);
diff --git a/src/include/config.h b/src/include/config.h
index d781c4d116..4cc9e37229 100644
--- a/src/include/config.h
+++ b/src/include/config.h
@@ -178,7 +178,8 @@
/* found in function aclparse() in src/backend/utils/adt/acl.c */
/* #define ACLDEBUG */
-/* found in src/backend/utils/adt/arrayfuncs.c */
+/* found in src/backend/utils/adt/arrayfuncs.c
+ code seems broken without it, Bruce Momjian */
/* #define LOARRAY */
/* This is the time, in seconds, at which a given backend server
diff --git a/src/include/rewrite/locks.h b/src/include/rewrite/locks.h
index ea54dee521..04c5f5db10 100644
--- a/src/include/rewrite/locks.h
+++ b/src/include/rewrite/locks.h
@@ -6,13 +6,16 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: locks.h,v 1.2 1996/11/06 10:30:59 scrappy Exp $
+ * $Id: locks.h,v 1.3 1996/11/08 06:02:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef LOCKS_H
#define LOCKS_H
+#include "nodes/nodes.h"
+#include "nodes/parsenodes.h"
+#include "rewrite/prs2lock.h"
extern List *matchLocks(CmdType event, RuleLock *rulelocks, int varno,
Query *parsetree);
diff --git a/src/include/storage/fd.h b/src/include/storage/fd.h
index bb18cd02d4..74fb018783 100644
--- a/src/include/storage/fd.h
+++ b/src/include/storage/fd.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: fd.h,v 1.4 1996/11/04 07:45:53 scrappy Exp $
+ * $Id: fd.h,v 1.5 1996/11/08 06:02:12 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -85,5 +85,6 @@ extern void AllocateFile(void);
extern void FreeFile(void);
extern void closeAllVfds(void);
extern void closeOneVfd(void);
+extern int pg_fsync(int fd);
#endif /* FD_H */
diff --git a/src/include/storage/lmgr.h b/src/include/storage/lmgr.h
index 4f3398c665..097ecb3f18 100644
--- a/src/include/storage/lmgr.h
+++ b/src/include/storage/lmgr.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: lmgr.h,v 1.3 1996/11/05 06:10:59 scrappy Exp $
+ * $Id: lmgr.h,v 1.4 1996/11/08 06:02:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -78,4 +78,7 @@ extern bool SingleLockReln(LockInfo linfo, LOCKT lockt, int action);
extern bool SingleLockPage(LockInfo linfo, ItemPointer tidPtr,
LOCKT lockt, int action);
+/* proc.c */
+extern void InitProcGlobal(IPCKey key);
+
#endif /* LMGR_H */
diff --git a/src/include/storage/smgr.h b/src/include/storage/smgr.h
index c6dbd08550..0e3eb4cf6c 100644
--- a/src/include/storage/smgr.h
+++ b/src/include/storage/smgr.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: smgr.h,v 1.2 1996/11/05 06:11:07 scrappy Exp $
+ * $Id: smgr.h,v 1.3 1996/11/08 06:02:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -82,4 +82,7 @@ extern int mmcommit(void);
extern int mmabort(void);
extern int MMShmemSize(void);
+/* smgrtype.c */
+char *smgrout(int2 i);
+
#endif /* SMGR_H */
diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile
index 7d35ed0ebf..bb00e63066 100644
--- a/src/interfaces/libpq/Makefile
+++ b/src/interfaces/libpq/Makefile
@@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.12 1996/11/04 06:32:59 bryanh Exp $
+# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.13 1996/11/08 06:02:25 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -33,21 +33,22 @@ VPATH:=$(VPATH):../backend/port/$(PORTNAME)
OBJS+= getcwd.o putenv.o
endif
-ifdef LINUX_ELF
-shlib := libpq.so.1
-else
shlib :=
+ifdef LINUX_ELF
+ifeq ($(PORTNAME), linux)
+shlib := obj/libpq.so.1
+endif
endif
-all: libpq.a $(shlib) postgres.h c.h
+all: obj/libpq.a $(shlib) postgres.h c.h
-libpq.a: $(OBJS)
+obj/libpq.a: $(OBJS)
ifdef MK_NO_LORDER
- $(AR) $(AROPT) libpq.a $(OBJS)
+ $(AR) $(AROPT) obj/libpq.a $(OBJS)
else
- $(AR) $(AROPT) libpq.a `lorder $(OBJS) | tsort`
+ $(AR) $(AROPT) obj/libpq.a `lorder $(OBJS) | tsort`
endif
- $(RANLIB) libpq.a
+ $(RANLIB) obj/libpq.a
fe-lobj.o:: ../backend/fmgr.h
@@ -60,8 +61,8 @@ fe-lobj.o:: ../backend/fmgr.h
../backend/lib/dllist.o:
$(MAKE) -C ../backend/lib dllist.o
-libpq.so.1: $(OBJS)
- $(CC) $(LDFLAGS) -shared $(OBJS) -o libpq.so.1
+obj/libpq.so.1: $(OBJS)
+ $(CC) $(LDFLAGS) -shared $(OBJS) -o obj/libpq.so.1
postgres.h: ../include/postgres.h
# Note: ../backend/include/postgres.h needs to be named something different
@@ -127,17 +128,17 @@ install-shlib-dep :=
endif
install-libpq:
- $(INSTALL) $(INSTL_LIB_OPTS) libpq.a $(DESTDIR)$(LIBDIR)/libpq.a
+ $(INSTALL) $(INSTL_LIB_OPTS) obj/libpq.a $(DESTDIR)$(LIBDIR)/libpq.a
install-shlib:
- $(INSTALL) $(INSTL_LIB_OPTS) libpq.so.1 $(DESTDIR)$(LIBDIR)/libpq.so.1
+ $(INSTALL) $(INSTL_LIB_OPTS) obj/libpq.so.1 $(DESTDIR)$(LIBDIR)/libpq.so.1
depend dep:
$(CC) -MM $(INCLUDE_OPT) *.c >depend
.PHONY: clean
clean:
- rm -f libpq.a libpq.so.1 $(OBJS) c.h postgres.h
+ rm -f obj/libpq.a obj/libpq.so.1 $(OBJS) c.h postgres.h
ifeq (depend,$(wildcard depend))
include depend
diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index e8cbf148ac..b2c90331d2 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -7,10 +7,11 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-lobj.c,v 1.2 1996/10/31 05:58:32 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-lobj.c,v 1.3 1996/11/08 06:02:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
+#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>
diff --git a/src/interfaces/libpq/pqsignal.c b/src/interfaces/libpq/pqsignal.c
index 638c494eda..48868ef06a 100644
--- a/src/interfaces/libpq/pqsignal.c
+++ b/src/interfaces/libpq/pqsignal.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/pqsignal.c,v 1.1.1.1 1996/07/09 06:22:17 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/pqsignal.c,v 1.2 1996/11/08 06:02:30 momjian Exp $
*
* NOTES
* This shouldn't be in libpq, but the monitor and some other
@@ -16,6 +16,8 @@
*
*-------------------------------------------------------------------------
*/
+#include <stdlib.h>
+
#include "libpq/pqsignal.h"
pqsigfunc