# 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,
-I../include \
-I../../include
-CFLAGS += $(INCLUDE_OPT)
+CFLAGS += $(INCLUDE_OPT) -Wno-error
BOOTYACCS = bootstrap_tokens.h bootparse.c
*
*
* 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
*/
*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);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
#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 */
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
* and the TupleTableSlot node in execnodes.h.
*
*/
+#include <string.h>
+
#include "postgres.h"
* 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 $
*
*-------------------------------------------------------------------------
*/
#include "access/heapam.h"
#include "catalog/catalog.h"
+#include "access/printtup.h"
#include "executor/executor.h"
#include "executor/nodeGroup.h"
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "executor/executor.h"
+#include "executor/execdebug.h"
#include "executor/nodeNestloop.h"
#include "executor/nodeIndexscan.h"
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "executor/executor.h"
+#include "executor/execdebug.h"
#include "executor/nodeSeqscan.h"
+#include "access/heapam.h"
#include "parser/parsetree.h"
/* ----------------------------------------------------------------
*
*
* 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_ */
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
#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()*/
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.
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
int
pq_getstr(char *s, int maxlen)
{
- int c;
+ int c = '\0';
if (Pfin == (FILE *) NULL) {
/* elog(DEBUG, "Input descriptor is null"); */
int
pq_getnchar(char *s, int off, int maxlen)
{
- int c;
+ int c = '\0';
if (Pfin == (FILE *) NULL) {
/* elog(DEBUG, "Input descriptor is null"); */
*
*
* 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() */
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
listCopy(List *list)
{
List *newlist=NIL;
- List *l, *nl;
+ List *l, *nl=NIL;
foreach(l, list) {
if (newlist==NIL) {
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);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
bool
equal(void *a, void *b)
{
- bool retval;
+ bool retval=false;
if (a == b)
return(true);
*
*
* 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
_outExpr(StringInfo str, Expr *node)
{
char buf[500];
- char *opstr;
+ char *opstr = NULL;
sprintf(buf, "EXPR");
appendStringInfo(str,buf);
*
*
* 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
static NodeTag
nodeTokenType(char *token, int length)
{
- NodeTag retval;
+ NodeTag retval = 0;
/*
* Check if the token is a number (decimal or integer,
{
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;
*
*
* 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
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);
}
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 */
{
char *token;
int length;
- void *return_value;
+ void *return_value = NULL;
token = lsptok(NULL, &length);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
{
char *ptype = NULL;
JoinPath *jp;
- bool join;
+ bool join = false;
int i;
for(i=0; i < indent; i++)
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
* 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)
{
}
return restrict_cls;
}
+#endif
/*
* index-innerjoin--
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
{
List *x = NIL;
List *y = NIL;
- Path *path;
+ Path *path = NULL;
Rel *rel = (Rel*)NULL;
JoinPath *cheapest = (JoinPath*)NULL;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
create_scan_node(Path *best_path, List *tlist)
{
- Scan *node;
+ Scan *node = NULL ;
List *scan_clauses;
/*
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;
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),
# 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 $
#
#-------------------------------------------------------------------------
-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
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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;
static Node *
transformExpr(ParseState *pstate, Node *expr)
{
- Node *result;
+ Node *result = NULL;
if (expr==NULL)
return NULL;
Oid
exprType(Node *expr)
{
- Oid type;
+ Oid type = (Oid)0;
switch(nodeTag(expr)) {
case T_Func:
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);
static List *
transformGroupClause(ParseState *pstate, List *grouplist)
{
- List *glist = NIL, *gl;
+ List *glist = NIL, *gl = NIL;
while (grouplist != NIL) {
GroupClause *grpcl = makeNode(GroupClause);
char* uniqueFlag)
{
List *sortlist = NIL;
- List *s, *i;
+ List *s = NIL, *i;
while(orderlist != NIL) {
SortBy *sortby = lfirst(orderlist);
}
}
else {
- TargetEntry *tlelt;
+ TargetEntry *tlelt = NULL;
char* uniqueAttrName = uniqueFlag;
/* only create sort clause with the specified unique attribute */
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;
bool retset;
bool exists;
bool attisset = false;
- Oid toid;
+ Oid toid = (Oid)0;
Expr *expr;
if (fargs) {
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
{
Relation dbrel;
HeapTuple dbtup, utup;
- Oid dbowner;
+ Oid dbowner = (Oid)0;
char use_createdb;
bool dbfound;
bool use_super;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
#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
return queryList;
}
+#ifdef SETS_FIXED
static void
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
char type_string[16];
int32 len;
char *cp = NULL;
- char *const_string;
+ char *const_string = NULL;
bool string_palloced = false;
switch(nodeTag(expr)) {
int32 len = tlen(tp);
char *cp = NULL;
- char *const_string;
+ char *const_string = NULL;
bool string_palloced = false;
Assert(IsA(expr,Const));
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];
/* 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>
*
*
* 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
*
*
*-------------------------------------------------------------------------
*/
+ /* 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>
#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>
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");
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);
}
}
#include <ctype.h>
#include <limits.h>
#include <stdlib.h>
+#include <assert.h>
#include <regex/regex.h>
#include <regex/utils.h>
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? */
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;
#include <ctype.h>
#include <limits.h>
#include <stdlib.h>
+#include <assert.h>
#include <regex/regex.h>
#include <regex/utils.h>
#include <string.h>
#include <limits.h>
#include <ctype.h>
+#include <assert.h>
#include <regex/regex.h>
#include <regex/utils.h>
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
* 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)
{
*parseTrees = ruleparse;
return rule_evqual;
}
+#endif
int
IsDefinedRewriteRule(char *ruleName)
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
#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 */
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
*/
#include <sys/file.h>
#include <stdio.h>
+#include <string.h>
#include <math.h>
#include <signal.h>
#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"
*
*
* 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>
#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"
* 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:
*
#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
/*
static char *filepath(char *filename);
int
-pg_fsync(fd)
+pg_fsync(int fd)
{
extern int fsyncOff;
return fsyncOff ? 0 : fsync(fd);
*
*
* 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
*
#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 */
*
*
* 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"
#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.
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
{
BindingEnt * result,item;
bool found;
- SHMEM_OFFSET location;
+ SHMEM_OFFSET location = 0;
Assert(BindingTable);
*
*
* 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"
#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"
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
#include "storage/lmgr.h"
#include "utils/palloc.h"
+#include "utils/mcxt.h"
#include "utils/rel.h"
#include "catalog/catname.h"
*
*
* 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
*-------------------------------------------------------------------------
*/
#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"
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
* 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>
#include "storage/buf.h"
#include "storage/lock.h"
+#include "storage/lmgr.h"
#include "storage/shmem.h"
#include "storage/spin.h"
#include "storage/proc.h"
*
*
* 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>
*
*
* 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"
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
#include "storage/shmem.h"
#include "storage/spin.h"
+#include "utils/dynahash.h"
#include "utils/hsearch.h"
#include "utils/rel.h"
#include "utils/memutils.h"
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
smgrinit()
{
int i;
- extern char *smgrout();
for (i = 0; i < NSmgr; i++) {
if (smgrsw[i].smgr_init) {
smgrshutdown(int dummy)
{
int i;
- extern char *smgrout();
for (i = 0; i < NSmgr; i++) {
if (smgrsw[i].smgr_shutdown) {
smgrcommit()
{
int i;
- extern char *smgrout();
for (i = 0; i < NSmgr; i++) {
if (smgrsw[i].smgr_commit) {
smgrabort()
{
int i;
- extern char *smgrout();
for (i = 0; i < NSmgr; i++) {
if (smgrsw[i].smgr_abort) {
# 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 $
#
#-------------------------------------------------------------------------
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
*
*
* 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.
#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"
get_groname(AclId grosysid)
{
HeapTuple htp;
- char *name;
+ char *name = NULL;
htp = SearchSysCacheTuple(GROSYSID, PointerGetDatum(grosysid),
0,0,0);
int cacheid)
{
HeapTuple htp;
- AclId user_id, owner_id;
+ AclId user_id, owner_id = 0;
htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename),
0,0,0);
*
*
* 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.
*
*-------------------------------------------------------------------------
*/
+#include <string.h>
+
#include "postgres.h"
#include "tcop/tcopdebug.h"
*
*
* 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
*-------------------------------------------------------------------------
*/
#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 */
SocketBackend(char *inBuf, int multiplexedBackend)
{
char qtype[2];
- char result;
+ char result = '\0';
/* ----------------
* get input from the frontend
int flagE;
int flag;
- char *DBName;
+ char *DBName = NULL;
int errs = 0;
char firstchar;
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;
#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);
*/
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 $");
}
/* ----------------
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,
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,
*
*
* 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"
bool isRetrieveIntoPortal;
bool isRetrieveIntoRelation;
- char* intoName;
+ char* intoName = NULL;
CommandDest dest;
/* ----------------
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
#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"
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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);
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);
int i, nitems, dummy;
int32 nbytes;
char *dataPtr;
- ArrayType *retval;
+ ArrayType *retval = NULL;
int ndim, dim[MAXDIM], lBound[MAXDIM];
char typalign;
* Read data about an array to be stored as a large object
*----------------------------------------------------------------------------
*/
+#ifdef LOARRAY
static char *
_ReadLOArray(char *str,
int *nbytes,
}
return(retStr);
}
+#endif
static void
_CopyArrayEls(char **values,
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) {
if (ARR_IS_LO(array)) {
char * lo_name;
- int fd;
+ int fd = 0;
/* We are assuming fixed element lengths here */
offset *= elmlen;
#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");
}
/*-----------------------------------------------------------------------------
- * 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 :
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 */
elog(WARN, "lowerIndex larger than upperIndx");
if (ARR_IS_LO(array)) {
- int fd, newfd;
+ int fd = 0, newfd = 0;
#ifdef LOARRAY
char * lo_name;
return(inc);
}
+#ifdef LOARRAY
static char *
_AdvanceBy1word(char *str, char **word)
{
retstr = NULL;
return retstr;
}
+#endif
int
SanityCheckInput(int ndim, int n, int dim[], int lb[], int indx[])
{
#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;
*
*
* 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>
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 ---
int *nbytes,
char *chunkfile)
{
- int cfd;
+#ifdef LOARRAY
+int cfd = 0;
+#endif
int chunk[MAXDIM], csize;
bool reorgFlag;
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);
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[])
*
*-------------------------------------------------------------------------
*/
+#ifdef LOARRAY
static void
_ConvertToChunkFile(int n,
int baseSize,
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
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)
return(1);
}
+#endif /* LOARRAY */
/*----------------------------------------------------------------------------
* _ReadChunkArray --
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
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
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
{
struct varlena *s;
- Size size;
+ Size size = 0;
if (byVal) {
if (len >= 0 && len <= sizeof(Datum)) {
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
filename_in(char *file)
{
char *str, *getenv();
- int ind;
+ int ind = 0;
/*
* XXX - HACK CITY --- REDO
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
* 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 */
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
HeapScanDesc procscan;
HeapTuple proctup;
ScanKeyData key;
- RegProcedure result;
+ RegProcedure result = (Oid)0;
bool isnull;
if (proname == NULL)
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
char *procname = GENERICSETNAME;
char *fileName = "-";
char realprocname[16];
- HeapTuple tup, newtup;
+ HeapTuple tup, newtup = NULL;
Form_pg_proc proc;
Relation procrel;
int i;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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))
*
*
* 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
CatCTup *nct;
CatCTup *nct2;
Dlelem *elt;
- HeapTuple ntp;
+ HeapTuple ntp = 0;
Buffer buffer;
Relation relation;
*
*
* 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...
*
void (*function)())
{
Oid relationId;
- Oid objectId;
+ Oid objectId = (Oid)0;
/* ----------------
* get the relation object id
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
#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;
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 */
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
# include <sys/types.h>
# include <string.h>
# include "postgres.h"
+# include "utils/dynahash.h"
# include "utils/hsearch.h"
#ifndef FRONTEND
# include "utils/mcxt.h"
*/
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);
/********************** DESTROY ROUTINES ************************/
-static int
-hash_clear(HTAB *hashp)
-{
- elog(NOTICE,"hash_clear not implemented\n");
- return 0;
-}
-
-
void
hash_destroy (HTAB *hashp)
{
*
*
* 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
char *getenv(); /* XXX style */
char *postid;
char *postport;
- IPCKey key;
+ IPCKey key = 0;
/* ----------------
* try and get the backend tag from POSTID
*
*
* 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
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 */
}
/*
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
Size size);
static char *GlobalMemoryGetName(GlobalMemory this);
static void GlobalMemoryDump(GlobalMemory this);
+#ifdef NOT_USED
static void DumpGlobalMemories(void);
-
+#endif
/*
* Global Memory Methods
* Exceptions:
* ???
*/
+#ifdef NOT_USED
static void
DumpGlobalMemories()
{
&context->elemData);
}
}
-
+#endif
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
* PortalDump
* ----------------
*/
+#ifdef NOT_USED
static void
PortalDump(Portal *thisP)
{
PortalVariableMemoryDump(PortalGetVariableMemory(*thisP));
PortalHeapMemoryDump(PortalGetHeapMemory(*thisP));
}
+#endif
/* ----------------
* DumpPortals
* ----------------
*/
+#ifdef NOT_USED
static void
DumpPortals()
{
HashTableWalk(PortalHashTable, PortalDump, 0);
}
-
+#endif
+
/* ----------------------------------------------------------------
* public portal interface functions
* ----------------------------------------------------------------
*
*
* 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
*
void
setMaxOid(FILE *fout)
{
- char query[255];
PGresult *res;
Oid max_oid;
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");
}
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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);
*
*
* 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;
#
#
# 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 $
#
#-------------------------------------------------------------------------
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:
*
*
* 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"
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) {
*
* 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 */
uint16 nparams,
Datum *params,
FuncIndexInfo *finfo,
- PredInfo *predInfo);
+ PredInfo *predInfo);
extern void err_out(void);
extern void InsertOneTuple(Oid objectid);
*
* 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);
/* 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
*
* 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);
*
* 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 $
*
*-------------------------------------------------------------------------
*/
extern void FreeFile(void);
extern void closeAllVfds(void);
extern void closeOneVfd(void);
+extern int pg_fsync(int fd);
#endif /* FD_H */
*
* 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 $
*
*-------------------------------------------------------------------------
*/
extern bool SingleLockPage(LockInfo linfo, ItemPointer tidPtr,
LOCKT lockt, int action);
+/* proc.c */
+extern void InitProcGlobal(IPCKey key);
+
#endif /* LMGR_H */
*
* 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 $
*
*-------------------------------------------------------------------------
*/
extern int mmabort(void);
extern int MMShmemSize(void);
+/* smgrtype.c */
+char *smgrout(int2 i);
+
#endif /* SMGR_H */
#
#
# 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 $
#
#-------------------------------------------------------------------------
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
../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
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
*
*
* 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>
*
*
* 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
*
*-------------------------------------------------------------------------
*/
+#include <stdlib.h>
+
#include "libpq/pqsignal.h"
pqsigfunc