Commit b38d565f authored by Marc G. Fournier's avatar Marc G. Fournier

D'Arcy's recent cleanups

parent b8003d09
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * INTERFACE ROUTINES
...@@ -1514,6 +1514,12 @@ DefaultBuild(Relation heapRelation, ...@@ -1514,6 +1514,12 @@ DefaultBuild(Relation heapRelation,
econtext = makeNode(ExprContext); econtext = makeNode(ExprContext);
FillDummyExprContext(econtext, slot, heapDescriptor, buffer); FillDummyExprContext(econtext, slot, heapDescriptor, buffer);
} }
else
{
econtext = NULL;
tupleTable = 0;
slot = NULL;
}
#endif /* OMIT_PARTIAL_INDEX */ #endif /* OMIT_PARTIAL_INDEX */
/* ---------------- /* ----------------
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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) ...@@ -286,7 +286,7 @@ AggNameGetInitVal(char *aggName, Oid basetype, int xfuncno, bool *isNull)
transtype = ((Form_pg_aggregate) GETSTRUCT(tup))->aggtranstype1; transtype = ((Form_pg_aggregate) GETSTRUCT(tup))->aggtranstype1;
initValAttno = Anum_pg_aggregate_agginitval1; initValAttno = Anum_pg_aggregate_agginitval1;
} }
else if (xfuncno == 2) { else /* can only be 1 or 2 */ {
transtype = ((Form_pg_aggregate) GETSTRUCT(tup))->aggtranstype2; transtype = ((Form_pg_aggregate) GETSTRUCT(tup))->aggtranstype2;
initValAttno = Anum_pg_aggregate_agginitval2; initValAttno = Anum_pg_aggregate_agginitval2;
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* these routines moved here from commands/define.c and somewhat cleaned up. * these routines moved here from commands/define.c and somewhat cleaned up.
...@@ -452,7 +452,7 @@ OperatorDef(char *operatorName, ...@@ -452,7 +452,7 @@ OperatorDef(char *operatorName,
char nulls[ Natts_pg_operator ]; char nulls[ Natts_pg_operator ];
char replaces[ Natts_pg_operator ]; char replaces[ Natts_pg_operator ];
Datum values[ Natts_pg_operator ]; Datum values[ Natts_pg_operator ];
Oid other_oid; Oid other_oid = 0;
Oid operatorObjectId; Oid operatorObjectId;
Oid leftTypeId = InvalidOid; Oid leftTypeId = InvalidOid;
Oid rightTypeId = InvalidOid; Oid rightTypeId = InvalidOid;
...@@ -958,21 +958,25 @@ OperatorCreate(char *operatorName, ...@@ -958,21 +958,25 @@ OperatorCreate(char *operatorName,
commObjectId = OperatorGet(commutatorName, /* commute type order */ commObjectId = OperatorGet(commutatorName, /* commute type order */
rightTypeName, rightTypeName,
leftTypeName); leftTypeName);
else commObjectId = 0;
if (negatorName) if (negatorName)
negObjectId = OperatorGet(negatorName, negObjectId = OperatorGet(negatorName,
leftTypeName, leftTypeName,
rightTypeName); rightTypeName);
else negObjectId = 0;
if (leftSortName) if (leftSortName)
leftSortObjectId = OperatorGet(leftSortName, leftSortObjectId = OperatorGet(leftSortName,
leftTypeName, leftTypeName,
rightTypeName); rightTypeName);
else leftSortObjectId = 0;
if (rightSortName) if (rightSortName)
rightSortObjectId = OperatorGet(rightSortName, rightSortObjectId = OperatorGet(rightSortName,
rightTypeName, rightTypeName,
leftTypeName); leftTypeName);
else rightSortObjectId = 0;
/* ---------------- /* ----------------
* Use OperatorDef() to define the specified operator and * Use OperatorDef() to define the specified operator and
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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, ...@@ -92,7 +92,6 @@ ProcedureCreate(char *procedureName,
if (strcmp(languageName, "sql") == 0) { if (strcmp(languageName, "sql") == 0) {
elog(WARN, "ProcedureDefine: sql functions cannot take type \"opaque\""); elog(WARN, "ProcedureDefine: sql functions cannot take type \"opaque\"");
} }
else
toid = 0; toid = 0;
} else { } else {
toid = TypeGet(strVal(t), &defined); toid = TypeGet(strVal(t), &defined);
...@@ -151,7 +150,6 @@ ProcedureCreate(char *procedureName, ...@@ -151,7 +150,6 @@ ProcedureCreate(char *procedureName,
if (strcmp(languageName, "sql") == 0) { if (strcmp(languageName, "sql") == 0) {
elog(WARN, "ProcedureCreate: sql functions cannot return type \"opaque\""); elog(WARN, "ProcedureCreate: sql functions cannot return type \"opaque\"");
} }
else
typeObjectId = 0; typeObjectId = 0;
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* *
* IDENTIFICATION * 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, ...@@ -130,9 +130,9 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
} else fp = stdout; } else fp = stdout;
} else { } else {
mode_t oumask; /* Pre-existing umask value */ mode_t oumask; /* Pre-existing umask value */
(void) umask((mode_t) 0); oumask = umask((mode_t) 0);
fp = fopen(filename, "w"); fp = fopen(filename, "w");
(void) umask(oumask); umask(oumask);
if (fp == NULL) if (fp == NULL)
elog(WARN, "COPY command, running in backend with " elog(WARN, "COPY command, running in backend with "
"effective uid %d, could not open file '%s' for ", "effective uid %d, could not open file '%s' for ",
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -37,7 +37,11 @@ ...@@ -37,7 +37,11 @@
#include "executor/nodeIndexscan.h" #include "executor/nodeIndexscan.h"
#include "executor/nodeSort.h" #include "executor/nodeSort.h"
#include "executor/nodeTee.h" #include "executor/nodeTee.h"
#include "executor/execdebug.h"
#include "optimizer/internal.h" /* for _TEMP_RELATION_ID_ */ #include "optimizer/internal.h" /* for _TEMP_RELATION_ID_ */
#include "access/genam.h"
#include "access/heapam.h"
#include "catalog/heap.h"
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
* ExecOpenScanR * ExecOpenScanR
...@@ -401,7 +405,7 @@ ExecCreatR(TupleDesc tupType, ...@@ -401,7 +405,7 @@ ExecCreatR(TupleDesc tupType,
{ {
Relation relDesc; Relation relDesc;
EU4_printf("ExecCreatR: %s type=%d oid=%d\n", EU3_printf("ExecCreatR: %s type=%d oid=%d\n",
"entering: ", tupType, relationOid); "entering: ", tupType, relationOid);
CXT1_printf("ExecCreatR: context is %d\n", CurrentMemoryContext); CXT1_printf("ExecCreatR: context is %d\n", CurrentMemoryContext);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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) ...@@ -593,14 +593,12 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
n_keys = length(qual); n_keys = length(qual);
scan_keys = (n_keys <= 0) ? NULL : scan_keys = (n_keys <= 0) ? NULL :
(ScanKey)palloc(n_keys * sizeof(ScanKeyData)); (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", CXT1_printf("ExecInitIndexScan: context is %d\n",
CurrentMemoryContext); CurrentMemoryContext);
if (n_keys > 0) {
run_keys = (int *) palloc(n_keys * sizeof(int));
}
/* ---------------- /* ----------------
* for each opclause in the given qual, * for each opclause in the given qual,
* convert each qual's opclause into a single scan key * convert each qual's opclause into a single scan key
...@@ -613,9 +611,9 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent) ...@@ -613,9 +611,9 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
Node *rightop; /* expr on rhs ... */ Node *rightop; /* expr on rhs ... */
int scanvar; /* which var identifies varattno */ 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 */ 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 * extract clause information from the qualification
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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) ...@@ -190,7 +190,7 @@ ExecInitMaterial(Material *node, EState *estate, Plan *parent)
Plan *outerPlan; Plan *outerPlan;
TupleDesc tupType; TupleDesc tupType;
Relation tempDesc; Relation tempDesc;
int len; /* int len; */
/* ---------------- /* ----------------
* assign the node's execution state * assign the node's execution state
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 @@ ...@@ -80,6 +80,7 @@
#include "executor/executor.h" #include "executor/executor.h"
#include "executor/execdefs.h" #include "executor/execdefs.h"
#include "executor/nodeMergejoin.h" #include "executor/nodeMergejoin.h"
#include "executor/execdebug.h"
#include "utils/lsyscache.h" #include "utils/lsyscache.h"
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* ExecEndTee * ExecEndTee
* *
* IDENTIFICATION * 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 @@ ...@@ -32,7 +32,9 @@
#include "executor/executor.h" #include "executor/executor.h"
#include "executor/nodeTee.h" #include "executor/nodeTee.h"
#include "catalog/catalog.h" #include "catalog/catalog.h"
#include "catalog/heap.h"
#include "tcop/pquery.h" #include "tcop/pquery.h"
#include "access/heapam.h"
/* ------------------------------------------------------------------ /* ------------------------------------------------------------------
* ExecInitTee * ExecInitTee
...@@ -484,6 +486,8 @@ ExecEndTee(Tee* node, Plan* parent) ...@@ -484,6 +486,8 @@ ExecEndTee(Tee* node, Plan* parent)
orig = CurrentMemoryContext; orig = CurrentMemoryContext;
MemoryContextSwitchTo(teeState->tee_mcxt); MemoryContextSwitchTo(teeState->tee_mcxt);
} }
else
orig = 0;
if (teeState->tee_leftScanDesc) if (teeState->tee_leftScanDesc)
{ {
......
...@@ -6,13 +6,15 @@ ...@@ -6,13 +6,15 @@
* *
* Copyright (c) 1994, Regents of the University of California * 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 #ifndef EXECDEBUG_H
#define EXECDEBUG_H #define EXECDEBUG_H
#include "access/printtup.h"
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
* debugging defines. * debugging defines.
* *
...@@ -221,11 +223,15 @@ extern int NIndexTupleInserted; ...@@ -221,11 +223,15 @@ extern int NIndexTupleInserted;
#define EU_nodeDisplay(l) nodeDisplay(l, 0) #define EU_nodeDisplay(l) nodeDisplay(l, 0)
#define EU_printf(s) printf(s) #define EU_printf(s) printf(s)
#define EU1_printf(s, a) printf(s, a) #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) #define EU4_printf(s, a, b, c, d) printf(s, a, b, c, d)
#else #else
#define EU_nodeDisplay(l) #define EU_nodeDisplay(l)
#define EU_printf(s) #define EU_printf(s)
#define EU1_printf(s, a) #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) #define EU4_printf(s, a, b, c, d)
#endif /* EXEC_UTILSDEBUG */ #endif /* EXEC_UTILSDEBUG */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment