]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Previous fix for "x FULL JOIN y ON true" failed to handle the case
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 24 May 2005 18:03:24 +0000 (18:03 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 24 May 2005 18:03:24 +0000 (18:03 +0000)
where there was also a WHERE-clause restriction that applied to the
join.  The check on restrictlist == NIL is really unnecessary anyway,
because select_mergejoin_clauses already checked for and complained
about any unmergejoinable join clauses.  So just take it out.

src/backend/optimizer/path/joinpath.c

index b1a25505b5e2019db39187107f0c0dd4f6759c98..9ccf784b9af169a78682004375bd46e4f8c39c80 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.82.2.2 2005/01/23 02:23:16 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.82.2.3 2005/05/24 18:03:24 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -498,15 +498,10 @@ match_unsorted_outer(Query *root,
                 * nestloop path, but since mergejoin is our only join type that
                 * supports FULL JOIN, it's necessary to generate a clauseless
                 * mergejoin path instead.
-                *
-                * Unfortunately this can't easily be extended to handle the case
-                * where there are joinclauses but none of them use mergejoinable
-                * operators; nodeMergejoin.c can only do a full join correctly if
-                * all the joinclauses are mergeclauses.
                 */
                if (mergeclauses == NIL)
                {
-                       if (jointype == JOIN_FULL && restrictlist == NIL)
+                       if (jointype == JOIN_FULL)
                                /* okay to try for mergejoin */ ;
                        else
                                continue;