1
#############################################################################
2
# BUG#43579 mysql_upgrade tries to alter log tables on replicated database
3
# Master and slave should be upgraded separately. All statements executed by
4
# mysql_upgrade will not be binlogged. --write-binlog and --skip-write-binlog
5
# options are added into mysql_upgrade. These options control whether sql
6
# statements are binlogged or not.
7
#############################################################################
8
--source include/master-slave.inc
10
# Only run test if "mysql_upgrade" is found
11
--source include/have_mysql_upgrade.inc
13
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
17
DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`;
18
CREATE DATABASE `#mysql50#mysqltest-1`;
20
sync_slave_with_master;
23
let $before_position= query_get_value(SHOW MASTER STATUS, Position, 1);
25
#With '--force' option, mysql_upgrade always executes all sql statements for upgrading.
26
#binlog is disabled by default.
27
--exec $MYSQL_UPGRADE --skip-verbose --force --user=root > $MYSQLTEST_VARDIR/log/mysql_upgrade.log 2>&1
28
sync_slave_with_master;
31
let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1);
33
if ($before_position == $after_position)
35
echo Master position is not changed;
38
#Some log events of the mysql_upgrade's will cause errors on slave.
40
STOP SLAVE SQL_THREAD;
41
source include/wait_for_slave_sql_to_stop.inc;
44
#With '--force' option, mysql_upgrade always executes all sql statements for upgrading.
45
#--write-binlog option enables binlog.
46
--exec $MYSQL_UPGRADE --write-binlog --skip-verbose --force --user=root > $MYSQLTEST_VARDIR/log/mysql_upgrade.log 2>&1
49
let $after_file= query_get_value(SHOW MASTER STATUS, File, 1);
50
let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1);
52
if ($before_position != $after_position)
54
echo Master position has been changed;
57
DROP DATABASE `mysqltest-1`;
59
DROP DATABASE `#mysql50#mysqltest-1`;
60
--let $rpl_only_running_threads= 1
61
--source include/rpl_end.inc