mirror of
https://github.com/postgres/postgres.git
synced 2025-07-20 05:03:10 +03:00
Fix for queries with 3 or more relations participating in
one clause.
This commit is contained in:
src/backend/optimizer
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.1.1.1 1996/07/09 06:21:36 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.2 1997/02/20 02:54:09 vadim Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -297,10 +297,18 @@ new_joininfo_list(List *joininfo_list, List *join_relids)
|
||||
List *xjoininfo = NIL;
|
||||
|
||||
foreach (xjoininfo, joininfo_list) {
|
||||
List *or;
|
||||
JInfo *joininfo = (JInfo*)lfirst(xjoininfo);
|
||||
|
||||
new_otherrels = joininfo->otherrels;
|
||||
if (nonoverlap_sets(new_otherrels,join_relids)) {
|
||||
foreach (or, new_otherrels)
|
||||
{
|
||||
if ( intMember (lfirsti(or), join_relids) )
|
||||
new_otherrels = lremove ((void*)lfirst(or), new_otherrels);
|
||||
}
|
||||
joininfo->otherrels = new_otherrels;
|
||||
if ( new_otherrels != NIL )
|
||||
{
|
||||
other_joininfo = joininfo_member(new_otherrels,
|
||||
current_joininfo_list);
|
||||
if(other_joininfo) {
|
||||
|
Reference in New Issue
Block a user