aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeIndexscan.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-01-29 00:39:20 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-01-29 00:39:20 +0000
commit0d54d6ac44444c05f7c0f5058d3d3f32cc188b48 (patch)
treecccee5d61e1afc1982c363ed3e4876a09ed82b52 /src/backend/executor/nodeIndexscan.c
parent51cd0377460839d25a5fc5f2a2499de43126a3b2 (diff)
downloadpostgresql-0d54d6ac44444c05f7c0f5058d3d3f32cc188b48.tar.gz
postgresql-0d54d6ac44444c05f7c0f5058d3d3f32cc188b48.zip
Clean up handling of tuple descriptors so that result-tuple descriptors
allocated by plan nodes are not leaked at end of query. This doesn't really matter for normal queries, but it sure does for queries invoked repetitively inside SQL functions. Clean up some other grotty code associated with tupdescs, and fix a few other memory leaks exposed by tests with simple SQL functions.
Diffstat (limited to 'src/backend/executor/nodeIndexscan.c')
-rw-r--r--src/backend/executor/nodeIndexscan.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/backend/executor/nodeIndexscan.c b/src/backend/executor/nodeIndexscan.c
index 7ed93de0848..c0369e8f4cd 100644
--- a/src/backend/executor/nodeIndexscan.c
+++ b/src/backend/executor/nodeIndexscan.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.56 2001/01/24 19:42:54 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.57 2001/01/29 00:39:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -121,13 +121,11 @@ IndexNext(IndexScan *node)
if (estate->es_evTupleNull[node->scan.scanrelid - 1])
return slot; /* return empty slot */
- /* probably ought to use ExecStoreTuple here... */
- slot->val = estate->es_evTuple[node->scan.scanrelid - 1];
- slot->ttc_shouldFree = false;
-
- econtext->ecxt_scantuple = slot;
+ ExecStoreTuple(estate->es_evTuple[node->scan.scanrelid - 1],
+ slot, InvalidBuffer, false);
/* Does the tuple meet any of the OR'd indxqual conditions? */
+ econtext->ecxt_scantuple = slot;
ResetExprContext(econtext);
@@ -1043,7 +1041,7 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
* get the scan type from the relation descriptor.
* ----------------
*/
- ExecAssignScanType(scanstate, RelationGetDescr(currentRelation));
+ ExecAssignScanType(scanstate, RelationGetDescr(currentRelation), false);
ExecAssignResultTypeFromTL((Plan *) node, &scanstate->cstate);
/* ----------------