aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-08-22 04:06:22 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-08-22 04:06:22 +0000
commit0147b1934f251183d3614bca011bf21205890835 (patch)
treeed7df11ba0ecbdae22095a2eeacbd204dcdca1b8 /src/include
parent94e90d9a86a186c83891fe4ce3e343bcf1860053 (diff)
downloadpostgresql-0147b1934f251183d3614bca011bf21205890835.tar.gz
postgresql-0147b1934f251183d3614bca011bf21205890835.zip
Fix a many-legged critter reported by chifungfan@yahoo.com: under the
right circumstances a hash join executed as a DECLARE CURSOR/FETCH query would crash the backend. Problem as seen in current sources was that the hash tables were stored in a context that was a child of TransactionCommandContext, which got zapped at completion of the FETCH command --- but cursor cleanup executed at COMMIT expected the tables to still be valid. I haven't chased down the details as seen in 7.0.* but I'm sure it's the same general problem.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/executor/hashjoin.h4
-rw-r--r--src/include/nodes/execnodes.h11
2 files changed, 10 insertions, 5 deletions
diff --git a/src/include/executor/hashjoin.h b/src/include/executor/hashjoin.h
index 8d4cb98469f..25a8174f294 100644
--- a/src/include/executor/hashjoin.h
+++ b/src/include/executor/hashjoin.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: hashjoin.h,v 1.18 2000/07/12 02:37:30 tgl Exp $
+ * $Id: hashjoin.h,v 1.19 2000/08/22 04:06:21 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -26,7 +26,7 @@
* This makes it easy and fast to release the storage when we don't need it
* anymore.
*
- * The contexts are made children of TransactionCommandContext, ensuring
+ * The hashtable contexts are made children of the per-query context, ensuring
* that they will be discarded at end of statement even if the join is
* aborted early by an error. (Likewise, any temporary files we make will
* be cleaned up by the virtual file manager in event of an error.)
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 6e691c1d786..1ec14f4a969 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: execnodes.h,v 1.46 2000/08/13 02:50:24 tgl Exp $
+ * $Id: execnodes.h,v 1.47 2000/08/22 04:06:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -223,9 +223,14 @@ typedef struct EState
uint32 es_processed; /* # of tuples processed */
Oid es_lastoid; /* last oid processed (by INSERT) */
List *es_rowMark; /* not good place, but there is no other */
- /* these two fields are storage space for ExecConstraints(): */
+ MemoryContext es_query_cxt; /* per-query context in which EState lives */
+ /* this ExprContext is for per-output-tuple operations, such as
+ * constraint checks and index-value computations. It can be reset
+ * for each output tuple. Note that it will be created only if needed.
+ */
+ ExprContext *es_per_tuple_exprcontext;
+ /* this field is storage space for ExecConstraints(): */
List **es_result_relation_constraints;
- ExprContext *es_constraint_exprcontext;
/* Below is to re-evaluate plan qual in READ COMMITTED mode */
struct Plan *es_origPlan;
Pointer es_evalPlanQual;