aboutsummaryrefslogtreecommitdiff
path: root/src/include/nodes/execnodes.h
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/include/nodes/execnodes.h
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/include/nodes/execnodes.h')
-rw-r--r--src/include/nodes/execnodes.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 5552210de81..b9c10e6b310 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: execnodes.h,v 1.55 2001/01/24 19:43:25 momjian Exp $
+ * $Id: execnodes.h,v 1.56 2001/01/29 00:39:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -164,11 +164,19 @@ typedef struct ProjectionInfo
* (including the junk attributes).
* cleanTargetList: the "clean" target list (junk attributes removed).
* cleanLength: the length of 'cleanTargetList'
- * cleanTupTyp: the tuple descriptor of the "clean" tuple (with
+ * cleanTupType: the tuple descriptor of the "clean" tuple (with
* junk attributes removed).
- * cleanMap: A map with the correspondance between the non junk
+ * cleanMap: A map with the correspondance between the non-junk
* attributes of the "original" tuple and the
* attributes of the "clean" tuple.
+ * junkContext: memory context holding the JunkFilter node and all
+ * its subsidiary data structures.
+ *
+ * NOTE: the original targetList and tupType are passed to ExecInitJunkFilter
+ * and do not belong to the JunkFilter. All the other subsidiary structures
+ * are created during ExecInitJunkFilter, and all of them can be freed by
+ * deleting the memory context junkContext. This would not be needed if we
+ * had a cleaner approach to managing query-lifetime data structures...
* ----------------
*/
typedef struct JunkFilter
@@ -181,6 +189,7 @@ typedef struct JunkFilter
int jf_cleanLength;
TupleDesc jf_cleanTupType;
AttrNumber *jf_cleanMap;
+ MemoryContext jf_junkContext;
} JunkFilter;
/* ----------------