From: Ole John Aske Date: December 7 2010 3:06pm Subject: bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (ole.john.aske:3390 to 3391) List-Archive: http://lists.mysql.com/commits/126225 Message-Id: <20101207150653.4B8F5223@fimafeng09.norway.sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3391 Ole John Aske 2010-12-07 SPJ-scan-scan: Updated cherry picked fix for bug 58490 to latest fix being reviewed modified: sql/sql_select.cc 3390 Jan Wedvik 2010-12-07 This commit fixes an error in Table_access::get_join_type(). This method checks if the relationship between a Table_access and one of its predecessors in the join plan is an inner join or a (left) outer join. For some queries, this method would make an assert failure, because it was unable to decide the type of join. This error has now been fixed, and more regression test cases have also been added. modified: mysql-test/suite/ndb/r/ndb_join_pushdown.result mysql-test/suite/ndb/t/ndb_join_pushdown.test sql/abstract_query_plan.cc === modified file 'sql/sql_select.cc' --- a/sql/sql_select.cc 2010-12-07 11:56:10 +0000 +++ b/sql/sql_select.cc 2010-12-07 15:06:29 +0000 @@ -11661,6 +11661,16 @@ evaluate_join_record(JOIN *join, JOIN_TA } /* + Setting NESTED_LOOP_NO_MORE_ROWS (if not_exists_optimize) + also implies a 'not found' condition. However we could not + set this inside the loop above as it would prematurely + have terminated the 'first_unmatched' / 'first_unmatched->found' + calculations above. + */ + if (rc == NESTED_LOOP_NO_MORE_ROWS) + found= false; + + /* It was not just a return to lower loop level when one of the newly activated predicates is evaluated as false (See above join->return_tab= tab). @@ -11673,7 +11683,6 @@ evaluate_join_record(JOIN *join, JOIN_TA if (found) { DBUG_PRINT("info", (" found match")); - DBUG_ASSERT(rc==NESTED_LOOP_OK); /* A match from join_tab is found for the current partial join. */ rc= (*join_tab->next_select)(join, join_tab+1, 0); if (rc != NESTED_LOOP_OK && rc != NESTED_LOOP_NO_MORE_ROWS) No bundle (reason: useless for push emails).