summaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/execQual.c5
-rw-r--r--src/backend/executor/tstoreReceiver.c9
2 files changed, 4 insertions, 10 deletions
diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c
index 06fe23e6376..57536cd0938 100644
--- a/src/backend/executor/execQual.c
+++ b/src/backend/executor/execQual.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.183.2.6 2007/02/06 17:35:34 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.183.2.7 2009/12/29 17:41:35 heikki Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1522,9 +1522,7 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
tuple = heap_form_tuple(tupdesc, &result, &fcinfo.isnull);
}
- oldcontext = MemoryContextSwitchTo(econtext->ecxt_per_query_memory);
tuplestore_puttuple(tupstore, tuple);
- MemoryContextSwitchTo(oldcontext);
/*
* Are we done?
@@ -1576,6 +1574,7 @@ no_function_result:
memset(nullflags, true, natts * sizeof(bool));
tuple = heap_form_tuple(expectedDesc, nulldatums, nullflags);
MemoryContextSwitchTo(econtext->ecxt_per_query_memory);
+
tuplestore_puttuple(tupstore, tuple);
}
}
diff --git a/src/backend/executor/tstoreReceiver.c b/src/backend/executor/tstoreReceiver.c
index fb2aa843fd6..e99ed15a955 100644
--- a/src/backend/executor/tstoreReceiver.c
+++ b/src/backend/executor/tstoreReceiver.c
@@ -13,7 +13,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/tstoreReceiver.c,v 1.15.2.1 2008/12/01 17:06:41 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/tstoreReceiver.c,v 1.15.2.2 2009/12/29 17:41:35 heikki Exp $
*
*-------------------------------------------------------------------------
*/
@@ -95,11 +95,8 @@ static void
tstoreReceiveSlot_notoast(TupleTableSlot *slot, DestReceiver *self)
{
TStoreState *myState = (TStoreState *) self;
- MemoryContext oldcxt = MemoryContextSwitchTo(myState->cxt);
tuplestore_puttuple(myState->tstore, ExecFetchSlotTuple(slot));
-
- MemoryContextSwitchTo(oldcxt);
}
/*
@@ -116,7 +113,6 @@ tstoreReceiveSlot_detoast(TupleTableSlot *slot, DestReceiver *self)
int nfree;
int i;
HeapTuple tuple;
- MemoryContext oldcxt;
/* Make sure the tuple is fully deconstructed */
slot_getallattrs(slot);
@@ -126,6 +122,7 @@ tstoreReceiveSlot_detoast(TupleTableSlot *slot, DestReceiver *self)
* myState->outvalues[] (but we can re-use the slot's isnull array).
* Also, remember the fetched values to free afterwards.
*/
+
nfree = 0;
for (i = 0; i < natts; i++)
{
@@ -151,9 +148,7 @@ tstoreReceiveSlot_detoast(TupleTableSlot *slot, DestReceiver *self)
*/
tuple = heap_form_tuple(typeinfo,
myState->outvalues, slot->tts_isnull);
- oldcxt = MemoryContextSwitchTo(myState->cxt);
tuplestore_puttuple(myState->tstore, tuple);
- MemoryContextSwitchTo(oldcxt);
heap_freetuple(tuple);
/* And release any temporary detoasted values */