From: magnus.blaudd Date: November 18 2011 10:54am Subject: bzr push into mysql-trunk-cluster branch (magnus.blaudd:3419 to 3420) WL#5881 List-Archive: http://lists.mysql.com/commits/142054 Message-Id: <201111181054.pAIAsQrK007978@acsmt356.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3420 magnus.blaudd@stripped 2011-11-18 WL#5881 - Revert impl. of slave_allow_batching to default behaviour, allowing it to be changed although slave sql thread is running - Prefix variable with opt_ - Update test cases - Move opt_slave_allow_batching together with the other slave_ variables modified: mysql-test/suite/rpl/r/rpl_row_basic_allow_batching.result mysql-test/suite/rpl/t/rpl_row_basic_allow_batching.test sql/log_event.cc sql/mysqld.cc sql/mysqld.h sql/sys_vars.cc 3419 magnus.blaudd@stripped 2011-11-16 WL#5881 - cherrypick fix to silence the most annoying warnings in ndbapi modified: storage/ndb/include/ndbapi/NdbScanOperation.hpp storage/ndb/src/ndbapi/NdbScanOperation.cpp === modified file 'mysql-test/suite/rpl/r/rpl_row_basic_allow_batching.result' --- a/mysql-test/suite/rpl/r/rpl_row_basic_allow_batching.result 2011-11-16 13:34:08 +0000 +++ b/mysql-test/suite/rpl/r/rpl_row_basic_allow_batching.result 2011-11-18 10:45:23 +0000 @@ -3,22 +3,10 @@ include/master-slave.inc show variables like 'slave_allow_batching'; Variable_name Value slave_allow_batching OFF -Show that slave_allow_batching cannot be changed while slave is running -set global slave_allow_batching=ON; -ERROR HY000: This operation cannot be performed with a running slave; run STOP SLAVE first -show warnings; -Level Code Message -Error 1198 This operation cannot be performed with a running slave; run STOP SLAVE first -show variables like 'slave_allow_batching'; -Variable_name Value -slave_allow_batching OFF -Now stop slave and change it -stop slave; set global slave_allow_batching=ON; show variables like 'slave_allow_batching'; Variable_name Value slave_allow_batching ON -start slave; Now the normal test CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'INNODB' ; SELECT * FROM t1; === modified file 'mysql-test/suite/rpl/t/rpl_row_basic_allow_batching.test' --- a/mysql-test/suite/rpl/t/rpl_row_basic_allow_batching.test 2011-11-15 14:30:51 +0000 +++ b/mysql-test/suite/rpl/t/rpl_row_basic_allow_batching.test 2011-11-18 10:45:23 +0000 @@ -4,18 +4,9 @@ --connection slave show variables like 'slave_allow_batching'; ---echo Show that slave_allow_batching cannot be changed while slave is running ---error ER_SLAVE_MUST_STOP set global slave_allow_batching=ON; -show warnings; show variables like 'slave_allow_batching'; ---echo Now stop slave and change it -stop slave; -set global slave_allow_batching=ON; -show variables like 'slave_allow_batching'; -start slave; - --echo Now the normal test --connection master === modified file 'sql/log_event.cc' --- a/sql/log_event.cc 2011-11-15 14:34:44 +0000 +++ b/sql/log_event.cc 2011-11-18 10:45:23 +0000 @@ -8722,7 +8722,7 @@ int Rows_log_event::do_apply_event(Relay Note that unlike the other thd options set here, this one comes from a global, and not from the incoming event. */ - if (slave_allow_batching) + if (opt_slave_allow_batching) thd->variables.option_bits|= OPTION_ALLOW_BATCH; else thd->variables.option_bits&= ~OPTION_ALLOW_BATCH; === modified file 'sql/mysqld.cc' --- a/sql/mysqld.cc 2011-11-15 13:42:05 +0000 +++ b/sql/mysqld.cc 2011-11-18 10:45:23 +0000 @@ -397,6 +397,7 @@ my_bool opt_safe_user_create = 0; my_bool opt_show_slave_auth_info; my_bool opt_log_slave_updates= 0; char *opt_slave_skip_errors; +my_bool opt_slave_allow_batching= 0; /** compatibility option: === modified file 'sql/mysqld.h' --- a/sql/mysqld.h 2011-11-15 13:42:05 +0000 +++ b/sql/mysqld.h 2011-11-18 10:45:23 +0000 @@ -179,7 +179,7 @@ extern ulong slow_launch_threads, slow_l extern ulong table_cache_size, table_def_size; extern MYSQL_PLUGIN_IMPORT ulong max_connections; extern ulong max_connect_errors, connect_timeout; -extern my_bool slave_allow_batching; +extern my_bool opt_slave_allow_batching; extern my_bool allow_slave_start; extern LEX_CSTRING reason_slave_blocked; extern ulong slave_trans_retries; === modified file 'sql/sys_vars.cc' --- a/sql/sys_vars.cc 2011-11-15 15:02:56 +0000 +++ b/sql/sys_vars.cc 2011-11-18 10:45:23 +0000 @@ -2809,38 +2809,6 @@ static Sys_var_ulong Sys_profiling_histo VALID_RANGE(0, 100), DEFAULT(15), BLOCK_SIZE(1)); #endif -#ifndef EMBEDDED_LIBRARY -my_bool slave_allow_batching; - -/* - Take Active MI lock while checking/updating slave_allow_batching - to give atomicity w.r.t. slave state changes -*/ -static PolyLock_mutex PLock_active_mi(&LOCK_active_mi); - -static bool slave_allow_batching_check(sys_var *self, THD *thd, set_var *var) -{ - /* Only allow a change if the slave SQL thread is currently stopped */ - bool slave_sql_running = active_mi->rli->slave_running; - - if (slave_sql_running) - { - my_error(ER_SLAVE_MUST_STOP, MYF(0)); - return true; - } - - return false; -} - -static Sys_var_mybool Sys_slave_allow_batching( - "slave_allow_batching", "Allow slave to batch requests", - GLOBAL_VAR(slave_allow_batching), - CMD_LINE(OPT_ARG), DEFAULT(FALSE), - &PLock_active_mi, - NOT_IN_BINLOG, - ON_CHECK(slave_allow_batching_check)); -#endif - static Sys_var_harows Sys_select_limit( "sql_select_limit", "The maximum number of rows to return from SELECT statements", @@ -3372,6 +3340,11 @@ static Sys_var_mybool Sys_relay_log_reco "processed", GLOBAL_VAR(relay_log_recovery), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); +static Sys_var_mybool Sys_slave_allow_batching( + "slave_allow_batching", "Allow slave to batch requests", + GLOBAL_VAR(opt_slave_allow_batching), + CMD_LINE(OPT_ARG), DEFAULT(FALSE)); + static Sys_var_charptr Sys_slave_load_tmpdir( "slave_load_tmpdir", "The location where the slave should put " "its temporary files when replicating a LOAD DATA INFILE command", No bundle (reason: useless for push emails).