~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_mysql_upgrade.test

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
9
 
 
10
# Only run test if "mysql_upgrade" is found
 
11
--source include/have_mysql_upgrade.inc
 
12
 
 
13
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
 
14
 
 
15
connection master;
 
16
--disable_warnings
 
17
DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`;
 
18
CREATE DATABASE `#mysql50#mysqltest-1`;
 
19
--enable_warnings
 
20
sync_slave_with_master;
 
21
 
 
22
connection master;
 
23
let $before_position= query_get_value(SHOW MASTER STATUS, Position, 1);
 
24
 
 
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;
 
29
 
 
30
connection master;
 
31
let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1);
 
32
 
 
33
if ($before_position == $after_position)
 
34
{
 
35
  echo Master position is not changed;
 
36
}
 
37
 
 
38
#Some log events of the mysql_upgrade's will cause errors on slave.
 
39
connection slave;
 
40
STOP SLAVE SQL_THREAD;
 
41
source include/wait_for_slave_sql_to_stop.inc;
 
42
 
 
43
connection master;
 
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
 
47
 
 
48
connection master;
 
49
let $after_file= query_get_value(SHOW MASTER STATUS, File, 1);
 
50
let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1);
 
51
 
 
52
if ($before_position != $after_position)
 
53
{
 
54
  echo Master position has been changed;
 
55
}
 
56
 
 
57
DROP DATABASE `mysqltest-1`;
 
58
connection slave;
 
59
DROP DATABASE `#mysql50#mysqltest-1`;
 
60
--let $rpl_only_running_threads= 1
 
61
--source include/rpl_end.inc