diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-06-21 17:26:24 -0400 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-06-21 17:26:24 -0400 |
| commit | d8bd584bf4cc6c74178a73ae8924b86ab2bebb44 (patch) | |
| tree | 788d037950c72d8c52aa069085eab9cddd91b6da /src/include | |
| parent | 9166ae25bc9067cbf6b439f4a66277578230fd21 (diff) | |
Fix memory leak in ARRAY(SELECT ...) subqueries.
Repeated execution of an uncorrelated ARRAY_SUBLINK sub-select (which
I think can only happen if the sub-select is embedded in a larger,
correlated subquery) would leak memory for the duration of the query,
due to not reclaiming the array generated in the previous execution.
Per bug #6698 from Armando Miraglia. Diagnosis and fix idea by Heikki,
patch itself by me.
This has been like this all along, so back-patch to all supported versions.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/nodes/execnodes.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index f7a6787b55a..fa8465d6023 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -714,6 +714,7 @@ typedef struct SubPlanState ExprState *testexpr; /* state of combining expression */ List *args; /* states of argument expression(s) */ HeapTuple curTuple; /* copy of most recent tuple from subplan */ + Datum curArray; /* most recent array from ARRAY() subplan */ /* these are used when hashing the subselect's output: */ ProjectionInfo *projLeft; /* for projecting lefthand exprs */ ProjectionInfo *projRight; /* for projecting subselect output */ |
