diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-01-29 00:39:20 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-01-29 00:39:20 +0000 |
commit | 0d54d6ac44444c05f7c0f5058d3d3f32cc188b48 (patch) | |
tree | cccee5d61e1afc1982c363ed3e4876a09ed82b52 /src/backend/executor/nodeTidscan.c | |
parent | 51cd0377460839d25a5fc5f2a2499de43126a3b2 (diff) | |
download | postgresql-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/nodeTidscan.c')
-rw-r--r-- | src/backend/executor/nodeTidscan.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/backend/executor/nodeTidscan.c b/src/backend/executor/nodeTidscan.c index 49f7594c6f7..a5c0299d289 100644 --- a/src/backend/executor/nodeTidscan.c +++ b/src/backend/executor/nodeTidscan.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/nodeTidscan.c,v 1.13 2001/01/24 19:42:55 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/nodeTidscan.c,v 1.14 2001/01/29 00:39:19 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -110,9 +110,8 @@ TidNext(TidScan *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; + ExecStoreTuple(estate->es_evTuple[node->scan.scanrelid - 1], + slot, InvalidBuffer, false); /* Flag for the next call that no more tuples */ estate->es_evTupleNull[node->scan.scanrelid - 1] = true; @@ -487,7 +486,7 @@ ExecInitTidScan(TidScan *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); /* |