From: magnus.blaudd Date: September 30 2011 11:05am Subject: bzr push into mysql-5.5-cluster branch (magnus.blaudd:3556 to 3557) List-Archive: http://lists.mysql.com/commits/141231 Message-Id: <201109301106.p8UB64VQ032461@acsmt358.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3557 magnus.blaudd@stripped 2011-09-30 [merge] Merge modified: cmake/configure.pl sql/abstract_query_plan.cc sql/ha_ndbcluster.cc sql/ha_ndbcluster.h sql/ha_ndbcluster_binlog.cc sql/ha_ndbcluster_cond.cc sql/ha_ndbcluster_cond.h sql/ha_ndbcluster_connection.cc sql/ha_ndbcluster_push.cc sql/ha_ndbcluster_push.h sql/handler.cc sql/handler.h sql/rpl_injector.h sql/rpl_mi.cc sql/rpl_mi.h sql/table.cc storage/ndb/CMakeLists.txt 3556 jonas oreland 2011-09-30 ndb - reenable rpl_ndb_mixed_implicit_commit_binlog, it does not fail on SET PASSWORD, it did however include a file that had moved modified: mysql-test/suite/rpl_ndb/t/disabled.def mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_implicit_commit_binlog.test === modified file 'cmake/configure.pl' --- a/cmake/configure.pl 2011-09-29 12:41:31 +0000 +++ b/cmake/configure.pl 2011-09-30 11:05:03 +0000 @@ -206,6 +206,7 @@ foreach my $option (@ARGV) $cmakeargs = $cmakeargs." \"-DWITH_COMMENT=".substr($option,13)."\""; next; } +#ifndef MCP_NDB_BUILD_INTEGRATION if ($option =~ /with-classpath=/) { $cmakeargs = $cmakeargs." \"-DWITH_CLASSPATH=".substr($option,15)."\""; @@ -226,6 +227,7 @@ foreach my $option (@ARGV) $cmakeargs = $cmakeargs." ".substr($option,11); next; } +#endif if ($option =~ /with-gcov/) { $cmakeargs = $cmakeargs." -DENABLE_GCOV=ON"; === modified file 'sql/abstract_query_plan.cc' --- a/sql/abstract_query_plan.cc 2011-09-28 10:55:58 +0000 +++ b/sql/abstract_query_plan.cc 2011-09-30 11:05:03 +0000 @@ -16,10 +16,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation -#endif - #include "sql_priv.h" #include "sql_select.h" #include "abstract_query_plan.h" === modified file 'sql/ha_ndbcluster.cc' --- a/sql/ha_ndbcluster.cc 2011-09-30 06:57:16 +0000 +++ b/sql/ha_ndbcluster.cc 2011-09-30 11:05:03 +0000 @@ -21,10 +21,6 @@ MySQL and NDB Cluster */ -#ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation -#endif - #include "ha_ndbcluster_glue.h" #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE @@ -45,7 +41,9 @@ #include "ndb_table_guard.h" #include "ndb_global_schema_lock.h" #include "ndb_global_schema_lock_guard.h" +#ifndef NDB_WITHOUT_JOIN_PUSHDOWN #include "abstract_query_plan.h" +#endif #include "ndb_dist_priv_util.h" #include "ha_ndb_index_stat.h" @@ -826,7 +824,7 @@ SHOW_VAR ndb_status_index_stat_variables {NullS, NullS, SHOW_LONG} }; -#ifndef NO_PUSHED_JOIN +#ifndef NDB_WITHOUT_JOIN_PUSHDOWN static int ndbcluster_make_pushed_join(handlerton *, THD*,AQP::Join_plan*, uint*); #endif @@ -2940,17 +2938,7 @@ static const ulong index_type_flags[]= HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | - HA_READ_ORDER | - /* - NOTE 1: our ordered indexes are not really clustered - but since accesing data when scanning index is free - it's a good approxiamtion - - NOTE 2: We really should consider DD attributes here too - (for which there is IO to read data when scanning index) - but that will need to handled later... - */ - HA_CLUSTERED_INDEX, + HA_READ_ORDER, /* UNIQUE_INDEX */ HA_ONLY_WHOLE_INDEX, @@ -2959,15 +2947,13 @@ static const ulong index_type_flags[]= HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | - HA_READ_ORDER | - HA_CLUSTERED_INDEX, + HA_READ_ORDER, /* ORDERED_INDEX */ HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | - HA_READ_ORDER | - HA_CLUSTERED_INDEX + HA_READ_ORDER }; static const int index_flags_size= sizeof(index_type_flags)/sizeof(ulong); @@ -3005,9 +2991,24 @@ inline ulong ha_ndbcluster::index_flags( bool ha_ndbcluster::primary_key_is_clustered() { - if (table->s->primary_key != MAX_KEY) - return test(index_flags(table->s->primary_key, 0, 0) & HA_CLUSTERED_INDEX); - return FALSE; + + if (table->s->primary_key == MAX_KEY) + return false; + + /* + NOTE 1: our ordered indexes are not really clustered + but since accesing data when scanning index is free + it's a good approximation + + NOTE 2: We really should consider DD attributes here too + (for which there is IO to read data when scanning index) + but that will need to be handled later... + */ + const ndb_index_type idx_type = + get_index_type_from_table(table->s->primary_key); + return (idx_type == PRIMARY_KEY_ORDERED_INDEX || + idx_type == UNIQUE_ORDERED_INDEX || + idx_type == ORDERED_INDEX); } bool ha_ndbcluster::check_index_fields_in_write_set(uint keyno) @@ -3048,6 +3049,7 @@ int ha_ndbcluster::pk_read(const uchar * NdbOperation::LockMode lm= get_ndb_lock_mode(m_lock.type); +#ifndef NDB_WITHOUT_JOIN_PUSHDOWN if (check_if_pushable(NdbQueryOperationDef::PrimaryKeyAccess, table->s->primary_key)) { // Is parent of pushed join @@ -3081,6 +3083,7 @@ int ha_ndbcluster::pk_read(const uchar * } } else +#endif { if (m_pushed_join_operation == PUSHED_ROOT) { @@ -3462,6 +3465,7 @@ int ha_ndbcluster::unique_index_read(con NdbOperation::LockMode lm= get_ndb_lock_mode(m_lock.type); +#ifndef NDB_WITHOUT_JOIN_PUSHDOWN if (check_if_pushable(NdbQueryOperationDef::UniqueIndexAccess, active_index)) { DBUG_ASSERT(lm == NdbOperation::LM_CommittedRead); @@ -3492,6 +3496,7 @@ int ha_ndbcluster::unique_index_read(con } } else +#endif { if (m_pushed_join_operation == PUSHED_ROOT) { @@ -3852,6 +3857,7 @@ ha_ndbcluster::pk_unique_index_read_key( extern void sql_print_information(const char *format, ...); +#ifndef NDB_WITHOUT_JOIN_PUSHDOWN static bool is_shrinked_varchar(const Field *field) @@ -3931,8 +3937,9 @@ ha_ndbcluster::pk_unique_index_read_key_ const int ret= create_pushed_join(paramValues, key_def->key_parts); DBUG_RETURN(ret); -} // ha_ndbcluster::pk_unique_index_read_key_pushed +} +#endif /** Count number of columns in key part. */ static uint @@ -4094,6 +4101,7 @@ int ha_ndbcluster::ordered_index_scan(co pbound = &bound; } +#ifndef NDB_WITHOUT_JOIN_PUSHDOWN if (check_if_pushable(NdbQueryOperationDef::OrderedIndexScan, active_index, sorted)) { @@ -4122,7 +4130,8 @@ int ha_ndbcluster::ordered_index_scan(co DBUG_ASSERT(!uses_blob_value(table->read_set)); // Can't have BLOB in pushed joins (yet) } - else // if (check_if_pushable(NdbQueryOperationDef::OrderedIndexScan)) + else +#endif { if (m_pushed_join_operation == PUSHED_ROOT) { @@ -4287,6 +4296,7 @@ int ha_ndbcluster::full_table_scan(const if (table_share->primary_key == MAX_KEY) get_hidden_fields_scan(&options, gets); +#ifndef NDB_WITHOUT_JOIN_PUSHDOWN if (check_if_pushable(NdbQueryOperationDef::TableScan)) { const int error= create_pushed_join(); @@ -4296,7 +4306,8 @@ int ha_ndbcluster::full_table_scan(const m_thd_ndb->m_scan_count++; DBUG_ASSERT(!uses_blob_value(table->read_set)); // Can't have BLOB in pushed joins (yet) } - else // if (check_if_pushable(NdbQueryOperationDef::TableScan)) + else +#endif { if (m_pushed_join_operation == PUSHED_ROOT) { @@ -7253,11 +7264,7 @@ int ha_ndbcluster::index_first(uchar *bu // Start the ordered index scan and fetch the first row // Only HA_READ_ORDER indexes get called by index_first -#ifdef MCP_BUG11764737 - const int error= ordered_index_scan(0, 0, TRUE, FALSE, buf, NULL); -#else const int error= ordered_index_scan(0, 0, m_sorted, FALSE, buf, NULL); -#endif table->status=error ? STATUS_NOT_FOUND: 0; DBUG_RETURN(error); } @@ -7267,11 +7274,7 @@ int ha_ndbcluster::index_last(uchar *buf { DBUG_ENTER("ha_ndbcluster::index_last"); ha_statistic_increment(&SSV::ha_read_last_count); -#ifdef MCP_BUG11764737 - const int error= ordered_index_scan(0, 0, TRUE, TRUE, buf, NULL); -#else const int error= ordered_index_scan(0, 0, m_sorted, TRUE, buf, NULL); -#endif table->status=error ? STATUS_NOT_FOUND: 0; DBUG_RETURN(error); } @@ -7999,6 +8002,7 @@ int ha_ndbcluster::reset() { m_cond->cond_clear(); } +#ifndef NDB_WITHOUT_JOIN_PUSHDOWN DBUG_ASSERT(m_active_query == NULL); if (m_pushed_join_operation==PUSHED_ROOT) // Root of pushed query { @@ -8007,6 +8011,7 @@ int ha_ndbcluster::reset() m_pushed_join_member= NULL; m_pushed_join_operation= -1; m_disable_pushed_join= FALSE; +#endif /* Regular partition pruning will set the bitmap appropriately. @@ -11445,8 +11450,6 @@ ha_ndbcluster::~ha_ndbcluster() release_blobs_buffer(); // Check for open cursor/transaction - DBUG_ASSERT(m_active_cursor == NULL); - DBUG_ASSERT(m_active_query == NULL); DBUG_ASSERT(m_thd_ndb == NULL); // Discard any generated condition @@ -11457,12 +11460,15 @@ ha_ndbcluster::~ha_ndbcluster() m_cond= NULL; } DBUG_PRINT("info", ("Deleting pushed joins")); +#ifndef NDB_WITHOUT_JOIN_PUSHDOWN DBUG_ASSERT(m_active_query == NULL); + DBUG_ASSERT(m_active_cursor == NULL); if (m_pushed_join_operation==PUSHED_ROOT) { delete m_pushed_join_member; // Also delete QueryDef } m_pushed_join_member= NULL; +#endif DBUG_VOID_RETURN; } @@ -12689,7 +12695,9 @@ static int ndbcluster_init(void *p) h->discover= ndbcluster_discover; h->find_files= ndbcluster_find_files; h->table_exists_in_engine= ndbcluster_table_exists_in_engine; +#ifndef NDB_WITHOUT_JOIN_PUSHDOWN h->make_pushed_join= ndbcluster_make_pushed_join; +#endif } // Initialize ndb interface @@ -14679,6 +14687,7 @@ ha_ndbcluster::read_multi_range_first(KE break; } +#ifndef NDB_WITHOUT_JOIN_PUSHDOWN /* Create the scan operation for the first scan range. */ if (check_if_pushable(NdbQueryOperationDef::OrderedIndexScan, active_index, @@ -14695,9 +14704,10 @@ ha_ndbcluster::read_multi_range_first(KE query->getQueryOperation((uint)PUSHED_ROOT)->setOrdering(NdbQueryOptions::ScanOrdering_ascending)) ERR_RETURN(query->getNdbError()); } - } // check_if_pushable() - - else if (!m_multi_cursor) + } + else +#endif + if (!m_multi_cursor) { if (m_pushed_join_operation == PUSHED_ROOT) { @@ -15193,7 +15203,7 @@ ha_ndbcluster::read_multi_range_fetch_ne } #endif -#ifndef NO_PUSHED_JOIN +#ifndef NDB_WITHOUT_JOIN_PUSHDOWN /** * Try to find pushable subsets of a join plan. @@ -15252,8 +15262,10 @@ int ndbcluster_make_pushed_join(handlert } } DBUG_RETURN(0); -} // ndbcluster_make_pushed_join - +} +#endif + + /** * In case a pushed join having the table for this handler as its root * has been produced. ::assign_pushed_join() is responsible for setting @@ -15279,7 +15291,7 @@ ha_ndbcluster::assign_pushed_join(const pushed_join->get_operation_count()-1)); DBUG_RETURN(0); -} // ha_ndbcluster::assign_pushed_join() +} /** @@ -15322,7 +15334,7 @@ ha_ndbcluster::maybe_pushable_join(const } return true; -} // ha_ndbcluster::is_pushable() +} /** * Check if this table access operation (and a number of succeding operation) @@ -15338,6 +15350,7 @@ ha_ndbcluster::maybe_pushable_join(const * with sorted results. * @return True if the operation may be pushed. */ +#ifndef NDB_WITHOUT_JOIN_PUSHDOWN bool ha_ndbcluster::check_if_pushable(int type, //NdbQueryOperationDef::Type, uint idx, @@ -15396,7 +15409,8 @@ ha_ndbcluster::create_pushed_join(const m_thd_ndb->m_pushed_queries_executed++; DBUG_RETURN(0); -} // ha_ndbcluster::create_pushed_join +} +#endif /** @@ -15536,7 +15550,6 @@ ha_ndbcluster::test_push_flag(enum ha_pu DBUG_RETURN(false); } -#endif /** @param[in] comment table comment defined by user === modified file 'sql/ha_ndbcluster.h' --- a/sql/ha_ndbcluster.h 2011-09-23 12:40:40 +0000 +++ b/sql/ha_ndbcluster.h 2011-09-30 10:14:10 +0000 @@ -21,10 +21,6 @@ */ -#ifdef USE_PRAGMA_INTERFACE -#pragma interface /* gcc class implementation */ -#endif - /* Blob tables and events are internal to NDB and must never be accessed */ #define IS_NDB_BLOB_PREFIX(A) is_prefix(A, "NDB$BLOB") @@ -488,6 +484,13 @@ static void set_tabname(const char *path bool maybe_pushable_join(const char*& reason) const; int assign_pushed_join(const ndb_pushed_join* pushed_join); +#ifdef NDB_WITHOUT_JOIN_PUSHDOWN + enum ha_push_flag { + HA_PUSH_BLOCK_CONST_TABLE, + HA_PUSH_MULTIPLE_DEPENDENCY, + HA_PUSH_NO_ORDERED_INDEX + }; +#endif bool test_push_flag(enum ha_push_flag flag) const; uint number_of_pushed_joins() const; === modified file 'sql/ha_ndbcluster_binlog.cc' --- a/sql/ha_ndbcluster_binlog.cc 2011-09-23 12:40:40 +0000 +++ b/sql/ha_ndbcluster_binlog.cc 2011-09-28 14:55:31 +0000 @@ -643,6 +643,7 @@ ndbcluster_binlog_index_purge_file(THD * } +#ifndef NDB_WITHOUT_DIST_PRIV // Determine if privilege tables are distributed, ie. stored in NDB static bool priv_tables_are_in_ndb(THD *thd) @@ -678,7 +679,7 @@ priv_tables_are_in_ndb(THD *thd) } DBUG_RETURN(distributed); } - +#endif static void ndbcluster_binlog_log_query(handlerton *hton, THD *thd, enum_binlog_command binlog_command, @@ -730,6 +731,7 @@ ndbcluster_binlog_log_query(handlerton * type= SOT_DROP_DB; DBUG_ASSERT(FALSE); break; +#ifndef NDB_WITHOUT_DIST_PRIV case LOGCOM_CREATE_USER: type= SOT_CREATE_USER; if (priv_tables_are_in_ndb(thd)) @@ -770,6 +772,7 @@ ndbcluster_binlog_log_query(handlerton * log= 1; } break; +#endif } if (log) { === modified file 'sql/ha_ndbcluster_cond.cc' --- a/sql/ha_ndbcluster_cond.cc 2011-09-02 09:16:56 +0000 +++ b/sql/ha_ndbcluster_cond.cc 2011-09-30 10:14:10 +0000 @@ -20,10 +20,6 @@ This file defines the NDB Cluster handler engine_condition_pushdown */ -#ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation -#endif - #include "ha_ndbcluster_glue.h" #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE === modified file 'sql/ha_ndbcluster_cond.h' --- a/sql/ha_ndbcluster_cond.h 2011-07-05 12:46:07 +0000 +++ b/sql/ha_ndbcluster_cond.h 2011-09-30 10:14:10 +0000 @@ -21,10 +21,6 @@ the NDB Cluster handler */ -#ifdef USE_PRAGMA_INTERFACE -#pragma interface /* gcc class implementation */ -#endif - typedef enum ndb_item_type { NDB_VALUE = 0, // Qualified more with Item::Type NDB_FIELD = 1, // Qualified from table definition === modified file 'sql/ha_ndbcluster_connection.cc' --- a/sql/ha_ndbcluster_connection.cc 2011-07-05 12:46:07 +0000 +++ b/sql/ha_ndbcluster_connection.cc 2011-09-30 10:14:10 +0000 @@ -16,10 +16,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation -#endif - #include "ha_ndbcluster_glue.h" #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE === modified file 'sql/ha_ndbcluster_push.cc' --- a/sql/ha_ndbcluster_push.cc 2011-09-28 10:55:58 +0000 +++ b/sql/ha_ndbcluster_push.cc 2011-09-30 11:05:03 +0000 @@ -22,14 +22,9 @@ to the ndb data node (for execution by the SPJ block). */ -#ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation -#endif #include "ha_ndbcluster_glue.h" -#include "rpl_mi.h" - #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE #include "ha_ndbcluster.h" @@ -45,12 +40,6 @@ #include - -#ifdef ndb_dynamite -#undef assert -#define assert(x) do { if(x) break; ::printf("%s %d: assert failed: %s\n", __FILE__, __LINE__, #x); ::fflush(stdout); ::signal(SIGABRT,SIG_DFL); ::abort(); ::kill(::getpid(),6); ::kill(::getpid(),9); } while (0) -#endif - #define EXPLAIN_NO_PUSH(msgfmt, ...) \ do \ { \ === modified file 'sql/ha_ndbcluster_push.h' --- a/sql/ha_ndbcluster_push.h 2011-09-28 10:55:58 +0000 +++ b/sql/ha_ndbcluster_push.h 2011-09-30 11:05:03 +0000 @@ -15,10 +15,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifdef USE_PRAGMA_INTERFACE -#pragma interface /* gcc class implementation */ -#endif - #include "sql_bitmap.h" class NdbTransaction; === modified file 'sql/handler.cc' --- a/sql/handler.cc 2011-09-22 13:41:13 +0000 +++ b/sql/handler.cc 2011-09-28 08:49:39 +0000 @@ -4778,7 +4778,7 @@ void ha_binlog_log_query(THD *thd, handl #endif -#ifndef MC_GLOBAL_SCHEMA_LOCK +#ifndef MCP_GLOBAL_SCHEMA_LOCK /** Fill list of htons which are initialized and have the global_schema_func set */ === modified file 'sql/handler.h' --- a/sql/handler.h 2011-09-22 13:41:13 +0000 +++ b/sql/handler.h 2011-09-28 18:45:32 +0000 @@ -304,14 +304,6 @@ typedef Bitmap HA_AL */ #define HA_KEY_SCAN_NOT_ROR 128 -#ifndef MCP_WL4784 -/* - no IO if read data when scan index - i.e index is covering -*/ -#define HA_CLUSTERED_INDEX 256 -#endif - /* operations for disable/enable indexes */ #define HA_KEY_SWITCH_NONUNIQ 0 #define HA_KEY_SWITCH_ALL 1 === modified file 'sql/rpl_injector.h' --- a/sql/rpl_injector.h 2011-09-21 10:57:59 +0000 +++ b/sql/rpl_injector.h 2011-09-28 09:11:12 +0000 @@ -172,9 +172,6 @@ public: use_table() is called after any *_row() function has been called for the transaction. - The caller is responsible for filtering out table map events - which shouldn't be included due to binlog_do/ignore db. - RETURN VALUE 0 All OK === modified file 'sql/rpl_mi.cc' --- a/sql/rpl_mi.cc 2011-08-31 10:39:08 +0000 +++ b/sql/rpl_mi.cc 2011-09-28 10:20:42 +0000 @@ -51,9 +51,6 @@ Master_info::Master_info(bool is_slave_r mysql_cond_init(key_master_info_start_cond, &start_cond, NULL); mysql_cond_init(key_master_info_stop_cond, &stop_cond, NULL); -#ifndef MCP_WL4080 - master_epoch= 0; -#endif #ifndef MCP_WL3127 bind_addr[0] = 0; #endif === modified file 'sql/rpl_mi.h' --- a/sql/rpl_mi.h 2011-08-31 10:39:08 +0000 +++ b/sql/rpl_mi.h 2011-09-28 10:20:42 +0000 @@ -113,9 +113,6 @@ class Master_info : public Slave_reporti DYNAMIC_ARRAY ignore_server_ids; ulong master_id; -#ifndef MCP_WL4080 - uint64 master_epoch; -#endif #ifndef MCP_WL3127 char bind_addr[HOSTNAME_LENGTH+1]; #endif === modified file 'sql/table.cc' --- a/sql/table.cc 2011-08-31 10:39:08 +0000 +++ b/sql/table.cc 2011-09-28 10:32:50 +0000 @@ -2054,7 +2054,6 @@ int open_table_from_share(THD *thd, TABL #else tmp= fix_partition_func(thd, outparam, is_create_table); #endif - outparam->part_info->item_free_list= part_func_arena.free_list; } outparam->part_info->item_free_list= part_func_arena.free_list; partititon_err: === modified file 'storage/ndb/CMakeLists.txt' --- a/storage/ndb/CMakeLists.txt 2011-09-29 05:59:15 +0000 +++ b/storage/ndb/CMakeLists.txt 2011-09-30 11:05:03 +0000 @@ -89,6 +89,12 @@ IF(NOT MYSQL_CLUSTER_VERSION) # Online alter table not supported in non MySQL Cluster # versions yet, compile ndbcluster without online alter support ADD_DEFINITIONS(-DNDB_WITHOUT_ONLINE_ALTER) + # Distributed privilege tables not supported in non + # MySQL Cluster version yet, compile ndbcluster without dist priv + ADD_DEFINITIONS(-DNDB_WITHOUT_DIST_PRIV) + # Pushdown of join queries not supported in non + # MySQL Cluster version yet, compile ndbcluster without it + ADD_DEFINITIONS(-DNDB_WITHOUT_JOIN_PUSHDOWN) ENDIF() # NDB is DEFAULT plugin in MySQL Cluster No bundle (reason: useless for push emails).