diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-04-29 03:21:30 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-04-29 03:21:30 +0000 |
commit | 4a5f38c4e624fbdc8bb4511394c45dc2c7f784ec (patch) | |
tree | 715c7e2440e4616e6084b6348453ad379733e9c9 /src/backend/executor | |
parent | 6a17d226b535c1fc7db8a10b5f2b482e852af928 (diff) | |
download | postgresql-4a5f38c4e624fbdc8bb4511394c45dc2c7f784ec.tar.gz postgresql-4a5f38c4e624fbdc8bb4511394c45dc2c7f784ec.zip |
Code review for holdable-cursors patch. Fix error recovery, memory
context sloppiness, some other things. Includes Neil's mopup patch
of 22-Apr.
Diffstat (limited to 'src/backend/executor')
-rw-r--r-- | src/backend/executor/spi.c | 4 | ||||
-rw-r--r-- | src/backend/executor/tstoreReceiver.c | 16 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c index 11ed2914de5..218b56a6013 100644 --- a/src/backend/executor/spi.c +++ b/src/backend/executor/spi.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/spi.c,v 1.91 2003/04/27 20:09:43 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/spi.c,v 1.92 2003/04/29 03:21:29 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -809,7 +809,7 @@ SPI_cursor_open(const char *name, void *plan, Datum *Values, const char *Nulls) ExecutorStart(queryDesc); /* Arrange to shut down the executor if portal is dropped */ - PortalSetQuery(portal, queryDesc, PortalCleanup); + PortalSetQuery(portal, queryDesc); /* Switch back to the callers memory context */ MemoryContextSwitchTo(oldcontext); diff --git a/src/backend/executor/tstoreReceiver.c b/src/backend/executor/tstoreReceiver.c index fe82cc8c92c..01fffed8168 100644 --- a/src/backend/executor/tstoreReceiver.c +++ b/src/backend/executor/tstoreReceiver.c @@ -9,7 +9,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/tstoreReceiver.c,v 1.1 2003/03/27 16:53:15 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/tstoreReceiver.c,v 1.2 2003/04/29 03:21:29 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -27,8 +27,9 @@ typedef struct MemoryContext cxt; } TStoreState; + /* - * Receive a tuple from the executor and store it in the tuplestore. + * Prepare to receive tuples from executor. * * XXX: As currently implemented, this routine is a hack: there should * be no tie between this code and the portal system. Instead, the @@ -56,6 +57,9 @@ tstoreSetupReceiver(DestReceiver *self, int operation, myState->cxt = portal->holdContext; } +/* + * Receive a tuple from the executor and store it in the tuplestore. + */ static void tstoreReceiveTuple(HeapTuple tuple, TupleDesc typeinfo, DestReceiver *self) { @@ -67,12 +71,18 @@ tstoreReceiveTuple(HeapTuple tuple, TupleDesc typeinfo, DestReceiver *self) MemoryContextSwitchTo(oldcxt); } +/* + * Clean up + */ static void tstoreCleanupReceiver(DestReceiver *self) { - ; /* do nothing */ + /* do nothing */ } +/* + * Initially create a DestReceiver object. + */ DestReceiver * tstoreReceiverCreateDR(void) { |