From: Ole John Aske Date: April 25 2012 9:35am Subject: bzr push into mysql-5.5-cluster-7.2 branch (ole.john.aske:3901 to 3902) List-Archive: http://lists.mysql.com/commits/143652 Message-Id: <20120425093511.6353C241@fimafeng09.norway.sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3902 Ole John Aske 2012-04-25 SPJ Fix: Only try to 'make_pushed_join()' if there are multiple tables in query We want to keep a 'fast track' through the optimizer for simple, single table queries. Thus we should avoid possible overhead from finding join-pushable parts of the query if there are only a single table. modified: mysql-test/suite/ndb/r/ndb_join_pushdown_default.result sql/sql_select.cc 3901 Jan Wedvik 2012-04-25 Fix for Bug#13984817 (DATA NODE CRASHES DURING 7.0.16 TO 7.2.4 ONLINE UPGRADE/DOWNGRADE). This commit adds versions check that will prevent or abort execution of pushed queries if there are data nodes that do not support this (i.e. nodes running software version < 7.2). modified: sql/ha_ndbcluster.cc storage/ndb/include/ndb_version.h.in storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp storage/ndb/src/ndbapi/NdbQueryOperation.cpp === modified file 'mysql-test/suite/ndb/r/ndb_join_pushdown_default.result' --- a/mysql-test/suite/ndb/r/ndb_join_pushdown_default.result 2012-04-25 06:24:54 +0000 +++ b/mysql-test/suite/ndb/r/ndb_join_pushdown_default.result 2012-04-25 09:34:51 +0000 @@ -3395,7 +3395,6 @@ id select_type table type possible_keys 1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 100.00 1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 const 1 100.00 Warnings: -Note 9999 Table 't1' was optimized away, or const'ified by optimizer Note 1003 select '2' AS `a`,'1' AS `b`,'kalle' AS `c`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`a` = '1')) select * from t1, t2 @@ -5350,7 +5349,6 @@ id select_type table type possible_keys 1 SIMPLE b system NULL NULL NULL NULL 1 100.00 1 SIMPLE a ALL NULL NULL NULL NULL 4 100.00 Warnings: -Note 9999 Table 'b' was optimized away, or const'ified by optimizer Note 1003 select `test`.`a`.`k` AS `k`,`test`.`a`.`uq` AS `uq`,NULL AS `k`,NULL AS `uq` from `test`.`t` `a` select * from t as a left join t as b on a.k is null and a.uq=b.uq; === modified file 'sql/sql_select.cc' --- a/sql/sql_select.cc 2012-04-18 11:34:20 +0000 +++ b/sql/sql_select.cc 2012-04-25 09:34:51 +0000 @@ -1578,8 +1578,12 @@ JOIN::optimize() } #ifndef MCP_WL4784 - if (make_pushed_join(thd, this)) - DBUG_RETURN(1); + // Multiple tables, try to push query to storage engine + if ((tables-const_tables) > 1) + { + if (make_pushed_join(thd, this)) + DBUG_RETURN(1); + } #endif tmp_having= having; No bundle (reason: useless for push emails).