polardbxengine/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test

79 lines
2.7 KiB
Plaintext

#############################################################################
# BUG#43579 mysql_upgrade tries to alter log tables on replicated database
# Master and slave should be upgraded separately. All statements executed by
# mysql_upgrade will not be binlogged. --write-binlog and --skip-write-binlog
# options are added into mysql_upgrade. These options control whether sql
# statements are binlogged or not.
#############################################################################
--source include/not_group_replication_plugin.inc
--source include/master-slave.inc
--source include/no_valgrind_without_big.inc
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
#
# Special handling of the #mysql50# prefix has been removed.
# It is now treated as any other identifier part. I.e. it has to
# be quoted and will remain part of the identifier name.
#
connection master;
--disable_warnings
DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`;
CREATE DATABASE `#mysql50#mysqltest-1`;
--enable_warnings
--source include/sync_slave_sql_with_master.inc
# Stop slave io thread before restarting master
--source include/stop_slave_io.inc
connection master;
let $before_position= query_get_value(SHOW MASTER STATUS, Position, 1);
#With '--force' option, mysql_upgrade always executes all sql statements for upgrading.
#binlog is disabled by default.
--let $rpl_server_parameters= --upgrade=FORCE
--let $rpl_server_number= 1
--let $wait_counter= 10000
--source include/rpl_restart_server.inc
# Restart slave io thread after restarting master server
connection slave;
--source include/start_slave_io.inc
connection master;
let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1);
if ($before_position == $after_position)
{
echo Master position is not changed;
}
# Some log events of the mysql_upgrade's will cause errors on slave.
# And Stop slave io thread before restarting master
connection slave;
--source include/stop_slave.inc
connection master;
#With '--force' option, mysql_upgrade always executes all sql statements for upgrading.
#--write-binlog option enables binlog.
--let $rpl_server_parameters= --upgrade=FORCE
--let $rpl_server_number= 1
--let $wait_counter= 10000
--source include/rpl_restart_server.inc
connection master;
let $after_file= query_get_value(SHOW MASTER STATUS, File, 1);
let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1);
if ($before_position != $after_position)
{
echo Master position has been changed;
}
DROP DATABASE `#mysql50#mysqltest-1`;
connection slave;
DROP DATABASE `#mysql50#mysqltest-1`;
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc