mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
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'.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.97 2003/02/15 20:12:40 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.98 2003/03/05 20:01:03 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -115,7 +115,7 @@ set_base_rel_pathlists(Query *root)
|
||||
/* RangeFunction --- generate a separate plan for it */
|
||||
set_function_pathlist(root, rel, rte);
|
||||
}
|
||||
else if ((inheritlist = expand_inherted_rtentry(root, rti, true))
|
||||
else if ((inheritlist = expand_inherited_rtentry(root, rti, true))
|
||||
!= NIL)
|
||||
{
|
||||
/* Relation is root of an inheritance tree, process specially */
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.149 2003/03/05 18:38:14 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.150 2003/03/05 20:01:03 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -276,8 +276,8 @@ subquery_planner(Query *parse, double tuple_fraction)
|
||||
* grouping_planner.
|
||||
*/
|
||||
if (parse->resultRelation &&
|
||||
(lst = expand_inherted_rtentry(parse, parse->resultRelation, false))
|
||||
!= NIL)
|
||||
(lst = expand_inherited_rtentry(parse, parse->resultRelation,
|
||||
false)) != NIL)
|
||||
plan = inheritance_planner(parse, lst);
|
||||
else
|
||||
plan = grouping_planner(parse, tuple_fraction);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.90 2003/02/09 06:56:27 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.91 2003/03/05 20:01:03 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -642,7 +642,7 @@ find_all_inheritors(Oid parentrel)
|
||||
}
|
||||
|
||||
/*
|
||||
* expand_inherted_rtentry
|
||||
* expand_inherited_rtentry
|
||||
* Check whether a rangetable entry represents an inheritance set.
|
||||
* If so, add entries for all the child tables to the query's
|
||||
* rangetable, and return an integer list of RT indexes for the
|
||||
@@ -666,7 +666,7 @@ find_all_inheritors(Oid parentrel)
|
||||
* XXX probably should convert the result type to Relids?
|
||||
*/
|
||||
List *
|
||||
expand_inherted_rtentry(Query *parse, Index rti, bool dup_parent)
|
||||
expand_inherited_rtentry(Query *parse, Index rti, bool dup_parent)
|
||||
{
|
||||
RangeTblEntry *rte = rt_fetch(rti, parse->rtable);
|
||||
Oid parentOID;
|
||||
|
||||
Reference in New Issue
Block a user