mariadb/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test
Sergei Golubchik 386ef08704 MDEV-12233 main.mysql_upgrade_noengine fails in buildbot on ppc64le
verify that tests don't leave mysql_upgrade_info in datadir
2017-03-21 11:37:24 +01:00

62 lines
2.3 KiB
Text

#############################################################################
# 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/have_innodb.inc
--source include/mysql_upgrade_preparation.inc
--source include/master-slave.inc
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
call mtr.add_suppression("table or database name 'mysqltest-1'");
connection master;
--disable_warnings
DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`;
CREATE DATABASE `#mysql50#mysqltest-1`;
--enable_warnings
sync_slave_with_master;
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.
--exec $MYSQL_UPGRADE --skip-verbose --force --user=root > $MYSQLTEST_VARDIR/log/mysql_upgrade.log 2>&1
sync_slave_with_master;
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.
connection slave;
STOP SLAVE SQL_THREAD;
source include/wait_for_slave_sql_to_stop.inc;
connection master;
#With '--force' option, mysql_upgrade always executes all sql statements for upgrading.
--exec $MYSQL_UPGRADE --skip-verbose --write-binlog --force --user=root > $MYSQLTEST_VARDIR/log/mysql_upgrade.log 2>&1
let $datadir= `select @@datadir`;
remove_file $datadir/mysql_upgrade_info;
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 `mysqltest-1`;
connection slave;
DROP DATABASE `#mysql50#mysqltest-1`;
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc