diff options
Diffstat (limited to 'src/backend/tcop/pquery.c')
-rw-r--r-- | src/backend/tcop/pquery.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/backend/tcop/pquery.c b/src/backend/tcop/pquery.c index d4d5b945946..1f66fda2b72 100644 --- a/src/backend/tcop/pquery.c +++ b/src/backend/tcop/pquery.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tcop/pquery.c,v 1.91 2005/02/10 20:36:28 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/pquery.c,v 1.92 2005/03/16 21:38:08 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -836,6 +836,9 @@ RunFromStore(Portal portal, ScanDirection direction, long count, DestReceiver *dest) { long current_tuple_count = 0; + TupleTableSlot *slot; + + slot = MakeSingleTupleTableSlot(portal->tupDesc); (*dest->rStartup) (dest, CMD_SELECT, portal->tupDesc); @@ -863,10 +866,11 @@ RunFromStore(Portal portal, ScanDirection direction, long count, if (tup == NULL) break; - (*dest->receiveTuple) (tup, portal->tupDesc, dest); + ExecStoreTuple(tup, slot, InvalidBuffer, should_free); + + (*dest->receiveSlot) (slot, dest); - if (should_free) - pfree(tup); + ExecClearTuple(slot); /* * check our tuple count.. if we've processed the proper @@ -881,6 +885,8 @@ RunFromStore(Portal portal, ScanDirection direction, long count, (*dest->rShutdown) (dest); + ExecDropSingleTupleTableSlot(slot); + return (uint32) current_tuple_count; } |