From: Ole John Aske Date: June 30 2011 9:01am Subject: bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (ole.john.aske:3521 to 3522) List-Archive: http://lists.mysql.com/commits/140087 Message-Id: <20110630090117.95574225@fimafeng09.norway.sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3522 Ole John Aske 2011-06-30 Extended ha_ndbcluster::check_if_pushable() to also reject 'MultiScanQuery' as push-executable when the resultset has been requested to be ordered. No testcase as this will not happen in 5.1 based code. However when MRR is disabled in 'trunk-cluster-spj', one of the existing tests in ndb_join_pushdown.test without this fix. modified: sql/ha_ndbcluster.cc 3521 Ole John Aske 2011-06-30 [merge] merge mysql-5.1-telco-7.0 -> spj-scan-scan added: mysql-test/suite/ndb_rpl/r/ndb_rpl_circular_2ch_rep_status.result mysql-test/suite/ndb_rpl/r/ndb_rpl_init_rep_status.result mysql-test/suite/ndb_rpl/t/ndb_rpl_circular_2ch_rep_status.cnf mysql-test/suite/ndb_rpl/t/ndb_rpl_circular_2ch_rep_status.test mysql-test/suite/ndb_rpl/t/ndb_rpl_init_rep_status.test sql/ndb_mi.cc sql/ndb_mi.h modified: configure.in mysql-test/suite/ndb/r/ndb_basic.result sql/Makefile.am sql/ha_ndbcluster.cc sql/ha_ndbcluster.h sql/ha_ndbcluster_binlog.cc storage/ndb/CMakeLists.txt storage/ndb/include/ndbapi/NdbIndexStat.hpp storage/ndb/ndb_configure.m4 storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp storage/ndb/src/kernel/blocks/suma/Suma.cpp storage/ndb/src/mgmsrv/MgmtSrvr.cpp storage/ndb/src/ndbapi/NdbIndexStatImpl.cpp storage/ndb/src/ndbapi/NdbIndexStatImpl.hpp storage/ndb/src/ndbapi/NdbQueryBuilder.cpp storage/ndb/src/ndbapi/NdbQueryBuilder.hpp storage/ndb/src/ndbapi/NdbQueryBuilderImpl.hpp storage/ndb/src/ndbapi/NdbQueryOperation.cpp storage/ndb/src/ndbapi/NdbTransaction.cpp storage/ndb/test/ndbapi/testMgmd.cpp storage/ndb/test/ndbapi/testScan.cpp storage/ndb/test/run-test/daily-basic-tests.txt === modified file 'sql/ha_ndbcluster.cc' --- a/sql/ha_ndbcluster.cc 2011-06-30 08:49:22 +0000 +++ b/sql/ha_ndbcluster.cc 2011-06-30 09:00:45 +0000 @@ -14397,8 +14397,9 @@ ha_ndbcluster::check_if_pushable(const N return FALSE; } + const NdbQueryDef& queryDef= m_pushed_join_member->get_query_def(); const NdbQueryOperationDef* const root_operation= - m_pushed_join_member->get_query_def().getQueryOperation((uint)PUSHED_ROOT); + queryDef.getQueryOperation((uint)PUSHED_ROOT); const NdbQueryOperationTypeWrapper& query_def_type= root_operation->getType(); @@ -14463,6 +14464,13 @@ ha_ndbcluster::check_if_pushable(const N expected_index->getName())); return FALSE; } + if (needSorted && queryDef.getQueryType() == NdbQueryDef::MultiScanQuery) + { + DBUG_PRINT("info", + ("OrderedIndexScan with scan siblings " + "can not execute as pushed join.")); + return FALSE; + } break; default: No bundle (reason: useless for push emails).