From: Ole John Aske Date: March 17 2011 1:21pm Subject: bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (ole.john.aske:3448 to 3449) List-Archive: http://lists.mysql.com/commits/133213 Message-Id: <20110317132110.D4B3C223@fimafeng09.norway.sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3449 Ole John Aske 2011-03-17 SPJ: Fixed compiler warnings and MTR failures from last commit modified: sql/ha_ndbcluster.cc sql/ha_ndbcluster.h 3448 Ole John Aske 2011-03-17 SPJ refactoring of handler interface extensions used for retrospecting pushed joins. Intention is to clean up code, improve readability, *and* prepare for later enhanced EXPLAIN of pushed joins which should also include info about the parent/child relations. Renamed member variables an methods in order to clearify theirs usage: - handler::is_parent_of_pushed_join() -> handler::number_of_pushed_joins() - handler::member_of_pushed_join() -> handler::root_of_pushed_join() - ha_ndbcluster::m_pushed_join -> ha_ndbcluster::m_pushed_join_member Introduced: int ha_ndbcluster::m_pushed_join_operation: Enumerates the pushed query operation which relates to this handler instance static const uint ha_ndbcluster::PUSHED_ROOT= 0: Enumerates the pushed operation being the root in the pushed query. Mainly for improved readability of the code. handler::parent_of_pushed_join(): Returns the pushed parent of this handler instance. NULL if operation is unpushed, or if this is the root of the pushed query. modified: sql/ha_ndbcluster.cc sql/ha_ndbcluster.h sql/handler.h sql/sql_select.cc storage/ndb/include/ndbapi/NdbQueryBuilder.hpp storage/ndb/src/ndbapi/NdbQueryBuilder.cpp === modified file 'sql/ha_ndbcluster.cc' --- a/sql/ha_ndbcluster.cc 2011-03-17 12:25:32 +0000 +++ b/sql/ha_ndbcluster.cc 2011-03-17 13:20:46 +0000 @@ -907,7 +907,7 @@ ha_ndbcluster::check_if_pushable(const N } const NdbQueryOperationDef* const root_operation= - m_pushed_join_member->get_query_def().getQueryOperation(PUSHED_ROOT); + m_pushed_join_member->get_query_def().getQueryOperation((uint)PUSHED_ROOT); const NdbQueryOperationTypeWrapper& query_def_type= root_operation->getType(); @@ -1022,7 +1022,7 @@ ha_ndbcluster::create_pushed_join(NdbQue m_pushed_join_member->get_operation_count(), m_pushed_join_member->get_table(0)->alias, NdbQueryOperationDef::getTypeName( - m_pushed_join_member->get_query_def().getQueryOperation(PUSHED_ROOT)->getType())) + m_pushed_join_member->get_query_def().getQueryOperation((uint)PUSHED_ROOT)->getType())) ); // There may be referrences to Field values from tables outside the scope of @@ -1167,7 +1167,7 @@ ha_ndbcluster::test_push_flag(enum ha_pu } const NdbQueryDef& query_def = m_pushed_join_member->get_query_def(); const NdbQueryOperationTypeWrapper& root_type= - query_def.getQueryOperation(PUSHED_ROOT)->getType(); + query_def.getQueryOperation((uint)PUSHED_ROOT)->getType(); /** * Primary key/ unique key lookup is always 'ordered' wrt. itself. @@ -4706,7 +4706,7 @@ int ha_ndbcluster::ordered_index_scan(co DBUG_RETURN(error); NdbQuery* const query= m_active_query; - if (sorted && query->getQueryOperation(PUSHED_ROOT) + if (sorted && query->getQueryOperation((uint)PUSHED_ROOT) ->setOrdering(descending ? NdbQueryOptions::ScanOrdering_descending : NdbQueryOptions::ScanOrdering_ascending)) { @@ -6856,7 +6856,7 @@ int ha_ndbcluster::read_range_first_to_b if (m_use_partition_pruning) { - DBUG_ASSERT(!m_pushed_join_operation != PUSHED_ROOT); + DBUG_ASSERT(m_pushed_join_operation != PUSHED_ROOT); get_partition_set(table, buf, active_index, start_key, &part_spec); DBUG_PRINT("info", ("part_spec.start_part: %u part_spec.end_part: %u", part_spec.start_part, part_spec.end_part)); @@ -13974,7 +13974,7 @@ ha_ndbcluster::read_multi_range_first(KE NdbQuery* const query= m_active_query; if (sorted && - query->getQueryOperation(PUSHED_ROOT)->setOrdering(NdbQueryOptions::ScanOrdering_ascending)) + query->getQueryOperation((uint)PUSHED_ROOT)->setOrdering(NdbQueryOptions::ScanOrdering_ascending)) ERR_RETURN(query->getNdbError()); } } // check_if_pushable() === modified file 'sql/ha_ndbcluster.h' --- a/sql/ha_ndbcluster.h 2011-03-17 12:25:32 +0000 +++ b/sql/ha_ndbcluster.h 2011-03-17 13:20:46 +0000 @@ -940,7 +940,7 @@ private: const class ndb_pushed_join *m_pushed_join_member; // Pushed join def. I am member of int m_pushed_join_operation; // Op. id. in above pushed join - static const uint PUSHED_ROOT= 0; // Op. id. if I'm root + static const int PUSHED_ROOT= 0; // Op. id. if I'm root bool m_disable_pushed_join; // Pushed execution allowed? NdbQuery* m_active_query; // Pushed query instance executing No bundle (reason: useless for push emails).