Skip to content

Commit 338aa57

Browse files
committed
Rename fields of DestReceiver to avoid collisions with (ill-considered)
macros in some platforms' sys/socket.h.
1 parent d5f7d2c commit 338aa57

File tree

8 files changed

+34
-34
lines changed

8 files changed

+34
-34
lines changed

src/backend/access/common/printtup.c

Lines changed: 4 additions & 4 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-
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.77 2003/08/04 02:39:56 momjian Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.78 2003/08/06 17:46:45 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -90,9 +90,9 @@ printtup_create_DR(CommandDest dest, Portal portal)
9090
else
9191
self->pub.receiveTuple = printtup_20;
9292
}
93-
self->pub.startup = printtup_startup;
94-
self->pub.shutdown = printtup_shutdown;
95-
self->pub.destroy = printtup_destroy;
93+
self->pub.rStartup = printtup_startup;
94+
self->pub.rShutdown = printtup_shutdown;
95+
self->pub.rDestroy = printtup_destroy;
9696
self->pub.mydest = dest;
9797

9898
self->portal = portal;

src/backend/commands/portalcmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
*
1616
* IDENTIFICATION
17-
* $Header: /cvsroot/pgsql/src/backend/commands/portalcmds.c,v 1.21 2003/08/04 02:39:58 momjian Exp $
17+
* $Header: /cvsroot/pgsql/src/backend/commands/portalcmds.c,v 1.22 2003/08/06 17:46:45 tgl Exp $
1818
*
1919
*-------------------------------------------------------------------------
2020
*/
@@ -335,7 +335,7 @@ PersistHoldablePortal(Portal portal)
335335
/* Fetch the result set into the tuplestore */
336336
ExecutorRun(queryDesc, ForwardScanDirection, 0L);
337337

338-
(*queryDesc->dest->destroy) (queryDesc->dest);
338+
(*queryDesc->dest->rDestroy) (queryDesc->dest);
339339
queryDesc->dest = NULL;
340340

341341
/*

src/backend/executor/execMain.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
*
2828
* IDENTIFICATION
29-
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.214 2003/08/04 02:39:58 momjian Exp $
29+
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.215 2003/08/06 17:46:45 tgl Exp $
3030
*
3131
*-------------------------------------------------------------------------
3232
*/
@@ -217,7 +217,7 @@ ExecutorRun(QueryDesc *queryDesc,
217217
estate->es_processed = 0;
218218
estate->es_lastoid = InvalidOid;
219219

220-
(*dest->startup) (dest, operation, queryDesc->tupDesc);
220+
(*dest->rStartup) (dest, operation, queryDesc->tupDesc);
221221

222222
/*
223223
* run plan
@@ -235,7 +235,7 @@ ExecutorRun(QueryDesc *queryDesc,
235235
/*
236236
* shutdown receiver
237237
*/
238-
(*dest->shutdown) (dest);
238+
(*dest->rShutdown) (dest);
239239

240240
MemoryContextSwitchTo(oldcontext);
241241

src/backend/executor/execTuples.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*
1717
* IDENTIFICATION
18-
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.69 2003/08/04 02:39:58 momjian Exp $
18+
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.70 2003/08/06 17:46:45 tgl Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -764,7 +764,7 @@ begin_tup_output_tupdesc(DestReceiver *dest, TupleDesc tupdesc)
764764
tstate->metadata = TupleDescGetAttInMetadata(tupdesc);
765765
tstate->dest = dest;
766766

767-
(*tstate->dest->startup) (tstate->dest, (int) CMD_SELECT, tupdesc);
767+
(*tstate->dest->rStartup) (tstate->dest, (int) CMD_SELECT, tupdesc);
768768

769769
return tstate;
770770
}
@@ -817,7 +817,7 @@ do_text_output_multiline(TupOutputState *tstate, char *text)
817817
void
818818
end_tup_output(TupOutputState *tstate)
819819
{
820-
(*tstate->dest->shutdown) (tstate->dest);
820+
(*tstate->dest->rShutdown) (tstate->dest);
821821
/* note that destroying the dest is not ours to do */
822822
/* XXX worth cleaning up the attinmetadata? */
823823
pfree(tstate);

src/backend/executor/tstoreReceiver.c

Lines changed: 4 additions & 4 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-
* $Header: /cvsroot/pgsql/src/backend/executor/tstoreReceiver.c,v 1.8 2003/08/04 02:39:59 momjian Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/executor/tstoreReceiver.c,v 1.9 2003/08/06 17:46:45 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -78,9 +78,9 @@ CreateTuplestoreDestReceiver(Tuplestorestate *tStore,
7878
TStoreState *self = (TStoreState *) palloc(sizeof(TStoreState));
7979

8080
self->pub.receiveTuple = tstoreReceiveTuple;
81-
self->pub.startup = tstoreStartupReceiver;
82-
self->pub.shutdown = tstoreShutdownReceiver;
83-
self->pub.destroy = tstoreDestroyReceiver;
81+
self->pub.rStartup = tstoreStartupReceiver;
82+
self->pub.rShutdown = tstoreShutdownReceiver;
83+
self->pub.rDestroy = tstoreDestroyReceiver;
8484
self->pub.mydest = Tuplestore;
8585

8686
self->tstore = tStore;

src/backend/tcop/postgres.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.356 2003/08/04 04:03:06 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.357 2003/08/06 17:46:45 tgl Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -878,7 +878,7 @@ exec_simple_query(const char *query_string)
878878
receiver,
879879
completionTag);
880880

881-
(*receiver->destroy) (receiver);
881+
(*receiver->rDestroy) (receiver);
882882

883883
PortalDrop(portal, false);
884884

@@ -1590,7 +1590,7 @@ exec_execute_message(const char *portal_name, long max_rows)
15901590
receiver,
15911591
completionTag);
15921592

1593-
(*receiver->destroy) (receiver);
1593+
(*receiver->rDestroy) (receiver);
15941594

15951595
if (completed)
15961596
{
@@ -2643,7 +2643,7 @@ PostgresMain(int argc, char *argv[], const char *username)
26432643
if (!IsUnderPostmaster)
26442644
{
26452645
puts("\nPOSTGRES backend interactive interface ");
2646-
puts("$Revision: 1.356 $ $Date: 2003/08/04 04:03:06 $\n");
2646+
puts("$Revision: 1.357 $ $Date: 2003/08/06 17:46:45 $\n");
26472647
}
26482648

26492649
/*

src/backend/tcop/pquery.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.70 2003/08/04 02:40:04 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.71 2003/08/06 17:46:46 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -457,7 +457,7 @@ PortalRun(Portal portal, long count,
457457
treceiver = CreateDestReceiver(Tuplestore, portal);
458458
PortalRunUtility(portal, lfirst(portal->parseTrees),
459459
treceiver, NULL);
460-
(*treceiver->destroy) (treceiver);
460+
(*treceiver->rDestroy) (treceiver);
461461
portal->portalUtilReady = true;
462462
}
463463

@@ -666,7 +666,7 @@ RunFromStore(Portal portal, ScanDirection direction, long count,
666666
{
667667
long current_tuple_count = 0;
668668

669-
(*dest->startup) (dest, CMD_SELECT, portal->tupDesc);
669+
(*dest->rStartup) (dest, CMD_SELECT, portal->tupDesc);
670670

671671
if (direction == NoMovementScanDirection)
672672
{
@@ -708,7 +708,7 @@ RunFromStore(Portal portal, ScanDirection direction, long count,
708708
}
709709
}
710710

711-
(*dest->shutdown) (dest);
711+
(*dest->rShutdown) (dest);
712712

713713
return (uint32) current_tuple_count;
714714
}

src/include/tcop/dest.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@
3030
* CreateDestReceiver returns a receiver object appropriate to the specified
3131
* destination. The executor, as well as utility statements that can return
3232
* tuples, are passed the resulting DestReceiver* pointer. Each executor run
33-
* or utility execution calls the receiver's startup method, then the
34-
* receiveTuple method (zero or more times), then the shutdown method.
33+
* or utility execution calls the receiver's rStartup method, then the
34+
* receiveTuple method (zero or more times), then the rShutdown method.
3535
* The same receiver object may be re-used multiple times; eventually it is
36-
* destroyed by calling its destroy method.
36+
* destroyed by calling its rDestroy method.
3737
*
3838
* The DestReceiver object returned by CreateDestReceiver may be a statically
3939
* allocated object (for destination types that require no local state),
40-
* in which case destroy is a no-op. Alternatively it can be a palloc'd
40+
* in which case rDestroy is a no-op. Alternatively it can be a palloc'd
4141
* object that has DestReceiver as its first field and contains additional
4242
* fields (see printtup.c for an example). These additional fields are then
4343
* accessible to the DestReceiver functions by casting the DestReceiver*
44-
* pointer passed to them. The palloc'd object is pfree'd by the destroy
44+
* pointer passed to them. The palloc'd object is pfree'd by the rDestroy
4545
* method. Note that the caller of CreateDestReceiver should take care to
4646
* do so in a memory context that is long-lived enough for the receiver
4747
* object not to disappear while still needed.
@@ -54,7 +54,7 @@
5454
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
5555
* Portions Copyright (c) 1994, Regents of the University of California
5656
*
57-
* $Id: dest.h,v 1.40 2003/08/04 02:40:15 momjian Exp $
57+
* $Id: dest.h,v 1.41 2003/08/06 17:46:46 tgl Exp $
5858
*
5959
*-------------------------------------------------------------------------
6060
*/
@@ -93,7 +93,7 @@ typedef enum
9393
* pointers that the executor must call.
9494
*
9595
* Note: the receiveTuple routine must be passed a TupleDesc identical to the
96-
* one given to the startup routine. The reason for passing it again is just
96+
* one given to the rStartup routine. The reason for passing it again is just
9797
* that some destinations would otherwise need dynamic state merely to
9898
* remember the tupledesc pointer.
9999
* ----------------
@@ -107,12 +107,12 @@ struct _DestReceiver
107107
TupleDesc typeinfo,
108108
DestReceiver *self);
109109
/* Per-executor-run initialization and shutdown: */
110-
void (*startup) (DestReceiver *self,
110+
void (*rStartup) (DestReceiver *self,
111111
int operation,
112112
TupleDesc typeinfo);
113-
void (*shutdown) (DestReceiver *self);
113+
void (*rShutdown) (DestReceiver *self);
114114
/* Destroy the receiver object itself (if dynamically allocated) */
115-
void (*destroy) (DestReceiver *self);
115+
void (*rDestroy) (DestReceiver *self);
116116
/* CommandDest code for this receiver */
117117
CommandDest mydest;
118118
/* Private fields might appear beyond this point... */

0 commit comments

Comments
 (0)