mirror of
https://github.com/postgres/postgres.git
synced 2025-04-21 12:05:57 +03:00
Rename fields of DestReceiver to avoid collisions with (ill-considered)
macros in some platforms' sys/socket.h.
This commit is contained in:
parent
d5f7d2c682
commit
338aa57be0
@ -9,7 +9,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.77 2003/08/04 02:39:56 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.78 2003/08/06 17:46:45 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -90,9 +90,9 @@ printtup_create_DR(CommandDest dest, Portal portal)
|
|||||||
else
|
else
|
||||||
self->pub.receiveTuple = printtup_20;
|
self->pub.receiveTuple = printtup_20;
|
||||||
}
|
}
|
||||||
self->pub.startup = printtup_startup;
|
self->pub.rStartup = printtup_startup;
|
||||||
self->pub.shutdown = printtup_shutdown;
|
self->pub.rShutdown = printtup_shutdown;
|
||||||
self->pub.destroy = printtup_destroy;
|
self->pub.rDestroy = printtup_destroy;
|
||||||
self->pub.mydest = dest;
|
self->pub.mydest = dest;
|
||||||
|
|
||||||
self->portal = portal;
|
self->portal = portal;
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/portalcmds.c,v 1.21 2003/08/04 02:39:58 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/portalcmds.c,v 1.22 2003/08/06 17:46:45 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -335,7 +335,7 @@ PersistHoldablePortal(Portal portal)
|
|||||||
/* Fetch the result set into the tuplestore */
|
/* Fetch the result set into the tuplestore */
|
||||||
ExecutorRun(queryDesc, ForwardScanDirection, 0L);
|
ExecutorRun(queryDesc, ForwardScanDirection, 0L);
|
||||||
|
|
||||||
(*queryDesc->dest->destroy) (queryDesc->dest);
|
(*queryDesc->dest->rDestroy) (queryDesc->dest);
|
||||||
queryDesc->dest = NULL;
|
queryDesc->dest = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.214 2003/08/04 02:39:58 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.215 2003/08/06 17:46:45 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -217,7 +217,7 @@ ExecutorRun(QueryDesc *queryDesc,
|
|||||||
estate->es_processed = 0;
|
estate->es_processed = 0;
|
||||||
estate->es_lastoid = InvalidOid;
|
estate->es_lastoid = InvalidOid;
|
||||||
|
|
||||||
(*dest->startup) (dest, operation, queryDesc->tupDesc);
|
(*dest->rStartup) (dest, operation, queryDesc->tupDesc);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* run plan
|
* run plan
|
||||||
@ -235,7 +235,7 @@ ExecutorRun(QueryDesc *queryDesc,
|
|||||||
/*
|
/*
|
||||||
* shutdown receiver
|
* shutdown receiver
|
||||||
*/
|
*/
|
||||||
(*dest->shutdown) (dest);
|
(*dest->rShutdown) (dest);
|
||||||
|
|
||||||
MemoryContextSwitchTo(oldcontext);
|
MemoryContextSwitchTo(oldcontext);
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.69 2003/08/04 02:39:58 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.70 2003/08/06 17:46:45 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -764,7 +764,7 @@ begin_tup_output_tupdesc(DestReceiver *dest, TupleDesc tupdesc)
|
|||||||
tstate->metadata = TupleDescGetAttInMetadata(tupdesc);
|
tstate->metadata = TupleDescGetAttInMetadata(tupdesc);
|
||||||
tstate->dest = dest;
|
tstate->dest = dest;
|
||||||
|
|
||||||
(*tstate->dest->startup) (tstate->dest, (int) CMD_SELECT, tupdesc);
|
(*tstate->dest->rStartup) (tstate->dest, (int) CMD_SELECT, tupdesc);
|
||||||
|
|
||||||
return tstate;
|
return tstate;
|
||||||
}
|
}
|
||||||
@ -817,7 +817,7 @@ do_text_output_multiline(TupOutputState *tstate, char *text)
|
|||||||
void
|
void
|
||||||
end_tup_output(TupOutputState *tstate)
|
end_tup_output(TupOutputState *tstate)
|
||||||
{
|
{
|
||||||
(*tstate->dest->shutdown) (tstate->dest);
|
(*tstate->dest->rShutdown) (tstate->dest);
|
||||||
/* note that destroying the dest is not ours to do */
|
/* note that destroying the dest is not ours to do */
|
||||||
/* XXX worth cleaning up the attinmetadata? */
|
/* XXX worth cleaning up the attinmetadata? */
|
||||||
pfree(tstate);
|
pfree(tstate);
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/tstoreReceiver.c,v 1.8 2003/08/04 02:39:59 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/tstoreReceiver.c,v 1.9 2003/08/06 17:46:45 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -78,9 +78,9 @@ CreateTuplestoreDestReceiver(Tuplestorestate *tStore,
|
|||||||
TStoreState *self = (TStoreState *) palloc(sizeof(TStoreState));
|
TStoreState *self = (TStoreState *) palloc(sizeof(TStoreState));
|
||||||
|
|
||||||
self->pub.receiveTuple = tstoreReceiveTuple;
|
self->pub.receiveTuple = tstoreReceiveTuple;
|
||||||
self->pub.startup = tstoreStartupReceiver;
|
self->pub.rStartup = tstoreStartupReceiver;
|
||||||
self->pub.shutdown = tstoreShutdownReceiver;
|
self->pub.rShutdown = tstoreShutdownReceiver;
|
||||||
self->pub.destroy = tstoreDestroyReceiver;
|
self->pub.rDestroy = tstoreDestroyReceiver;
|
||||||
self->pub.mydest = Tuplestore;
|
self->pub.mydest = Tuplestore;
|
||||||
|
|
||||||
self->tstore = tStore;
|
self->tstore = tStore;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.356 2003/08/04 04:03:06 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.357 2003/08/06 17:46:45 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* this is the "main" module of the postgres backend and
|
* this is the "main" module of the postgres backend and
|
||||||
@ -878,7 +878,7 @@ exec_simple_query(const char *query_string)
|
|||||||
receiver,
|
receiver,
|
||||||
completionTag);
|
completionTag);
|
||||||
|
|
||||||
(*receiver->destroy) (receiver);
|
(*receiver->rDestroy) (receiver);
|
||||||
|
|
||||||
PortalDrop(portal, false);
|
PortalDrop(portal, false);
|
||||||
|
|
||||||
@ -1590,7 +1590,7 @@ exec_execute_message(const char *portal_name, long max_rows)
|
|||||||
receiver,
|
receiver,
|
||||||
completionTag);
|
completionTag);
|
||||||
|
|
||||||
(*receiver->destroy) (receiver);
|
(*receiver->rDestroy) (receiver);
|
||||||
|
|
||||||
if (completed)
|
if (completed)
|
||||||
{
|
{
|
||||||
@ -2643,7 +2643,7 @@ PostgresMain(int argc, char *argv[], const char *username)
|
|||||||
if (!IsUnderPostmaster)
|
if (!IsUnderPostmaster)
|
||||||
{
|
{
|
||||||
puts("\nPOSTGRES backend interactive interface ");
|
puts("\nPOSTGRES backend interactive interface ");
|
||||||
puts("$Revision: 1.356 $ $Date: 2003/08/04 04:03:06 $\n");
|
puts("$Revision: 1.357 $ $Date: 2003/08/06 17:46:45 $\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.70 2003/08/04 02:40:04 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.71 2003/08/06 17:46:46 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -457,7 +457,7 @@ PortalRun(Portal portal, long count,
|
|||||||
treceiver = CreateDestReceiver(Tuplestore, portal);
|
treceiver = CreateDestReceiver(Tuplestore, portal);
|
||||||
PortalRunUtility(portal, lfirst(portal->parseTrees),
|
PortalRunUtility(portal, lfirst(portal->parseTrees),
|
||||||
treceiver, NULL);
|
treceiver, NULL);
|
||||||
(*treceiver->destroy) (treceiver);
|
(*treceiver->rDestroy) (treceiver);
|
||||||
portal->portalUtilReady = true;
|
portal->portalUtilReady = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -666,7 +666,7 @@ RunFromStore(Portal portal, ScanDirection direction, long count,
|
|||||||
{
|
{
|
||||||
long current_tuple_count = 0;
|
long current_tuple_count = 0;
|
||||||
|
|
||||||
(*dest->startup) (dest, CMD_SELECT, portal->tupDesc);
|
(*dest->rStartup) (dest, CMD_SELECT, portal->tupDesc);
|
||||||
|
|
||||||
if (direction == NoMovementScanDirection)
|
if (direction == NoMovementScanDirection)
|
||||||
{
|
{
|
||||||
@ -708,7 +708,7 @@ RunFromStore(Portal portal, ScanDirection direction, long count,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
(*dest->shutdown) (dest);
|
(*dest->rShutdown) (dest);
|
||||||
|
|
||||||
return (uint32) current_tuple_count;
|
return (uint32) current_tuple_count;
|
||||||
}
|
}
|
||||||
|
@ -30,18 +30,18 @@
|
|||||||
* CreateDestReceiver returns a receiver object appropriate to the specified
|
* CreateDestReceiver returns a receiver object appropriate to the specified
|
||||||
* destination. The executor, as well as utility statements that can return
|
* destination. The executor, as well as utility statements that can return
|
||||||
* tuples, are passed the resulting DestReceiver* pointer. Each executor run
|
* tuples, are passed the resulting DestReceiver* pointer. Each executor run
|
||||||
* or utility execution calls the receiver's startup method, then the
|
* or utility execution calls the receiver's rStartup method, then the
|
||||||
* receiveTuple method (zero or more times), then the shutdown method.
|
* receiveTuple method (zero or more times), then the rShutdown method.
|
||||||
* The same receiver object may be re-used multiple times; eventually it is
|
* The same receiver object may be re-used multiple times; eventually it is
|
||||||
* destroyed by calling its destroy method.
|
* destroyed by calling its rDestroy method.
|
||||||
*
|
*
|
||||||
* The DestReceiver object returned by CreateDestReceiver may be a statically
|
* The DestReceiver object returned by CreateDestReceiver may be a statically
|
||||||
* allocated object (for destination types that require no local state),
|
* allocated object (for destination types that require no local state),
|
||||||
* in which case destroy is a no-op. Alternatively it can be a palloc'd
|
* in which case rDestroy is a no-op. Alternatively it can be a palloc'd
|
||||||
* object that has DestReceiver as its first field and contains additional
|
* object that has DestReceiver as its first field and contains additional
|
||||||
* fields (see printtup.c for an example). These additional fields are then
|
* fields (see printtup.c for an example). These additional fields are then
|
||||||
* accessible to the DestReceiver functions by casting the DestReceiver*
|
* accessible to the DestReceiver functions by casting the DestReceiver*
|
||||||
* pointer passed to them. The palloc'd object is pfree'd by the destroy
|
* pointer passed to them. The palloc'd object is pfree'd by the rDestroy
|
||||||
* method. Note that the caller of CreateDestReceiver should take care to
|
* method. Note that the caller of CreateDestReceiver should take care to
|
||||||
* do so in a memory context that is long-lived enough for the receiver
|
* do so in a memory context that is long-lived enough for the receiver
|
||||||
* object not to disappear while still needed.
|
* object not to disappear while still needed.
|
||||||
@ -54,7 +54,7 @@
|
|||||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: dest.h,v 1.40 2003/08/04 02:40:15 momjian Exp $
|
* $Id: dest.h,v 1.41 2003/08/06 17:46:46 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -93,7 +93,7 @@ typedef enum
|
|||||||
* pointers that the executor must call.
|
* pointers that the executor must call.
|
||||||
*
|
*
|
||||||
* Note: the receiveTuple routine must be passed a TupleDesc identical to the
|
* Note: the receiveTuple routine must be passed a TupleDesc identical to the
|
||||||
* one given to the startup routine. The reason for passing it again is just
|
* one given to the rStartup routine. The reason for passing it again is just
|
||||||
* that some destinations would otherwise need dynamic state merely to
|
* that some destinations would otherwise need dynamic state merely to
|
||||||
* remember the tupledesc pointer.
|
* remember the tupledesc pointer.
|
||||||
* ----------------
|
* ----------------
|
||||||
@ -107,12 +107,12 @@ struct _DestReceiver
|
|||||||
TupleDesc typeinfo,
|
TupleDesc typeinfo,
|
||||||
DestReceiver *self);
|
DestReceiver *self);
|
||||||
/* Per-executor-run initialization and shutdown: */
|
/* Per-executor-run initialization and shutdown: */
|
||||||
void (*startup) (DestReceiver *self,
|
void (*rStartup) (DestReceiver *self,
|
||||||
int operation,
|
int operation,
|
||||||
TupleDesc typeinfo);
|
TupleDesc typeinfo);
|
||||||
void (*shutdown) (DestReceiver *self);
|
void (*rShutdown) (DestReceiver *self);
|
||||||
/* Destroy the receiver object itself (if dynamically allocated) */
|
/* Destroy the receiver object itself (if dynamically allocated) */
|
||||||
void (*destroy) (DestReceiver *self);
|
void (*rDestroy) (DestReceiver *self);
|
||||||
/* CommandDest code for this receiver */
|
/* CommandDest code for this receiver */
|
||||||
CommandDest mydest;
|
CommandDest mydest;
|
||||||
/* Private fields might appear beyond this point... */
|
/* Private fields might appear beyond this point... */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user