OSDN Git Service

D'Arcy's recent cleanups
authorMarc G. Fournier <scrappy@hub.org>
Fri, 8 Nov 1996 00:46:14 +0000 (00:46 +0000)
committerMarc G. Fournier <scrappy@hub.org>
Fri, 8 Nov 1996 00:46:14 +0000 (00:46 +0000)
src/backend/catalog/index.c
src/backend/catalog/pg_aggregate.c
src/backend/catalog/pg_operator.c
src/backend/catalog/pg_proc.c
src/backend/commands/copy.c
src/backend/executor/execAmi.c
src/backend/executor/nodeIndexscan.c
src/backend/executor/nodeMaterial.c
src/backend/executor/nodeMergejoin.c
src/backend/executor/nodeTee.c
src/include/executor/execdebug.h

index 1837576..eefa44c 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.7 1996/11/06 07:31:21 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.8 1996/11/08 00:44:30 scrappy Exp $
  *
  *
  * INTERFACE ROUTINES
@@ -1514,6 +1514,12 @@ DefaultBuild(Relation heapRelation,
        econtext = makeNode(ExprContext);
        FillDummyExprContext(econtext, slot, heapDescriptor, buffer);
     }
+       else
+       {
+               econtext = NULL;
+               tupleTable = 0;
+               slot = NULL;
+       }
 #endif /* OMIT_PARTIAL_INDEX */        
 
     /* ----------------
index fa1298d..3e03110 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.3 1996/11/06 07:31:23 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.4 1996/11/08 00:44:32 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -286,7 +286,7 @@ AggNameGetInitVal(char *aggName, Oid basetype, int xfuncno, bool *isNull)
        transtype = ((Form_pg_aggregate) GETSTRUCT(tup))->aggtranstype1;
        initValAttno = Anum_pg_aggregate_agginitval1;
     }
-    else if (xfuncno == 2) {
+    else /* can only be 1 or 2 */ {
        transtype = ((Form_pg_aggregate) GETSTRUCT(tup))->aggtranstype2;
        initValAttno = Anum_pg_aggregate_agginitval2;
     }
index 74db99f..c4a202a 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.5 1996/11/06 07:31:24 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.6 1996/11/08 00:44:33 scrappy Exp $
  *
  * NOTES
  *    these routines moved here from commands/define.c and somewhat cleaned up.
@@ -452,7 +452,7 @@ OperatorDef(char *operatorName,
     char       nulls[ Natts_pg_operator ];
     char       replaces[ Natts_pg_operator ];
     Datum       values[ Natts_pg_operator ];
-    Oid        other_oid;
+    Oid        other_oid = 0;
     Oid                operatorObjectId;
     Oid                leftTypeId = InvalidOid;
     Oid                rightTypeId = InvalidOid;
@@ -958,21 +958,25 @@ OperatorCreate(char *operatorName,
        commObjectId = OperatorGet(commutatorName,  /* commute type order */
                                   rightTypeName,
                                   leftTypeName);
+    else commObjectId = 0;
     
     if (negatorName)
        negObjectId  = OperatorGet(negatorName,
                                   leftTypeName,
                                   rightTypeName);
+    else negObjectId = 0;
     
     if (leftSortName)
        leftSortObjectId = OperatorGet(leftSortName,
                                       leftTypeName,
                                       rightTypeName);
+    else leftSortObjectId = 0;
     
     if (rightSortName)
        rightSortObjectId = OperatorGet(rightSortName,
                                        rightTypeName,
                                        leftTypeName);
+    else rightSortObjectId = 0;
     
     /* ----------------
      *  Use OperatorDef() to define the specified operator and
index 2e54d42..947bdc6 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.4 1996/11/06 07:31:25 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.5 1996/11/08 00:44:34 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -92,7 +92,6 @@ ProcedureCreate(char *procedureName,
            if (strcmp(languageName, "sql") == 0) {
                elog(WARN, "ProcedureDefine: sql functions cannot take type \"opaque\"");
            }
-           else
                toid = 0;
        } else {
            toid = TypeGet(strVal(t), &defined);
@@ -151,7 +150,6 @@ ProcedureCreate(char *procedureName,
        if (strcmp(languageName, "sql") == 0) {
            elog(WARN, "ProcedureCreate: sql functions cannot return type \"opaque\"");
        }
-       else
            typeObjectId = 0;
     }
     
index 0f593d6..535386b 100644 (file)
@@ -6,7 +6,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.14 1996/11/06 08:21:31 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.15 1996/11/08 00:45:22 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -130,9 +130,9 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
                 } else fp = stdout;
             } else {
                 mode_t oumask;  /* Pre-existing umask value */
-                (void) umask((mode_t) 0);
+                oumask =  umask((mode_t) 0);
                 fp = fopen(filename, "w");
-                (void) umask(oumask);
+                umask(oumask);
                 if (fp == NULL) 
                     elog(WARN, "COPY command, running in backend with "
                          "effective uid %d, could not open file '%s' for ",
index 0fae4f2..dedb9d3 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.3 1996/11/06 06:47:26 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.4 1996/11/08 00:45:54 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
 #include "executor/nodeIndexscan.h"
 #include "executor/nodeSort.h"
 #include "executor/nodeTee.h"
+#include "executor/execdebug.h"
 #include "optimizer/internal.h" /* for _TEMP_RELATION_ID_ */
+#include "access/genam.h"
+#include "access/heapam.h"
+#include "catalog/heap.h"
 
 /* ----------------------------------------------------------------
  *     ExecOpenScanR
@@ -401,7 +405,7 @@ ExecCreatR(TupleDesc tupType,
 {
     Relation   relDesc;
 
-    EU4_printf("ExecCreatR: %s type=%d oid=%d\n",
+    EU3_printf("ExecCreatR: %s type=%d oid=%d\n",
               "entering: ", tupType, relationOid);
     CXT1_printf("ExecCreatR: context is %d\n", CurrentMemoryContext);
     
index db918eb..12b5a9c 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.4 1996/11/06 06:47:42 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.5 1996/11/08 00:45:57 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -593,14 +593,12 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
        n_keys =        length(qual);
        scan_keys = (n_keys <= 0) ? NULL :
            (ScanKey)palloc(n_keys * sizeof(ScanKeyData));
+       run_keys = (n_keys <= 0) ? NULL :
+               (int *)palloc(n_keys * sizeof(int));
        
        CXT1_printf("ExecInitIndexScan: context is %d\n",
                    CurrentMemoryContext);
        
-       if (n_keys > 0) {
-           run_keys = (int *)  palloc(n_keys * sizeof(int));
-       }
-       
        /* ----------------
         *  for each opclause in the given qual,
         *  convert each qual's opclause into a single scan key
@@ -613,9 +611,9 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
            Node        *rightop;       /* expr on rhs ... */
            
            int         scanvar;        /* which var identifies varattno */
-           AttrNumber  varattno;       /* att number used in scan */
+           AttrNumber  varattno = 0;   /* att number used in scan */
            Oid         opid;           /* operator id used in scan */
-           Datum       scanvalue;      /* value used in scan (if const) */
+           Datum       scanvalue = 0;  /* value used in scan (if const) */
            
            /* ----------------
             *  extract clause information from the qualification
index d836ae9..282113f 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.4 1996/11/06 06:47:44 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.5 1996/11/08 00:45:58 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -190,7 +190,7 @@ ExecInitMaterial(Material *node, EState *estate, Plan *parent)
     Plan               *outerPlan;
     TupleDesc          tupType;
     Relation           tempDesc;
-    int                        len;
+    /* int                     len; */
     
     /* ----------------
      *  assign the node's execution state
index 94bf950..5124d62 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.3 1996/11/06 06:47:45 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.4 1996/11/08 00:45:59 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -80,6 +80,7 @@
 #include "executor/executor.h"
 #include "executor/execdefs.h"
 #include "executor/nodeMergejoin.h"
+#include "executor/execdebug.h"
 #include "utils/lsyscache.h"
 
 /* ----------------------------------------------------------------
index ee8be28..2ade872 100644 (file)
@@ -15,7 +15,7 @@
  *     ExecEndTee
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.3 1996/11/06 06:47:46 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.4 1996/11/08 00:46:01 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -32,7 +32,9 @@
 #include "executor/executor.h"
 #include "executor/nodeTee.h"
 #include "catalog/catalog.h"
+#include "catalog/heap.h"
 #include "tcop/pquery.h"
+#include "access/heapam.h"
 
 /* ------------------------------------------------------------------
  *     ExecInitTee
@@ -484,6 +486,8 @@ ExecEndTee(Tee* node, Plan* parent)
            orig = CurrentMemoryContext;
            MemoryContextSwitchTo(teeState->tee_mcxt);
          }
+         else
+               orig = 0;
 
          if (teeState->tee_leftScanDesc)
            {
index 29638d6..3a47ef0 100644 (file)
@@ -6,13 +6,15 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: execdebug.h,v 1.1 1996/08/28 07:22:06 scrappy Exp $
+ * $Id: execdebug.h,v 1.2 1996/11/08 00:46:14 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
 #ifndef EXECDEBUG_H
 #define EXECDEBUG_H
 
+#include "access/printtup.h"
+
 /* ----------------------------------------------------------------
  *     debugging defines.
  *
@@ -221,11 +223,15 @@ extern int     NIndexTupleInserted;
 #define EU_nodeDisplay(l)              nodeDisplay(l, 0)
 #define EU_printf(s)                   printf(s)
 #define EU1_printf(s, a)               printf(s, a)
+#define EU2_printf(s, a)               printf(s, a, b)
+#define EU3_printf(s, a)               printf(s, a, b, c)
 #define EU4_printf(s, a, b, c, d)      printf(s, a, b, c, d)
 #else
 #define EU_nodeDisplay(l)              
 #define EU_printf(s)                   
 #define EU1_printf(s, a)               
+#define EU2_printf(s, a, b)
+#define EU3_printf(s, a, b, c)
 #define EU4_printf(s, a, b, c, d)      
 #endif /* EXEC_UTILSDEBUG */