From: Date: May 9 2005 6:56pm Subject: bk commit into 5.0 tree (mskold:1.1952) BUG#9246 List-Archive: http://lists.mysql.com/internals/24747 X-Bug: 9246 Message-Id: <200505091656.j49GueVL005941@localhost.localdomain> Below is the list of changes that have just been committed into a local 5.0 repository of marty. When marty does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.1952 05/05/09 18:56:29 mskold@stripped +3 -0 Fix for Bug #9246 Condition pushdown and left join, wrong result sql/sql_select.cc 1.330 05/05/09 18:44:22 mskold@stripped +3 -1 Fix for Bug #9246 Condition pushdown and left join, wrong result mysql-test/t/ndb_condition_pushdown.test 1.12 05/05/09 18:44:22 mskold@stripped +2 -0 Fix for Bug #9246 Condition pushdown and left join, wrong result mysql-test/r/ndb_condition_pushdown.result 1.11 05/05/09 18:44:22 mskold@stripped +5 -0 Fix for Bug #9246 Condition pushdown and left join, wrong result # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: mskold # Host: blowfish.ndb.mysql.com # Root: /usr/local/home/marty/MySQL/mysql-5.0 --- 1.329/sql/sql_select.cc Sun May 8 22:41:58 2005 +++ 1.330/sql/sql_select.cc Mon May 9 18:44:22 2005 @@ -5401,10 +5401,12 @@ if (!(tmp= add_found_match_trig_cond(first_inner_tab, tmp, 0))) DBUG_RETURN(1); tab->select_cond=sel->cond=tmp; + /* Push condition to storage engine if this is enabled + and the condition is not guarded */ if (thd->variables.engine_condition_pushdown) { COND *push_cond= - make_cond_for_table(cond,current_map,current_map); + make_cond_for_table(tmp,current_map,current_map); tab->table->file->pushed_cond= NULL; if (push_cond) { --- 1.10/mysql-test/r/ndb_condition_pushdown.result Mon Apr 4 21:37:42 2005 +++ 1.11/mysql-test/r/ndb_condition_pushdown.result Mon May 9 18:44:22 2005 @@ -1139,5 +1139,10 @@ select * from t2 where (attr1 < 2) = (attr2 < 2) order by pk1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using filesort +explain +select * from t3 left join t4 on t4.attr2 = t3.attr2 where t4.attr1 > 1 and t4.attr3 < 5 or t4.attr1 is null order by t4.pk1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort +1 SIMPLE t4 ALL NULL NULL NULL NULL 6 Using where set engine_condition_pushdown = @old_ecpd; DROP TABLE t1,t2,t3,t4; --- 1.11/mysql-test/t/ndb_condition_pushdown.test Thu Apr 21 11:11:17 2005 +++ 1.12/mysql-test/t/ndb_condition_pushdown.test Mon May 9 18:44:22 2005 @@ -1044,6 +1044,8 @@ select auto from t1 where string = "aaaa" collate latin1_general_ci order by auto; explain select * from t2 where (attr1 < 2) = (attr2 < 2) order by pk1; +explain +select * from t3 left join t4 on t4.attr2 = t3.attr2 where t4.attr1 > 1 and t4.attr3 < 5 or t4.attr1 is null order by t4.pk1; set engine_condition_pushdown = @old_ecpd; DROP TABLE t1,t2,t3,t4;