summaryrefslogtreecommitdiff
path: root/src/include/nodes
diff options
context:
space:
mode:
authorTom Lane2006-12-26 21:37:20 +0000
committerTom Lane2006-12-26 21:37:20 +0000
commit0cbc5b1ed49ed744e856687b1d5e36d312327a34 (patch)
tree6a56142c89f023731a991141114ef070c5a3f470 /src/include/nodes
parent68996463d405a0e3e35f81371ffebbbaff7c1f63 (diff)
Fix failure due to accessing an already-freed tuple descriptor in a plan
involving HashAggregate over SubqueryScan (this is the known case, there may well be more). The bug is only latent in releases before 8.2 since they didn't try to access tupletable slots' descriptors during ExecDropTupleTable. The least bogus fix seems to be to make subqueries share the parent query's memory context, so that tupdescs they create will have the same lifespan as those of the parent query. There are comments in the code envisioning going even further by not having a separate child EState at all, but that will require rethinking executor access to range tables, which I don't want to tackle right now. Per bug report from Jean-Pierre Pelletier.
Diffstat (limited to 'src/include/nodes')
-rw-r--r--src/include/nodes/execnodes.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index f8e8f15a5db..89bd31e96ae 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.164 2006/12/24 00:29:20 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.165 2006/12/26 21:37:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -328,6 +328,8 @@ typedef struct EState
Oid es_lastoid; /* last oid processed (by INSERT) */
List *es_rowMarks; /* not good place, but there is no other */
+ bool es_is_subquery; /* true if subquery (es_query_cxt not mine) */
+
bool es_instrument; /* true requests runtime instrumentation */
bool es_select_into; /* true if doing SELECT INTO */
bool es_into_oids; /* true to generate OIDs in SELECT INTO */