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

Commit9a0dd4f

Browse files
committed
There's a patch attached to fix gcc 2.8.x warnings, except for the
yyerror ones from bison. It also includes a few 'enhancements' tothe C programming style (which are, of course, personal).The other patch removes the compilation of backend/lib/qsort.c, asqsort() is a standard function in stdlib.h and can be used anywhere else (and it is). It was only used inbackend/optimizer/geqo/geqo_pool.c, backend/optimizer/path/predmig.c,and backend/storage/page/bufpage.c> > Some or all of these changes might not be appropriate for v6.3,since we > > are in beta testing and since they do not affect thecurrent functionality. > > For those cases, how about submittingpatches based on the final v6.3 > > release?There's more to come. Please review these patches. I ran theregression tests and they only failed where this was expected(random, geo, etc).Cheers,Jeroen
1 parentc579ce0 commit9a0dd4f

File tree

17 files changed

+86
-397
lines changed

17 files changed

+86
-397
lines changed

‎src/backend/commands/copy.c

Lines changed: 3 additions & 1 deletion
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.44 1998/02/26 04:30:52 momjian Exp $
9+
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.45 1998/03/30 16:45:55 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -1160,6 +1160,7 @@ CopyAttributeOut(FILE *fp, char *string, char *delim)
11601160
(c=='\\'&& !is_array))
11611161
fputc('\\',fp);
11621162
elseif (c=='\\'&&is_array)
1163+
{
11631164
if (*(string+1)=='\\')
11641165
{
11651166
/* translate \\ to \\\\ */
@@ -1174,6 +1175,7 @@ CopyAttributeOut(FILE *fp, char *string, char *delim)
11741175
fputc('\\',fp);
11751176
fputc('\\',fp);
11761177
}
1178+
}
11771179
fputc(*string,fp);
11781180
}
11791181
}

‎src/backend/commands/sequence.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,18 +499,22 @@ init_params(CreateSeqStmt *seq, SequenceTupleForm new)
499499
elog(ERROR,"DefineSequence: can't INCREMENT by 0");
500500

501501
if (max_value== (DefElem*)NULL)/* MAXVALUE */
502+
{
502503
if (new->increment_by>0)
503504
new->max_value=SEQ_MAXVALUE;/* ascending seq */
504505
else
505506
new->max_value=-1;/* descending seq */
507+
}
506508
else
507509
new->max_value=get_param(max_value);
508510

509511
if (min_value== (DefElem*)NULL)/* MINVALUE */
512+
{
510513
if (new->increment_by>0)
511514
new->min_value=1;/* ascending seq */
512515
else
513516
new->min_value=SEQ_MINVALUE;/* descending seq */
517+
}
514518
else
515519
new->min_value=get_param(min_value);
516520

@@ -519,10 +523,12 @@ init_params(CreateSeqStmt *seq, SequenceTupleForm new)
519523
new->min_value,new->max_value);
520524

521525
if (last_value== (DefElem*)NULL)/* START WITH */
526+
{
522527
if (new->increment_by>0)
523528
new->last_value=new->min_value;/* ascending seq */
524529
else
525530
new->last_value=new->max_value;/* descending seq */
531+
}
526532
else
527533
new->last_value=get_param(last_value);
528534

‎src/backend/commands/variable.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Routines for handling of 'SET var TO',
33
*'SHOW var' and 'RESET var' statements.
44
*
5-
* $Id: variable.c,v 1.4 1998/02/26 04:31:05 momjian Exp $
5+
* $Id: variable.c,v 1.5 1998/03/30 16:45:59 momjian Exp $
66
*
77
*/
88

@@ -444,13 +444,15 @@ parse_timezone(const char *value)
444444
{
445445
/* Not yet tried to save original value from environment? */
446446
if (defaultTZ==NULL)
447+
{
447448
/* found something? then save it for later */
448449
if ((defaultTZ=getenv("TZ"))!=NULL)
449450
strcpy(TZvalue,defaultTZ);
450451

451-
/* found nothing so mark with an invalid pointer */
452+
/* found nothing so mark with an invalid pointer */
452453
else
453454
defaultTZ= (char*)-1;
455+
}
454456

455457
strcpy(tzbuf,"TZ=");
456458
strcat(tzbuf,tok);

‎src/backend/executor/nodeIndexscan.c

Lines changed: 36 additions & 52 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.16 1998/02/26 12:13:11 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.17 1998/03/30 16:46:08 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -91,7 +91,6 @@ IndexNext(IndexScan *node)
9191
IndexScanDescscandesc;
9292
RelationheapRelation;
9393
RetrieveIndexResultresult;
94-
ItemPointeriptr;
9594
HeapTupletuple;
9695
TupleTableSlot*slot;
9796
Bufferbuffer=InvalidBuffer;
@@ -116,58 +115,47 @@ IndexNext(IndexScan *node)
116115
* ----------------
117116
*/
118117

119-
for (;;)
118+
/* ----------------
119+
*if scanning this index succeeded then return the
120+
*appropriate heap tuple.. else return NULL.
121+
* ----------------
122+
*/
123+
while ((result=index_getnext(scandesc,direction))!=NULL)
120124
{
121-
result=index_getnext(scandesc,direction);
122-
/* ----------------
123-
*if scanning this index succeeded then return the
124-
*appropriate heap tuple.. else return NULL.
125-
* ----------------
126-
*/
127-
if (result)
128-
{
129-
iptr=&result->heap_iptr;
130-
tuple=heap_fetch(heapRelation,
131-
false,
132-
iptr,
133-
&buffer);
134-
/* be tidy */
135-
pfree(result);
136-
137-
if (tuple==NULL)
138-
{
139-
/* ----------------
140-
* we found a deleted tuple, so keep on scanning..
141-
* ----------------
142-
*/
143-
if (BufferIsValid(buffer))
144-
ReleaseBuffer(buffer);
145-
continue;
146-
}
125+
tuple=heap_fetch(heapRelation, false,&result->heap_iptr,&buffer);
126+
/* be tidy */
127+
pfree(result);
147128

129+
if (tuple!=NULL)
130+
{
148131
/* ----------------
149-
*store the scanned tuple in the scan tuple slot of
150-
*the scan state. Eventually we will only do this and not
151-
*return a tuple. Note: we pass 'false' because tuples
152-
*returned by amgetnext are pointers onto disk pages and
153-
*were not created with palloc() and so should not be pfree()'d.
154-
* ----------------
155-
*/
132+
*store the scanned tuple in the scan tuple slot of
133+
*the scan state. Eventually we will only do this and not
134+
*return a tuple. Note: we pass 'false' because tuples
135+
*returned by amgetnext are pointers onto disk pages and
136+
*were not created with palloc() and so should not be pfree()'d.
137+
* ----------------
138+
*/
156139
ExecStoreTuple(tuple,/* tuple to store */
157-
slot,/* slot to store in */
158-
buffer,/* buffer associated with tuple */
159-
false);/* don't pfree */
160-
140+
slot,/* slot to store in */
141+
buffer,/* buffer associated with tuple */
142+
false);/* don't pfree */
143+
161144
returnslot;
162145
}
163-
164-
/* ----------------
165-
*if we get here it means the index scan failed so we
166-
*are at the end of the scan..
167-
* ----------------
168-
*/
169-
returnExecClearTuple(slot);
146+
else
147+
{
148+
if (BufferIsValid(buffer))
149+
ReleaseBuffer(buffer);
150+
}
170151
}
152+
153+
/* ----------------
154+
*if we get here it means the index scan failed so we
155+
*are at the end of the scan..
156+
* ----------------
157+
*/
158+
returnExecClearTuple(slot);
171159
}
172160

173161
/* ----------------------------------------------------------------
@@ -194,14 +182,11 @@ IndexNext(IndexScan *node)
194182
TupleTableSlot*
195183
ExecIndexScan(IndexScan*node)
196184
{
197-
TupleTableSlot*returnTuple;
198-
199185
/* ----------------
200186
*use IndexNext as access method
201187
* ----------------
202188
*/
203-
returnTuple=ExecScan(&node->scan,IndexNext);
204-
returnreturnTuple;
189+
returnExecScan(&node->scan,IndexNext);
205190
}
206191

207192
/* ----------------------------------------------------------------
@@ -377,7 +362,6 @@ ExecEndIndexScan(IndexScan *node)
377362
{
378363
if (scanKeys[i]!=NULL)
379364
pfree(scanKeys[i]);
380-
381365
}
382366

383367
/* ----------------

‎src/backend/executor/nodeSeqscan.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSeqscan.c,v 1.8 1997/11/20 23:21:34 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSeqscan.c,v 1.9 1998/03/30 16:46:15 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -128,8 +128,7 @@ ExecSeqScan(SeqScan *node)
128128
* else, scan the relation
129129
* ----------------
130130
*/
131-
outerPlan=outerPlan((Plan*)node);
132-
if (outerPlan)
131+
if ((outerPlan=outerPlan((Plan*)node))!=NULL)
133132
{
134133
slot=ExecProcNode(outerPlan, (Plan*)node);
135134
}
@@ -375,8 +374,7 @@ ExecSeqReScan(SeqScan *node, ExprContext *exprCtxt, Plan *parent)
375374
scanstate=node->scanstate;
376375
estate=node->plan.state;
377376

378-
outerPlan=outerPlan((Plan*)node);
379-
if (outerPlan)
377+
if ((outerPlan=outerPlan((Plan*)node))!=NULL)
380378
{
381379
/* we are scanning a subplan */
382380
outerPlan=outerPlan((Plan*)node);

‎src/backend/lib/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for lib (miscellaneous stuff)
55
#
66
# IDENTIFICATION
7-
# $Header: /cvsroot/pgsql/src/backend/lib/Makefile,v 1.9 1997/12/20 00:23:48 scrappy Exp $
7+
# $Header: /cvsroot/pgsql/src/backend/lib/Makefile,v 1.10 1998/03/30 16:46:24 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -15,7 +15,7 @@ INCLUDE_OPT = -I..
1515

1616
CFLAGS+=$(INCLUDE_OPT)
1717

18-
OBJS = bit.o fstack.o hasht.o lispsort.oqsort.ostringinfo.o dllist.o
18+
OBJS = bit.o fstack.o hasht.o lispsort.o stringinfo.o dllist.o
1919

2020
all: SUBSYS.o
2121

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp