From 0d54d6ac44444c05f7c0f5058d3d3f32cc188b48 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 29 Jan 2001 00:39:20 +0000 Subject: 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. --- src/backend/executor/nodeIndexscan.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/backend/executor/nodeIndexscan.c') 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); /* ---------------- -- cgit v1.2.3