summaryrefslogtreecommitdiff
path: root/src/backend/nodes
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-03-05 20:01:04 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-03-05 20:01:04 +0000
commit21591967bc19c749a100fb97ec82f6086ce5cc3c (patch)
tree0426cbc4fcca5d99db4338372816e993291293f4 /src/backend/nodes
parent147fbf9c6eba1a494c7fcd34227c5809ab39d491 (diff)
downloadpostgresql-21591967bc19c749a100fb97ec82f6086ce5cc3c.tar.gz
Turns out new IN implementation has got some problems in an UPDATE or
DELETE with inherited target table. Fix it; add a regression test. Also, correct ancient misspelling of 'inherited'.
Diffstat (limited to 'src/backend/nodes')
-rw-r--r--src/backend/nodes/copyfuncs.c14
-rw-r--r--src/backend/nodes/equalfuncs.c12
2 files changed, 16 insertions, 10 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index 2698f08478..627f62c84f 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.244 2003/02/16 02:30:37 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.245 2003/03/05 20:01:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1481,12 +1481,16 @@ _copyQuery(Query *from)
COPY_NODE_FIELD(limitCount);
COPY_NODE_FIELD(setOperations);
COPY_INTLIST_FIELD(resultRelations);
+ COPY_NODE_FIELD(in_info_list);
+ COPY_SCALAR_FIELD(hasJoinRTEs);
/*
- * We do not copy the planner internal fields: base_rel_list,
- * other_rel_list, join_rel_list, equi_key_list, in_info_list,
- * query_pathkeys, hasJoinRTEs. That would get us into copying
- * RelOptInfo/Path trees, which we don't want to do.
+ * We do not copy the other planner internal fields: base_rel_list,
+ * other_rel_list, join_rel_list, equi_key_list, query_pathkeys.
+ * That would get us into copying RelOptInfo/Path trees, which we don't
+ * want to do. It is necessary to copy in_info_list and hasJoinRTEs
+ * for the benefit of inheritance_planner(), which may try to copy a
+ * Query in which these are already set.
*/
return newnode;
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c
index 378d8e4403..6a0f366009 100644
--- a/src/backend/nodes/equalfuncs.c
+++ b/src/backend/nodes/equalfuncs.c
@@ -18,7 +18,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.187 2003/02/16 02:30:37 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.188 2003/03/05 20:01:02 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -576,12 +576,14 @@ _equalQuery(Query *a, Query *b)
COMPARE_NODE_FIELD(limitCount);
COMPARE_NODE_FIELD(setOperations);
COMPARE_INTLIST_FIELD(resultRelations);
+ COMPARE_NODE_FIELD(in_info_list);
+ COMPARE_SCALAR_FIELD(hasJoinRTEs);
/*
- * We do not check the internal-to-the-planner fields: base_rel_list,
- * other_rel_list, join_rel_list, equi_key_list, in_info_list,
- * query_pathkeys, hasJoinRTEs. They might not be set yet, and in any
- * case they should be derivable from the other fields.
+ * We do not check the other planner internal fields: base_rel_list,
+ * other_rel_list, join_rel_list, equi_key_list, query_pathkeys.
+ * They might not be set yet, and in any case they should be derivable
+ * from the other fields.
*/
return true;
}