Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb38d565

Browse files
committed
D'Arcy's recent cleanups
1 parentb8003d0 commitb38d565

File tree

11 files changed

+46
-25
lines changed

11 files changed

+46
-25
lines changed

‎src/backend/catalog/index.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.7 1996/11/06 07:31:21 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.8 1996/11/08 00:44:30 scrappy Exp $
1111
*
1212
*
1313
* INTERFACE ROUTINES
@@ -1514,6 +1514,12 @@ DefaultBuild(Relation heapRelation,
15141514
econtext=makeNode(ExprContext);
15151515
FillDummyExprContext(econtext,slot,heapDescriptor,buffer);
15161516
}
1517+
else
1518+
{
1519+
econtext=NULL;
1520+
tupleTable=0;
1521+
slot=NULL;
1522+
}
15171523
#endif/* OMIT_PARTIAL_INDEX */
15181524

15191525
/* ----------------

‎src/backend/catalog/pg_aggregate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.3 1996/11/06 07:31:23 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.4 1996/11/08 00:44:32 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -286,7 +286,7 @@ AggNameGetInitVal(char *aggName, Oid basetype, int xfuncno, bool *isNull)
286286
transtype= ((Form_pg_aggregate)GETSTRUCT(tup))->aggtranstype1;
287287
initValAttno=Anum_pg_aggregate_agginitval1;
288288
}
289-
elseif (xfuncno==2) {
289+
else/* can only be 1 or 2 */ {
290290
transtype= ((Form_pg_aggregate)GETSTRUCT(tup))->aggtranstype2;
291291
initValAttno=Anum_pg_aggregate_agginitval2;
292292
}

‎src/backend/catalog/pg_operator.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.5 1996/11/06 07:31:24 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.6 1996/11/08 00:44:33 scrappy Exp $
1111
*
1212
* NOTES
1313
* these routines moved here from commands/define.c and somewhat cleaned up.
@@ -452,7 +452,7 @@ OperatorDef(char *operatorName,
452452
charnulls[Natts_pg_operator ];
453453
charreplaces[Natts_pg_operator ];
454454
Datumvalues[Natts_pg_operator ];
455-
Oidother_oid;
455+
Oidother_oid=0;
456456
OidoperatorObjectId;
457457
OidleftTypeId=InvalidOid;
458458
OidrightTypeId=InvalidOid;
@@ -958,21 +958,25 @@ OperatorCreate(char *operatorName,
958958
commObjectId=OperatorGet(commutatorName,/* commute type order */
959959
rightTypeName,
960960
leftTypeName);
961+
elsecommObjectId=0;
961962

962963
if (negatorName)
963964
negObjectId=OperatorGet(negatorName,
964965
leftTypeName,
965966
rightTypeName);
967+
elsenegObjectId=0;
966968

967969
if (leftSortName)
968970
leftSortObjectId=OperatorGet(leftSortName,
969971
leftTypeName,
970972
rightTypeName);
973+
elseleftSortObjectId=0;
971974

972975
if (rightSortName)
973976
rightSortObjectId=OperatorGet(rightSortName,
974977
rightTypeName,
975978
leftTypeName);
979+
elserightSortObjectId=0;
976980

977981
/* ----------------
978982
* Use OperatorDef() to define the specified operator and

‎src/backend/catalog/pg_proc.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.4 1996/11/06 07:31:25 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.5 1996/11/08 00:44:34 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -92,7 +92,6 @@ ProcedureCreate(char *procedureName,
9292
if (strcmp(languageName,"sql")==0) {
9393
elog(WARN,"ProcedureDefine: sql functions cannot take type \"opaque\"");
9494
}
95-
else
9695
toid=0;
9796
}else {
9897
toid=TypeGet(strVal(t),&defined);
@@ -151,7 +150,6 @@ ProcedureCreate(char *procedureName,
151150
if (strcmp(languageName,"sql")==0) {
152151
elog(WARN,"ProcedureCreate: sql functions cannot return type \"opaque\"");
153152
}
154-
else
155153
typeObjectId=0;
156154
}
157155

‎src/backend/commands/copy.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
*
88
* IDENTIFICATION
9-
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.14 1996/11/06 08:21:31 scrappy Exp $
9+
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.15 1996/11/08 00:45:22 scrappy Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -130,9 +130,9 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
130130
}elsefp=stdout;
131131
}else {
132132
mode_toumask;/* Pre-existing umask value */
133-
(void)umask((mode_t)0);
133+
oumask=umask((mode_t)0);
134134
fp=fopen(filename,"w");
135-
(void)umask(oumask);
135+
umask(oumask);
136136
if (fp==NULL)
137137
elog(WARN,"COPY command, running in backend with "
138138
"effective uid %d, could not open file '%s' for ",

‎src/backend/executor/execAmi.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.3 1996/11/06 06:47:26 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.4 1996/11/08 00:45:54 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -37,7 +37,11 @@
3737
#include"executor/nodeIndexscan.h"
3838
#include"executor/nodeSort.h"
3939
#include"executor/nodeTee.h"
40+
#include"executor/execdebug.h"
4041
#include"optimizer/internal.h"/* for _TEMP_RELATION_ID_ */
42+
#include"access/genam.h"
43+
#include"access/heapam.h"
44+
#include"catalog/heap.h"
4145

4246
/* ----------------------------------------------------------------
4347
* ExecOpenScanR
@@ -401,7 +405,7 @@ ExecCreatR(TupleDesc tupType,
401405
{
402406
RelationrelDesc;
403407

404-
EU4_printf("ExecCreatR: %s type=%d oid=%d\n",
408+
EU3_printf("ExecCreatR: %s type=%d oid=%d\n",
405409
"entering: ",tupType,relationOid);
406410
CXT1_printf("ExecCreatR: context is %d\n",CurrentMemoryContext);
407411

‎src/backend/executor/nodeIndexscan.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.4 1996/11/06 06:47:42 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.5 1996/11/08 00:45:57 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -593,14 +593,12 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
593593
n_keys=length(qual);
594594
scan_keys= (n_keys <=0) ?NULL :
595595
(ScanKey)palloc(n_keys*sizeof(ScanKeyData));
596+
run_keys= (n_keys <=0) ?NULL :
597+
(int*)palloc(n_keys*sizeof(int));
596598

597599
CXT1_printf("ExecInitIndexScan: context is %d\n",
598600
CurrentMemoryContext);
599601

600-
if (n_keys>0) {
601-
run_keys= (int*)palloc(n_keys*sizeof(int));
602-
}
603-
604602
/* ----------------
605603
* for each opclause in the given qual,
606604
* convert each qual's opclause into a single scan key
@@ -613,9 +611,9 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
613611
Node*rightop;/* expr on rhs ... */
614612

615613
intscanvar;/* which var identifies varattno */
616-
AttrNumbervarattno;/* att number used in scan */
614+
AttrNumbervarattno=0;/* att number used in scan */
617615
Oidopid;/* operator id used in scan */
618-
Datumscanvalue;/* value used in scan (if const) */
616+
Datumscanvalue=0;/* value used in scan (if const) */
619617

620618
/* ----------------
621619
*extract clause information from the qualification

‎src/backend/executor/nodeMaterial.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.4 1996/11/06 06:47:44 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.5 1996/11/08 00:45:58 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -190,7 +190,7 @@ ExecInitMaterial(Material *node, EState *estate, Plan *parent)
190190
Plan*outerPlan;
191191
TupleDesctupType;
192192
RelationtempDesc;
193-
intlen;
193+
/*intlen; */
194194

195195
/* ----------------
196196
* assign the node's execution state

‎src/backend/executor/nodeMergejoin.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.3 1996/11/06 06:47:45 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.4 1996/11/08 00:45:59 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -80,6 +80,7 @@
8080
#include"executor/executor.h"
8181
#include"executor/execdefs.h"
8282
#include"executor/nodeMergejoin.h"
83+
#include"executor/execdebug.h"
8384
#include"utils/lsyscache.h"
8485

8586
/* ----------------------------------------------------------------

‎src/backend/executor/nodeTee.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*ExecEndTee
1616
*
1717
* IDENTIFICATION
18-
* $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.3 1996/11/06 06:47:46 scrappy Exp $
18+
* $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.4 1996/11/08 00:46:01 scrappy Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -32,7 +32,9 @@
3232
#include"executor/executor.h"
3333
#include"executor/nodeTee.h"
3434
#include"catalog/catalog.h"
35+
#include"catalog/heap.h"
3536
#include"tcop/pquery.h"
37+
#include"access/heapam.h"
3638

3739
/* ------------------------------------------------------------------
3840
*ExecInitTee
@@ -484,6 +486,8 @@ ExecEndTee(Tee* node, Plan* parent)
484486
orig=CurrentMemoryContext;
485487
MemoryContextSwitchTo(teeState->tee_mcxt);
486488
}
489+
else
490+
orig=0;
487491

488492
if (teeState->tee_leftScanDesc)
489493
{

‎src/include/executor/execdebug.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: execdebug.h,v 1.1 1996/08/28 07:22:06 scrappy Exp $
9+
* $Id: execdebug.h,v 1.2 1996/11/08 00:46:14 scrappy Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
1313
#ifndefEXECDEBUG_H
1414
#defineEXECDEBUG_H
1515

16+
#include"access/printtup.h"
17+
1618
/* ----------------------------------------------------------------
1719
*debugging defines.
1820
*
@@ -221,11 +223,15 @@ extern int NIndexTupleInserted;
221223
#defineEU_nodeDisplay(l)nodeDisplay(l, 0)
222224
#defineEU_printf(s)printf(s)
223225
#defineEU1_printf(s,a)printf(s, a)
226+
#defineEU2_printf(s,a)printf(s, a, b)
227+
#defineEU3_printf(s,a)printf(s, a, b, c)
224228
#defineEU4_printf(s,a,b,c,d)printf(s, a, b, c, d)
225229
#else
226230
#defineEU_nodeDisplay(l)
227231
#define EU_printf(s)
228232
#defineEU1_printf(s,a)
233+
#define EU2_printf(s, a, b)
234+
#defineEU3_printf(s,a,b,c)
229235
#defineEU4_printf(s,a,b,c,d)
230236
#endif/* EXEC_UTILSDEBUG */
231237

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp