From: magnus.blaudd Date: September 23 2011 1:22pm Subject: bzr push into mysql-trunk-cluster branch (magnus.blaudd:3366 to 3368) List-Archive: http://lists.mysql.com/commits/141122 Message-Id: <201109231322.p8NDMlYF017983@acsmt357.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3368 magnus.blaudd@stripped 2011-09-23 [merge] Merge trunk-cluster -> trunk-cluster-merge modified: sql/ha_ndbcluster.cc sql/ha_ndbcluster.h sql/ha_ndbcluster_binlog.cc sql/ha_ndbcluster_glue.h storage/ndb/CMakeLists.txt 3367 magnus.blaudd@stripped 2011-09-23 [merge] Merge trunk-cluster -> trunk-cluster-merge(null merge the null merge) modified: sql/ha_ndbcluster.cc sql/ha_ndbcluster.h sql/ha_ndbcluster_binlog.cc sql/ha_ndbcluster_glue.h storage/ndb/CMakeLists.txt 3366 magnus.blaudd@stripped 2011-09-23 ndb - remove MCP patch for WL#3749 modified: include/my_base.h mysql-test/r/ctype_utf8mb4.result sql/handler.cc sql/handler.h sql/lex.h sql/sql_admin.cc sql/sql_base.cc sql/sql_base.h sql/sql_bitmap.h sql/sql_lex.cc sql/sql_lex.h sql/sql_partition.cc sql/sql_partition.h sql/sql_show.cc sql/sql_table.cc sql/sql_truncate.cc sql/sql_yacc.yy sql/table.cc sql/table.h sql/unireg.cc === modified file 'sql/ha_ndbcluster.cc' --- a/sql/ha_ndbcluster.cc 2011-09-22 14:00:22 +0000 +++ b/sql/ha_ndbcluster.cc 2011-09-23 12:53:33 +0000 @@ -341,7 +341,7 @@ ndbcluster_partition_flags() HA_CAN_PARTITION_UNIQUE | HA_USE_AUTO_PARTITION); } -#ifndef MCP_WL3749 +#ifndef NDB_WITHOUT_ONLINE_ALTER static uint ndbcluster_alter_table_flags(uint flags) { @@ -351,13 +351,6 @@ ndbcluster_alter_table_flags(uint flags) return (HA_PARTITION_FUNCTION_SUPPORTED); } #else -#ifndef NDB_WITHOUT_ONLINE_ALTER -static uint -ndbcluster_alter_partition_flags() -{ - return HA_PARTITION_FUNCTION_SUPPORTED; -} -#else static uint ndbcluster_alter_table_flags(uint flags) { @@ -383,7 +376,6 @@ ndbcluster_alter_table_flags(uint flags) return f; } #endif -#endif #define NDB_AUTO_INCREMENT_RETRIES 100 #define BATCH_FLUSH_SIZE (32768) @@ -1347,8 +1339,8 @@ Thd_ndb::Thd_ndb(THD* thd) : m_pushed_queries_dropped= 0; m_pushed_queries_executed= 0; m_pushed_reads= 0; - bzero(m_transaction_no_hint_count, sizeof(m_transaction_no_hint_count)); - bzero(m_transaction_hint_count, sizeof(m_transaction_hint_count)); + memset(m_transaction_no_hint_count, 0, sizeof(m_transaction_no_hint_count)); + memset(m_transaction_hint_count, 0, sizeof(m_transaction_hint_count)); global_schema_lock_trans= NULL; global_schema_lock_count= 0; global_schema_lock_error= 0; @@ -6195,7 +6187,7 @@ void ha_ndbcluster::unpack_record(uchar production code. */ if (actual_length < field->pack_length()) - bzero(field->ptr + actual_length, + memset(field->ptr + actual_length, 0, field->pack_length() - actual_length); #endif field->move_field_offset(-dst_offset); @@ -6259,7 +6251,7 @@ static void get_default_value(void *def_ memcpy(def_val, src_ptr, actual_length); #ifdef HAVE_purify if (actual_length < field->pack_length()) - bzero(((char*)def_val) + actual_length, + memset(((char*)def_val) + actual_length, 0, field->pack_length() - actual_length); #endif } @@ -7068,7 +7060,7 @@ void ha_ndbcluster::get_dynamic_partitio { DBUG_PRINT("info", ("ha_ndbcluster::get_dynamic_partition_info")); - memset((char*) stat_info, 0, sizeof(PARTITION_STATS)); + memset(stat_info, 0, sizeof(PARTITION_STATS)); int error = 0; THD *thd = table->in_use; @@ -11849,18 +11841,8 @@ static int ndbcluster_init(void *p) h->show_status= ndbcluster_show_status; /* Show status */ h->alter_tablespace= ndbcluster_alter_tablespace; /* Show status */ h->partition_flags= ndbcluster_partition_flags; /* Partition flags */ -#ifndef MCP_WL3749 - h->alter_table_flags= - ndbcluster_alter_table_flags; /* Alter table flags */ -#else -#ifndef NDB_WITHOUT_ONLINE_ALTER - h->alter_partition_flags= - ndbcluster_alter_partition_flags; /* Alter partition flags */ -#else h->alter_table_flags= ndbcluster_alter_table_flags; /* Alter table flags */ -#endif -#endif #if MYSQL_VERSION_ID >= 50501 h->fill_is_table= ndbcluster_fill_is_table; #else @@ -12404,13 +12386,9 @@ ulonglong ha_ndbcluster::table_flags(voi HA_HAS_OWN_BINLOGGING | HA_BINLOG_ROW_CAPABLE | HA_HAS_RECORDS | -#ifndef MCP_WL3749 - HA_ONLINE_ALTER | -#else #ifndef NDB_WITHOUT_ONLINE_ALTER HA_ONLINE_ALTER | #endif -#endif 0; /* @@ -15485,7 +15463,7 @@ ha_ndbcluster::set_up_partition_info(par DBUG_RETURN(0); } -#ifndef MCP_WL3749 +#ifndef NDB_WITHOUT_ONLINE_ALTER static HA_ALTER_FLAGS supported_alter_operations() { === modified file 'sql/ha_ndbcluster.h' --- a/sql/ha_ndbcluster.h 2011-09-07 10:08:09 +0000 +++ b/sql/ha_ndbcluster.h 2011-09-23 12:53:33 +0000 @@ -216,7 +216,7 @@ struct Ndb_local_table_statistics { #include "ndb_thd_ndb.h" struct st_ndb_status { - st_ndb_status() { bzero(this, sizeof(struct st_ndb_status)); } + st_ndb_status() { memset(this, 0, sizeof(struct st_ndb_status)); } long cluster_node_id; const char * connected_host; long connected_port; @@ -448,7 +448,7 @@ static void set_tabname(const char *path qc_engine_callback *engine_callback, ulonglong *engine_data); -#ifndef MCP_WL3749 +#ifndef NDB_WITHOUT_ONLINE_ALTER int check_if_supported_alter(TABLE *altered_table, HA_CREATE_INFO *create_info, Alter_info *alter_info, @@ -562,7 +562,7 @@ private: int ndb_optimize_table(THD* thd, uint delay); -#ifndef MCP_WL3749 +#ifndef NDB_WITHOUT_ONLINE_ALTER int alter_frm(THD *thd, const char *file, NDB_ALTER_DATA *alter_data); #endif === modified file 'sql/ha_ndbcluster_binlog.cc' --- a/sql/ha_ndbcluster_binlog.cc 2011-09-07 10:08:09 +0000 +++ b/sql/ha_ndbcluster_binlog.cc 2011-09-23 12:53:33 +0000 @@ -339,7 +339,13 @@ ndb_binlog_open_shadow_table(THD *thd, N if ((error= open_table_def(thd, shadow_table_share, 0)) || (error= open_table_from_share(thd, shadow_table_share, "", 0, (uint) (OPEN_FRM_FILE_ONLY | DELAYED_OPEN | READ_ALL), - 0, shadow_table, OTM_OPEN))) + 0, shadow_table, +#ifdef NDB_WITHOUT_ONLINE_ALTER + false +#else + OTM_OPEN +#endif + ))) { DBUG_PRINT("error", ("failed to open shadow table, error: %d my_errno: %d", error, my_errno)); @@ -2887,7 +2893,7 @@ ndb_binlog_thread_handle_schema_event_po } { TABLE_LIST table_list; - bzero((char*) &table_list,sizeof(table_list)); + memset(&table_list, 0, sizeof(table_list)); table_list.db= schema->db; table_list.alias= table_list.table_name= schema->name; close_cached_tables(thd, &table_list, FALSE, FALSE, FALSE); @@ -2992,7 +2998,7 @@ ndb_binlog_thread_handle_schema_event_po remote on-line alter table */ TABLE_LIST table_list; - bzero((char*) &table_list,sizeof(table_list)); + memset(&table_list, 0, sizeof(table_list)); table_list.db= (char *)schema->db; table_list.alias= table_list.table_name= (char *)schema->name; close_cached_tables(thd, &table_list, TRUE, FALSE, FALSE); @@ -3504,7 +3510,7 @@ inline void slave_reset_conflict_fn(NDB_ NDB_CONFLICT_FN_SHARE *cfn_share= share->m_cfn_share; if (cfn_share) { - bzero((char*)cfn_share, sizeof(*cfn_share)); + memset(cfn_share, 0, sizeof(*cfn_share)); } } @@ -5828,7 +5834,7 @@ ndb_find_binlog_index_row(ndb_binlog_ind if (row == NULL) { row= (ndb_binlog_index_row*)sql_alloc(sizeof(ndb_binlog_index_row)); - bzero((char*)row, sizeof(ndb_binlog_index_row)); + memset(row, 0, sizeof(ndb_binlog_index_row)); row->next= first; *rows= row; if (found_id) @@ -6895,7 +6901,7 @@ restart_cluster_failure: DBUG_PRINT("info", ("Initializing transaction")); inj->new_trans(thd, &trans); rows= &_row; - bzero((char*)&_row, sizeof(_row)); + memset(&_row, 0, sizeof(_row)); thd->variables.character_set_client= &my_charset_latin1; goto commit_to_binlog; } === modified file 'sql/ha_ndbcluster_glue.h' --- a/sql/ha_ndbcluster_glue.h 2011-09-06 12:43:05 +0000 +++ b/sql/ha_ndbcluster_glue.h 2011-09-23 12:53:33 +0000 @@ -64,9 +64,6 @@ bool close_cached_tables(THD *thd, TABLE return close_cached_tables(thd, tables, wait_for_refresh, LONG_TIMEOUT); } -/* Online alter table not supported */ -#define NDB_WITHOUT_ONLINE_ALTER - /* thd has no version field anymore */ #define NDB_THD_HAS_NO_VERSION @@ -76,15 +73,6 @@ bool close_cached_tables(THD *thd, TABLE /* No mysql_rm_table_part2 anymore in 5.5.8 */ #define NDB_NO_MYSQL_RM_TABLE_PART2 -#ifdef MCP_WL3749 -/* - The enum open_table_mode has been removed in 5.5.7 and 'open_table_from_share' - now takes "bool is_create_table" instead of the enum type. Define OTM_OPEN - to false since it's not a create table -*/ -#define OTM_OPEN false -#endif - #endif extern ulong opt_server_id_mask; @@ -250,15 +238,4 @@ uint partition_info_num_subparts(const p #endif -#if MYSQL_VERSION_ID >= 50603 - -/* - Allow use of bzero although MySQL header files redefine - it to an invalid symbol, will actually fix this by replacing bzero - with memset in sql/ha_ndb* -*/ -#undef bzero -#include -#endif - #endif === modified file 'storage/ndb/CMakeLists.txt' --- a/storage/ndb/CMakeLists.txt 2011-09-23 06:55:37 +0000 +++ b/storage/ndb/CMakeLists.txt 2011-09-23 12:53:33 +0000 @@ -83,6 +83,12 @@ SET(NDBCLUSTER_SOURCES # Inlude directories used when building ha_ndbcluster INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/ndb/include) +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) +ENDIF() + # NDB is DEFAULT plugin in MySQL Cluster SET(is_default_plugin "") IF(MYSQL_CLUSTER_VERSION) @@ -98,10 +104,6 @@ MYSQL_ADD_PLUGIN(ndbcluster ${NDBCLUSTER # IF (NOT DEFINED WITH_NDBCLUSTER) # Not building NDB - IF(MYSQL_CLUSTER_VERSION) - MESSAGE(FATAL_ERROR "This is MySQL Cluster, you can't build it without the NDB engine") - ENDIF() - RETURN() ENDIF() No bundle (reason: useless for push emails).