~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

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
connection master;
 
14
--disable_warnings
 
15
DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`;
 
16
CREATE DATABASE `#mysql50#mysqltest-1`;
 
17
--enable_warnings
 
18
sync_slave_with_master;
 
19
 
 
20
connection master;
 
21
let $before_position= query_get_value(SHOW MASTER STATUS, Position, 1);
 
22
 
 
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;
 
27
 
 
28
connection master;
 
29
let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1);
 
30
 
 
31
if (`SELECT '$before_position'='$after_position'`)
 
32
{
 
33
  echo Master position is not changed;
 
34
}
 
35
 
 
36
#Some log events of the mysql_upgrade's will cause errors on slave.
 
37
connection slave;
 
38
STOP SLAVE SQL_THREAD;
 
39
source include/wait_for_slave_sql_to_stop.inc;
 
40
 
 
41
connection master;
 
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
 
44
 
 
45
connection master;
 
46
let $after_file= query_get_value(SHOW MASTER STATUS, File, 1);
 
47
let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1);
 
48
 
 
49
if (!`SELECT '$before_position'='$after_position'`)
 
50
{
 
51
  echo Master position has been changed;
 
52
}
 
53
 
 
54
DROP DATABASE `mysqltest-1`;
 
55
connection slave;
 
56
DROP DATABASE `#mysql50#mysqltest-1`;