From: Ole John Aske Date: January 24 2013 9:50am Subject: bzr push into mysql-trunk branch (ole.john.aske:5434 to 5435) List-Archive: http://lists.mysql.com/commits/145635 Message-Id: <20130124095024.10436.20233.5435@khepri40.no.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 5435 Ole John Aske 2013-01-24 [merge] Merge 5.6 -> trunk modified: sql/abstract_query_plan.cc 5434 Tanjot Uppal 2013-01-24 Fixed the 9 test failures on valgrind in QC run added: mysql-test/suite/innodb/t/innodb-alter-debug-wl6554-master.opt mysql-test/suite/parts/t/partition_exchange_archive-master.opt mysql-test/suite/parts/t/partition_exchange_innodb-master.opt mysql-test/suite/parts/t/partition_exchange_memory-master.opt mysql-test/suite/parts/t/partition_exchange_myisam-master.opt mysql-test/t/kill_debug-master.opt modified: mysql-test/t/init_file.test mysql-test/t/mdl_sync-master.opt === modified file 'sql/abstract_query_plan.cc' === modified file 'sql/abstract_query_plan.cc' --- a/sql/abstract_query_plan.cc 2012-11-21 12:44:48 +0000 +++ b/sql/abstract_query_plan.cc 2013-01-24 09:47:51 +0000 @@ -1,5 +1,5 @@ /* - Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -73,70 +73,37 @@ DBUG_ENTER("get_join_type"); DBUG_ASSERT(get_access_no() > predecessor->get_access_no()); - if (get_join_tab()->table->pos_in_table_list->outer_join != 0) - { - /* - This cover unnested outer joins such as - 'select * from t1 left join t2 on t1.attr=t1.pk'. - */ + const JOIN_TAB* const first_inner= get_join_tab()->first_inner; + if (first_inner == NULL) + { + // 'this' is not outer joined with any table. + DBUG_PRINT("info", ("JT_INNER_JOIN'ed table %s", + get_join_tab()->table->alias)); + DBUG_RETURN(JT_INNER_JOIN); + } + + /** + * Fall Through: 'this' is a member in an outer join, + * but 'predecessor' may still be embedded in the same + * inner join as 'this'. + */ + const JOIN_TAB* const last_inner= first_inner->last_inner; + if (predecessor->get_join_tab() >= first_inner && + predecessor->get_join_tab() <= last_inner) + { + DBUG_PRINT("info", ("JT_INNER_JOIN between %s and %s", + predecessor->get_join_tab()->table->alias, + get_join_tab()->table->alias)); + DBUG_RETURN(JT_INNER_JOIN); + } + else + { DBUG_PRINT("info", ("JT_OUTER_JOIN between %s and %s", predecessor->get_join_tab()->table->alias, get_join_tab()->table->alias)); DBUG_RETURN(JT_OUTER_JOIN); } - - const TABLE_LIST* const child_embedding= - get_join_tab()->table->pos_in_table_list->embedding; - - if (child_embedding == NULL) - { - // 'this' is not on the inner side of any left join. - DBUG_PRINT("info", ("JT_INNER_JOIN between %s and %s", - predecessor->get_join_tab()->table->alias, - get_join_tab()->table->alias)); - DBUG_RETURN(JT_INNER_JOIN); - } - - DBUG_ASSERT(child_embedding->outer_join != 0); - - const TABLE_LIST *predecessor_embedding= - predecessor->get_join_tab()->table->pos_in_table_list->embedding; - - /* - This covers the nested join case, i.e: -