D'Arcy's recent cleanups

This commit is contained in:
Marc G. Fournier 1996-11-08 00:46:14 +00:00
parent b8003d098b
commit b38d565fc3
11 changed files with 46 additions and 25 deletions

View 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 */
/* ----------------

View 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;
}

View 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

View 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;
}

View 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 ",

View 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 $
*
*-------------------------------------------------------------------------
*/
@ -37,7 +37,11 @@
#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);

View 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

View 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

View 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"
/* ----------------------------------------------------------------

View 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)
{

View 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 */