From: Roy Lyseng Date: March 22 2012 1:19pm Subject: bzr push into mysql-trunk branch (roy.lyseng:3831 to 3832) Bug#13846687 List-Archive: http://lists.mysql.com/commits/143285 X-Bug: 13846687 Message-Id: <20120322131948.5C4BF211@tyr67.norway.sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3832 Roy Lyseng 2012-03-22 Bug#13846687: Assert 'tab->use_join_cache == ALG_NONE' in setup_join_buffering There were two bugs when handling more than one semi-join nest when setting up a FirstMatch strategy. The first problem turned out to be a duplicate of bug#13685026. The second problem was that Optimize_table_order::semijoin_firstmatch_loosescan_access_paths needs to calculate the number of semi-join inner tables, in order to see if join buffering can be used. The code anticipated that only one semi-join nest could be handled by the FirstMatch strategy. There are currently no wrong results caused by this, but it is nevertheless good to fix this code. sql/sql_planner.cc In Optimize_table_order::semijoin_firstmatch_loosescan_access_paths(), calculate the number of semi-join inner tables by looping over the set of handled tables and count those that are within a semi-join nest. modified: sql/sql_planner.cc 3831 Matthias.Leich 2012-03-22 Fix for Bug#13840762 - A TEST FOR INNODB WITH DIFFERENT PAGESIZES IS MISSING added: mysql-test/include/search_pattern_in_file.inc mysql-test/suite/innodb/r/innodb_page_size_func.result mysql-test/suite/innodb/t/innodb_page_size_func.test === modified file 'sql/sql_planner.cc' --- a/sql/sql_planner.cc 2012-03-22 08:17:51 +0000 +++ b/sql/sql_planner.cc 2012-03-22 13:11:37 +0000 @@ -2759,9 +2759,14 @@ bool Optimize_table_order::semijoin_firs rowcount= positions[first_tab - 1].prefix_record_count; } - const uint table_count= - my_count_bits(positions[first_tab].table->emb_sj_nest->sj_inner_tables); + uint table_count= 0; uint no_jbuf_before; + for (uint i= first_tab; i <= last_tab; i++) + { + remaining_tables|= positions[i].table->table->map; + if (positions[i].table->emb_sj_nest) + table_count++; + } if (loosescan) { // LooseScan: May use join buffering for all tables after last inner table. @@ -2778,8 +2783,6 @@ bool Optimize_table_order::semijoin_firs no_jbuf_before= (table_count > 1) ? last_tab + 1 : first_tab; } - for (uint i= first_tab; i <= last_tab; i++) - remaining_tables|= positions[i].table->table->map; for (uint i= first_tab; i <= last_tab; i++) { No bundle (reason: useless for push emails).