1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Code review for holdable-cursors patch. Fix error recovery, memory

context sloppiness, some other things.  Includes Neil's mopup patch
of 22-Apr.
This commit is contained in:
Tom Lane
2003-04-29 03:21:30 +00:00
parent 6a17d226b5
commit 4a5f38c4e6
18 changed files with 379 additions and 316 deletions

View File

@ -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)
{