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
15
DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`;
16
CREATE DATABASE `#mysql50#mysqltest-1`;
18
sync_slave_with_master;
21
let $before_position= query_get_value(SHOW MASTER STATUS, Position, 1);
23
#With '--force' option, mysql_upgrade always executes all sql statements for upgrading.
24
#--skip-write-binlog option disables binlog.
25
--exec $MYSQL_UPGRADE --skip-write-binlog --skip-verbose --force --user=root > $MYSQLTEST_VARDIR/log/mysql_upgrade.log 2>&1
26
sync_slave_with_master;
29
let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1);
31
if (`SELECT '$before_position'='$after_position'`)
33
echo Master position is not changed;
36
#Some log events of the mysql_upgrade's will cause errors on slave.
38
STOP SLAVE SQL_THREAD;
39
source include/wait_for_slave_sql_to_stop.inc;
42
#With '--force' option, mysql_upgrade always executes all sql statements for upgrading.
43
--exec $MYSQL_UPGRADE --skip-verbose --force --user=root > $MYSQLTEST_VARDIR/log/mysql_upgrade.log 2>&1
46
let $after_file= query_get_value(SHOW MASTER STATUS, File, 1);
47
let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1);
49
if (!`SELECT '$before_position'='$after_position'`)
51
echo Master position has been changed;
54
DROP DATABASE `mysqltest-1`;
56
DROP DATABASE `#mysql50#mysqltest-1`;