File: rpl_mysql_upgrade.test

package info (click to toggle)
mysql-5.1 5.1.73-1%2Bdeb6u1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 197,132 kB
  • ctags: 93,377
  • sloc: cpp: 579,952; ansic: 429,462; perl: 49,053; sh: 21,692; pascal: 21,272; yacc: 12,801; makefile: 4,545; xml: 4,114; sql: 3,297; lex: 1,265; asm: 1,023
file content (58 lines) | stat: -rw-r--r-- 2,116 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#############################################################################
# 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/master-slave.inc

# Only run test if "mysql_upgrade" is found
--source include/have_mysql_upgrade.inc

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.
#--skip-write-binlog option disables binlog.
--exec $MYSQL_UPGRADE --skip-write-binlog --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 (`SELECT '$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 --force --user=root > $MYSQLTEST_VARDIR/log/mysql_upgrade.log 2>&1

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 (!`SELECT '$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