Changeset: 068b4a9e66d3 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=068b4a9e66d3
Modified Files:
        pathfinder/compiler/algebra/opt/opt_join_pd.c
Branch: Oct2010
Log Message:

Fix bug in join pushdown
(where joins may have been pushed down without proper subtree marks).


diffs (52 lines):

diff -r 2e378788c264 -r 068b4a9e66d3 
pathfinder/compiler/algebra/opt/opt_join_pd.c
--- a/pathfinder/compiler/algebra/opt/opt_join_pd.c     Wed Nov 03 16:27:41 
2010 +0100
+++ b/pathfinder/compiler/algebra/opt/opt_join_pd.c     Thu Nov 04 10:31:54 
2010 +0100
@@ -226,8 +226,7 @@
        its operands */
     for (unsigned int c = 0; c < 2; c++) {
         /* only process equi-joins */
-        if (p->kind != la_internal_op)
-            break;
+        assert (p->kind == la_internal_op);
 
         /* remove unnecessary joins
            (where both children references point to the same node) */
@@ -498,10 +497,10 @@
                    a modification if this rewrite wasn't
                    the only one. Otherwise we might end up
                    in an infinite loop. */
-                modified = join_pushdown_worker (next_join,
-                                                 clean_up_list);
-                next_join = NULL;
-
+                /* Make sure that we don't continue rewriting
+                   with a different join operator (c=1). */
+                return join_pushdown_worker (next_join,
+                                             clean_up_list);
             }   break;
 
             case la_semijoin:
@@ -675,9 +674,8 @@
                    a modification if this rewrite wasn't
                    the only one. Otherwise we might end up
                    in an infinite loop. */
-                modified = join_pushdown_worker (next_join,
-                                                 clean_up_list);
-                next_join = NULL;
+                return join_pushdown_worker (next_join,
+                                             clean_up_list);
             }   break;
 
             case la_select:
@@ -815,10 +813,9 @@
                 *p = *disjunion (eqjoin_opt (L(lp), rp, lproj, rproj),
                                  eqjoin_opt (R(lp), rp, lproj, rproj));
 
-                modified = true;
-
                 join_pushdown_worker (L(p), clean_up_list);
                 join_pushdown_worker (R(p), clean_up_list);
+                return true;
             } break;
 #endif
 
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to