List:Commits« Previous MessageNext Message »
From:Jorgen Loland Date:September 21 2010 12:39pm
Subject:bzr push into mysql-next-mr-bugfixing branch (jorgen.loland:3244 to 3245)
Bug#49129
View as plain text  
 3245 Jorgen Loland	2010-09-21
      BUG#49129 - followup patch. Fix warning about comparing signed 
      and unsigned int.

    modified:
      sql/sql_select.cc
 3244 Roy Lyseng	2010-09-20
      Bug#55955: crash in MEMORY engine with IN(LEFT JOIN (JOIN))
      
      As indicated in the "Suggested fix", the problem is that not all
      tables in a semijoin nest has the emb_sj_nest pointer set.
      The pointer is only set if the table is contained immediately within
      the semijoin nest, but according to the documentation in sql_select.h,
      it should be set for all tables within a semijoin nest.
      This is also consistent, as a table can never be included in more than
      one semijoin nest (semijoin nests cannot be nested).
      
      I have also manually inspected all uses of emb_sj_nest, and it seems that
      all uses are still consistent (previously there was an implicit assert
      that emb_sj_nest == embedding, which no longer holds).
      
      There are a few semijoin plan changes. They happened because the choice
      of plan is now taken on a correct basis.
      
      mysql-test/include/subquery_sj.inc
        Added test case for bug#55955.
      
      mysql-test/r/subquery_sj_all.result
        Semijoin plan changed from DuplicateWeedout to Materialize.
        Added test case result for bug#55955.
      
      mysql-test/r/subquery_sj_all_jcl6.result
        Semijoin plan changed from DuplicateWeedout to Materialize.
        Added test case result for bug#55955.
      
      mysql-test/r/subquery_sj_all_jcl7.result
        Semijoin plan changed from DuplicateWeedout to Materialize.
        Added test case result for bug#55955.
      
      mysql-test/r/subquery_sj_dupsweed.result
        Added test case result for bug#55955.
      
      mysql-test/r/subquery_sj_dupsweed_jcl6.result
        Added test case result for bug#55955.
      
      mysql-test/r/subquery_sj_dupsweed_jcl7.result
        Added test case result for bug#55955.
      
      mysql-test/r/subquery_sj_firstmatch.result
        Semijoin plan changed from DuplicateWeedout to FirstMatch.
        Added test case result for bug#55955.
      
      mysql-test/r/subquery_sj_firstmatch_jcl6.result
        Semijoin plan changed from DuplicateWeedout to FirstMatch.
        Added test case result for bug#55955.
      
      mysql-test/r/subquery_sj_firstmatch_jcl7.result
        Semijoin plan changed from DuplicateWeedout to FirstMatch.
        Added test case result for bug#55955.
      
      mysql-test/r/subquery_sj_loosescan.result
        Added test case result for bug#55955.
      
      mysql-test/r/subquery_sj_loosescan_jcl6.result
        Added test case result for bug#55955.
      
      mysql-test/r/subquery_sj_loosescan_jcl7.result
        Added test case result for bug#55955.
      
      mysql-test/r/subquery_sj_mat.result
        Semijoin plan changed from DuplicateWeedout to Materialize.
        Added test case result for bug#55955.
      
      mysql-test/r/subquery_sj_mat_jcl6.result
        Semijoin plan changed from DuplicateWeedout to Materialize.
        Added test case result for bug#55955.
      
      mysql-test/r/subquery_sj_mat_jcl7.result
        Semijoin plan changed from DuplicateWeedout to Materialize.
        Added test case result for bug#55955.
      
      mysql-test/r/subquery_sj_mat_nosj.result
        Added test case result for bug#55955.
      
      mysql-test/r/subquery_sj_none.result
        Added test case result for bug#55955.
      
      mysql-test/r/subquery_sj_none_jcl6.result
        Added test case result for bug#55955.
      
      mysql-test/r/subquery_sj_none_jcl7.result
        Added test case result for bug#55955.
      
      sql/sql_select.cc
        Moved setting of emb_sj_nest from pullout_semijoin_tables() to
        make_join_statistics(). pullout_semijoin_tables() only went through
        tables immediately contained in the semijoin nests, and the code
        strictly did not belong here. It is easier to loop over all join
        tabs and check whether they belong to a semijoin nest through
        some nesting.
      
        Also did a few minor cleanups, by using explicit initializers
        instead of assignment to a variable inside an expression,
        adding a set of parentheses to make syntax clearer, fixing some
        argument documentation mistakes, and removing a redundant reference
        to 'sj_corr_tables' (it is fully contained within sj_depends_on,
        which it is ORed with).

    modified:
      mysql-test/include/subquery_sj.inc
      mysql-test/r/subquery_sj_all.result
      mysql-test/r/subquery_sj_all_jcl6.result
      mysql-test/r/subquery_sj_all_jcl7.result
      mysql-test/r/subquery_sj_dupsweed.result
      mysql-test/r/subquery_sj_dupsweed_jcl6.result
      mysql-test/r/subquery_sj_dupsweed_jcl7.result
      mysql-test/r/subquery_sj_firstmatch.result
      mysql-test/r/subquery_sj_firstmatch_jcl6.result
      mysql-test/r/subquery_sj_firstmatch_jcl7.result
      mysql-test/r/subquery_sj_loosescan.result
      mysql-test/r/subquery_sj_loosescan_jcl6.result
      mysql-test/r/subquery_sj_loosescan_jcl7.result
      mysql-test/r/subquery_sj_mat.result
      mysql-test/r/subquery_sj_mat_jcl6.result
      mysql-test/r/subquery_sj_mat_jcl7.result
      mysql-test/r/subquery_sj_mat_nosj.result
      mysql-test/r/subquery_sj_none.result
      mysql-test/r/subquery_sj_none_jcl6.result
      mysql-test/r/subquery_sj_none_jcl7.result
      sql/sql_select.cc
=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2010-09-20 14:06:02 +0000
+++ b/sql/sql_select.cc	2010-09-21 12:38:49 +0000
@@ -1276,13 +1276,13 @@ bool might_do_join_buffering(uint join_c
   /* 
      (1) sj_tab is not a const table
   */
-  return (sj_tab-sj_tab->join->join_tab != sj_tab->join->const_tables && // (1)
+  int sj_tabno= sj_tab - sj_tab->join->join_tab;
+  return (sj_tabno >= (int)sj_tab->join->const_tables && // (1)
           sj_tab->use_quick != QS_DYNAMIC_RANGE && 
-          ((join_cache_level != 0U && sj_tab->type == JT_ALL) ||
-           (join_cache_level > 4U && 
+          ((join_cache_level != 0 && sj_tab->type == JT_ALL) ||
+           (join_cache_level > 4 && 
             (sj_tab->type == JT_REF || 
-             sj_tab->type == JT_EQ_REF || 
-             sj_tab->type == JT_CONST))));
+             sj_tab->type == JT_EQ_REF))));
 }
 
 /**


Attachment: [text/bzr-bundle] bzr/jorgen.loland@oracle.com-20100921123849-daqcia4mm8jehsy8.bundle
Thread
bzr push into mysql-next-mr-bugfixing branch (jorgen.loland:3244 to 3245)Bug#49129Jorgen Loland21 Sep