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

Commit902377c

Browse files
committed
Rename the members of CommandDest enum so they don't collide with other uses of
those names. (Debug and None were pretty bad names anyway.) I hope I catchedall uses of the names in comments too.
1 parent76c9ac8 commit902377c

File tree

13 files changed

+112
-109
lines changed

13 files changed

+112
-109
lines changed

‎src/backend/access/common/printtup.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/access/common/printtup.c,v 1.92 2005/10/15 02:49:08 momjian Exp $
12+
* $PostgreSQL: pgsql/src/backend/access/common/printtup.c,v 1.93 2005/11/03 17:11:30 alvherre Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -94,8 +94,11 @@ printtup_create_DR(CommandDest dest, Portal portal)
9494

9595
self->portal=portal;
9696

97-
/* Send T message automatically if Remote, but not if RemoteExecute */
98-
self->sendDescrip= (dest==Remote);
97+
/*
98+
* Send T message automatically if DestRemote, but not if
99+
* DestRemoteExecute
100+
*/
101+
self->sendDescrip= (dest==DestRemote);
99102

100103
self->attrinfo=NULL;
101104
self->nattrs=0;

‎src/backend/commands/async.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.126 2005/10/15 02:49:15 momjian Exp $
10+
* $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.127 2005/11/03 17:11:34 alvherre Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -994,7 +994,7 @@ ProcessIncomingNotify(void)
994994
staticvoid
995995
NotifyMyFrontEnd(char*relname,int32listenerPID)
996996
{
997-
if (whereToSendOutput==Remote)
997+
if (whereToSendOutput==DestRemote)
998998
{
999999
StringInfoDatabuf;
10001000

‎src/backend/commands/copy.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.253 2005/10/15 02:49:15 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.254 2005/11/03 17:11:34 alvherre Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -966,7 +966,7 @@ DoCopy(const CopyStmt *stmt)
966966
}
967967
if (pipe)
968968
{
969-
if (whereToSendOutput==Remote)
969+
if (whereToSendOutput==DestRemote)
970970
ReceiveCopyBegin(cstate);
971971
else
972972
cstate->copy_file=stdin;
@@ -1017,7 +1017,7 @@ DoCopy(const CopyStmt *stmt)
10171017
}
10181018
if (pipe)
10191019
{
1020-
if (whereToSendOutput==Remote)
1020+
if (whereToSendOutput==DestRemote)
10211021
cstate->fe_copy= true;
10221022
else
10231023
cstate->copy_file=stdout;

‎src/backend/commands/portalcmds.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
*
1616
* IDENTIFICATION
17-
* $PostgreSQL: pgsql/src/backend/commands/portalcmds.c,v 1.43 2005/10/15 02:49:15 momjian Exp $
17+
* $PostgreSQL: pgsql/src/backend/commands/portalcmds.c,v 1.44 2005/11/03 17:11:35 alvherre Exp $
1818
*
1919
*-------------------------------------------------------------------------
2020
*/
@@ -190,7 +190,7 @@ PerformPortalFetch(FetchStmt *stmt,
190190
return;/* keep compiler happy */
191191
}
192192

193-
/* Adjust dest if needed. MOVE wants destinationNone */
193+
/* Adjust dest if needed. MOVE wants destinationDestNone */
194194
if (stmt->ismove)
195195
dest=None_Receiver;
196196

@@ -369,7 +369,7 @@ PersistHoldablePortal(Portal portal)
369369
ExecutorRewind(queryDesc);
370370

371371
/* Change the destination to output to the tuplestore */
372-
queryDesc->dest=CreateDestReceiver(Tuplestore,portal);
372+
queryDesc->dest=CreateDestReceiver(DestTuplestore,portal);
373373

374374
/* Fetch the result set into the tuplestore */
375375
ExecutorRun(queryDesc,ForwardScanDirection,0L);

‎src/backend/executor/spi.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.143 2005/10/15 02:49:17 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.144 2005/11/03 17:11:36 alvherre Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -984,8 +984,8 @@ void
984984
SPI_cursor_fetch(Portalportal,boolforward,longcount)
985985
{
986986
_SPI_cursor_operation(portal,forward,count,
987-
CreateDestReceiver(SPI,NULL));
988-
/* we know that theSPI receiver doesn't need a destroy call */
987+
CreateDestReceiver(DestSPI,NULL));
988+
/* we know that theDestSPI receiver doesn't need a destroy call */
989989
}
990990

991991

@@ -1418,7 +1418,7 @@ _SPI_execute_plan(_SPI_plan *plan, Datum *Values, const char *Nulls,
14181418
if (!read_only)
14191419
CommandCounterIncrement();
14201420

1421-
dest=CreateDestReceiver(queryTree->canSetTag ?SPI :None,
1421+
dest=CreateDestReceiver(queryTree->canSetTag ?DestSPI :DestNone,
14221422
NULL);
14231423

14241424
if (snapshot==InvalidSnapshot)
@@ -1527,7 +1527,7 @@ _SPI_pquery(QueryDesc *queryDesc, long tcount)
15271527
res=SPI_OK_SELINTO;
15281528
queryDesc->dest=None_Receiver;/* don't output results */
15291529
}
1530-
elseif (queryDesc->dest->mydest!=SPI)
1530+
elseif (queryDesc->dest->mydest!=DestSPI)
15311531
{
15321532
/* Don't return SPI_OK_SELECT if we're discarding result */
15331533
res=SPI_OK_UTILITY;
@@ -1560,7 +1560,7 @@ _SPI_pquery(QueryDesc *queryDesc, long tcount)
15601560
_SPI_current->processed=queryDesc->estate->es_processed;
15611561
_SPI_current->lastoid=queryDesc->estate->es_lastoid;
15621562

1563-
if (operation==CMD_SELECT&&queryDesc->dest->mydest==SPI)
1563+
if (operation==CMD_SELECT&&queryDesc->dest->mydest==DestSPI)
15641564
{
15651565
if (_SPI_checktuples())
15661566
elog(ERROR,"consistency check on SPI tuple count failed");
@@ -1646,7 +1646,7 @@ _SPI_cursor_operation(Portal portal, bool forward, long count,
16461646
*/
16471647
_SPI_current->processed=nfetched;
16481648

1649-
if (dest->mydest==SPI&&_SPI_checktuples())
1649+
if (dest->mydest==DestSPI&&_SPI_checktuples())
16501650
elog(ERROR,"consistency check on SPI tuple count failed");
16511651

16521652
/* Put the result into place for access by caller */

‎src/backend/executor/tstoreReceiver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/executor/tstoreReceiver.c,v 1.14 2005/03/16 21:38:08 tgl Exp $
12+
* $PostgreSQL: pgsql/src/backend/executor/tstoreReceiver.c,v 1.15 2005/11/03 17:11:36 alvherre Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -81,7 +81,7 @@ CreateTuplestoreDestReceiver(Tuplestorestate *tStore,
8181
self->pub.rStartup=tstoreStartupReceiver;
8282
self->pub.rShutdown=tstoreShutdownReceiver;
8383
self->pub.rDestroy=tstoreDestroyReceiver;
84-
self->pub.mydest=Tuplestore;
84+
self->pub.mydest=DestTuplestore;
8585

8686
self->tstore=tStore;
8787
self->cxt=tContext;

‎src/backend/postmaster/postmaster.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.472 2005/10/22 14:27:28 adunstan Exp $
40+
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.473 2005/11/03 17:11:36 alvherre Exp $
4141
*
4242
* NOTES
4343
*
@@ -906,13 +906,13 @@ PostmasterMain(int argc, char *argv[])
906906
SysLoggerPID=SysLogger_Start();
907907

908908
/*
909-
* Reset whereToSendOutput fromDebug (its starting state) toNone. This
910-
* stops ereport from sending log messages to stderr unless
909+
* Reset whereToSendOutput fromDestDebug (its starting state) toDestNone.
910+
*Thisstops ereport from sending log messages to stderr unless
911911
* Log_destination permits. We don't do this until the postmaster is
912912
* fully launched, since startup failures may as well be reported to
913913
* stderr.
914914
*/
915-
whereToSendOutput=None;
915+
whereToSendOutput=DestNone;
916916

917917
/*
918918
* Initialize the statistics collector stuff
@@ -2654,7 +2654,7 @@ BackendRun(Port *port)
26542654
* Must do this now because authentication uses libpq to send messages.
26552655
*/
26562656
pq_init();/* initialize libpq to talk to client */
2657-
whereToSendOutput=Remote;/* now safe to ereport to client */
2657+
whereToSendOutput=DestRemote;/* now safe to ereport to client */
26582658

26592659
/*
26602660
* We arrange for a simple exit(0) if we receive SIGTERM or SIGQUIT during

‎src/backend/tcop/dest.c

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/tcop/dest.c,v 1.66 2005/10/15 02:49:26 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/tcop/dest.c,v 1.67 2005/11/03 17:11:38 alvherre Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -62,20 +62,20 @@ donothingCleanup(DestReceiver *self)
6262
*/
6363
staticDestReceiverdonothingDR= {
6464
donothingReceive,donothingStartup,donothingCleanup,donothingCleanup,
65-
None
65+
DestNone
6666
};
6767

6868
staticDestReceiverdebugtupDR= {
6969
debugtup,debugStartup,donothingCleanup,donothingCleanup,
70-
Debug
70+
DestDebug
7171
};
7272

7373
staticDestReceiverspi_printtupDR= {
7474
spi_printtup,spi_dest_startup,donothingCleanup,donothingCleanup,
75-
SPI
75+
DestSPI
7676
};
7777

78-
/* Globally available receiver forNone */
78+
/* Globally available receiver forDestNone */
7979
DestReceiver*None_Receiver=&donothingDR;
8080

8181

@@ -92,33 +92,33 @@ BeginCommand(const char *commandTag, CommandDest dest)
9292
/* ----------------
9393
*CreateDestReceiver - return appropriate receiver function set for dest
9494
*
95-
* Note: a Portal must be specified for destinationsRemote, RemoteExecute,
96-
* andTuplestore.It can be NULL for the others.
95+
* Note: a Portal must be specified for destinationsDestRemote,
96+
*DestRemoteExecute,andDestTuplestore.It can be NULL for the others.
9797
* ----------------
9898
*/
9999
DestReceiver*
100100
CreateDestReceiver(CommandDestdest,Portalportal)
101101
{
102102
switch (dest)
103103
{
104-
caseRemote:
105-
caseRemoteExecute:
104+
caseDestRemote:
105+
caseDestRemoteExecute:
106106
if (portal==NULL)
107-
elog(ERROR,"no portal specified forRemote receiver");
107+
elog(ERROR,"no portal specified forDestRemote receiver");
108108
returnprinttup_create_DR(dest,portal);
109109

110-
caseNone:
110+
caseDestNone:
111111
return&donothingDR;
112112

113-
caseDebug:
113+
caseDestDebug:
114114
return&debugtupDR;
115115

116-
caseSPI:
116+
caseDestSPI:
117117
return&spi_printtupDR;
118118

119-
caseTuplestore:
119+
caseDestTuplestore:
120120
if (portal==NULL)
121-
elog(ERROR,"no portal specified forTuplestore receiver");
121+
elog(ERROR,"no portal specified forDestTuplestore receiver");
122122
if (portal->holdStore==NULL||
123123
portal->holdContext==NULL)
124124
elog(ERROR,"portal has no holdStore");
@@ -139,15 +139,15 @@ EndCommand(const char *commandTag, CommandDest dest)
139139
{
140140
switch (dest)
141141
{
142-
caseRemote:
143-
caseRemoteExecute:
142+
caseDestRemote:
143+
caseDestRemoteExecute:
144144
pq_puttextmessage('C',commandTag);
145145
break;
146146

147-
caseNone:
148-
caseDebug:
149-
caseSPI:
150-
caseTuplestore:
147+
caseDestNone:
148+
caseDestDebug:
149+
caseDestSPI:
150+
caseDestTuplestore:
151151
break;
152152
}
153153
}
@@ -169,8 +169,8 @@ NullCommand(CommandDest dest)
169169
{
170170
switch (dest)
171171
{
172-
caseRemote:
173-
caseRemoteExecute:
172+
caseDestRemote:
173+
caseDestRemoteExecute:
174174

175175
/*
176176
* tell the fe that we saw an empty query string. In protocols
@@ -182,10 +182,10 @@ NullCommand(CommandDest dest)
182182
pq_puttextmessage('I',"");
183183
break;
184184

185-
caseNone:
186-
caseDebug:
187-
caseSPI:
188-
caseTuplestore:
185+
caseDestNone:
186+
caseDestDebug:
187+
caseDestSPI:
188+
caseDestTuplestore:
189189
break;
190190
}
191191
}
@@ -206,8 +206,8 @@ ReadyForQuery(CommandDest dest)
206206
{
207207
switch (dest)
208208
{
209-
caseRemote:
210-
caseRemoteExecute:
209+
caseDestRemote:
210+
caseDestRemoteExecute:
211211
if (PG_PROTOCOL_MAJOR(FrontendProtocol) >=3)
212212
{
213213
StringInfoDatabuf;
@@ -222,10 +222,10 @@ ReadyForQuery(CommandDest dest)
222222
pq_flush();
223223
break;
224224

225-
caseNone:
226-
caseDebug:
227-
caseSPI:
228-
caseTuplestore:
225+
caseDestNone:
226+
caseDestDebug:
227+
caseDestSPI:
228+
caseDestTuplestore:
229229
break;
230230
}
231231
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp