~mathiaz/ubuntu/lucid/mysql-dfsg-5.1/zap-bug-552053

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-06-25 12:55:45 UTC
  • mfrom: (1.1.2 upstream) (0.1.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20090625125545-m8ogs96zzsri74xe
Tags: 5.1.34-1ubuntu1
* Merge from debian experimental (and 5.0 from main), remaining changes:
  - debian/mysql-server-5.1.config:
    + ask for MySQL root password at priority high instead of medium so
      that the password prompt is seen on a default install. (LP: #319843)
    + don't ask for root password when upgrading from a 5.0 install.
  - debian/control:
    + Make libmysqlclient16-dev a transitional package depending on
      libmysqlclient-dev.
    + Make libmysqlclient-dev conflict with libmysqlclient15-dev.
    + Don't build mysql-server, mysql-client, mysql-common and
      libmysqlclient15-dev binary packages since they're still provided
      by mysql-dfsg-5.0.
    + Make mysql-{client,server}-5.1 packages conflict and
      replace mysql-{client,server}-5.0, but not provide
      mysql-{client,server}.
    + Depend on a specific version of mysql-common rather than the src
      version of mysql-dfsg-5.1 since mysql-common is currently part of
      mysql-dfsg-5.0.
    + Lower mailx from a Recommends to a Suggests to avoid pulling in
      a full MTA on all installs of mysql-server. (LP: #259477)
  - debian/rules:
    + added -fno-strict-aliasing to CFLAGS to get around mysql testsuite
      build failures.
    + install mysql-test and sql-bench to /usr/share/mysql/ rather than
      /usr/.
  - debian/additions/debian-start.inc.sh: support ANSI mode (LP: #310211)
  - Add AppArmor profile:
    - debian/apparmor-profile: apparmor profile.
    - debian/rules, debian/mysql-server-5.0.files: install apparmor profile.
    - debian/mysql-server-5.0.dirs: add etc/apparmor.d/force-complain
    - debian/mysql-server-5.0.postrm: remove symlink in force-complain/ on
      purge.
    - debian/mysql-server-5.1.README.Debian: add apparmor documentation.
    - debian/additions/my.cnf: Add warning about apparmor. (LP: #201799)
    - debian/mysql-server-5.1.postinst: reload apparmor profiles.
  - debian/additions/my.cnf: remove language option. Error message files are
    located in a different directory in MySQL 5.0. Setting the language
    option to use /usr/share/mysql/english breaks 5.0. Both 5.0 and 5.1
    use a default value that works. (LP: #316974)
  - debian/mysql-server-5.1.mysql.init:
    + Clearly indicate that we do not support running multiple instances
      of mysqld by duplicating the init script.
      (closes: #314785, #324834, #435165, #444216)
    + Properly parameterize all existing references to the mysql config
      file (/etc/mysql/my.cnf).
  - debian/mysql-server-5.0.postinst: Clear out the second password
    when setting up mysql. (LP: #344816)
  - mysql-server-core-5.1 package for files needed by Akonadi:
    + debian/control: create mysql-server-core-5.1 package.
    + debian/mysql-server-core-5.1.files, debian/mysql-server-5.1.files:
      move core mysqld files to mysql-server-core-5.1 package.
  - Don't package sql-bench and mysql-test file.
* Dropped changes:
  - debian/patches/92_ssl_test_cert.dpatch: certificate expiration in
    test suite (LP: #323755). Included upstream.
* Dropped from 5.0:
  - apparmor profile:
    - debian/control: Recommends apparmor >= 2.1+1075-0ubuntu6. All version
      of apparmor-profile (>hardy) are higher than this version.
    - debian/mysql-server-5.0.preinst: create symlink for force-complain/
      on pre-feisty upgrades, upgrades where apparmor-profiles profile is
      unchanged (ie non-enforcing) and upgrades where the profile
      doesn't exist. Support for pre-hardy upgrades is no longer needed.
* debian/mysql-server-5.1.postinst: fix debian-sys-maint user creation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
-- source include/have_binlog_format_row.inc
3
3
-- source include/master-slave.inc
4
4
 
5
 
# Test is dependent on binlog positions
 
5
# Note: The test is dependent on binlog positions
6
6
 
7
7
# prepare version for substitutions
8
8
let $VERSION=`select version()`;
9
9
 
10
 
# stop slave before he will start replication also sync with master
11
 
# for avoiding undetermenistic behaviour
12
 
save_master_pos;
13
 
connection slave;
14
 
sync_with_master;
15
 
stop slave;
16
 
# Make sure the slave sql and io thread has stopped
17
 
--source include/wait_for_slave_to_stop.inc
18
 
 
19
 
connection master;
20
 
# create some events on master
21
 
create table t1(n int not null auto_increment primary key);
22
 
insert into t1 values (1),(2),(3),(4);
23
 
drop table t1;
24
 
create table t2(n int not null auto_increment primary key);
25
 
insert into t2 values (1),(2);
26
 
insert into t2 values (3),(4);
27
 
drop table t2;
28
 
 
29
 
# try to replicate all queries until drop of t1
30
 
connection slave;
31
 
start slave until master_log_file='master-bin.000001', master_log_pos=311;
 
10
# Create some events on master
 
11
connection master;
 
12
CREATE TABLE t1(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
 
13
INSERT INTO t1 VALUES (1),(2),(3),(4);
 
14
DROP TABLE t1;
 
15
# Save master log postion for query DROP TABLE t1
 
16
save_master_pos;
 
17
let $master_pos_drop_t1= query_get_value(SHOW BINLOG EVENTS, Pos, 7);
 
18
 
 
19
CREATE TABLE t2(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
 
20
# Save master log postion for query CREATE TABLE t2
 
21
save_master_pos;
 
22
let $master_pos_create_t2= query_get_value(SHOW BINLOG EVENTS, Pos, 8);
 
23
 
 
24
INSERT INTO t2 VALUES (1),(2);
 
25
save_master_pos;
 
26
# Save master log postion for query INSERT INTO t2 VALUES (1),(2);
 
27
let $master_pos_insert1_t2= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 12);
 
28
sync_slave_with_master;
 
29
 
 
30
# Save relay log postion for query INSERT INTO t2 VALUES (1),(2);
 
31
let $relay_pos_insert1_t2= query_get_value(show slave status, Relay_Log_Pos, 1);
 
32
 
 
33
connection master;
 
34
INSERT INTO t2 VALUES (3),(4);
 
35
DROP TABLE t2;
 
36
# Save master log postion for query INSERT INTO t2 VALUES (1),(2);
 
37
let $master_pos_drop_t2= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 17);
 
38
sync_slave_with_master;
 
39
 
 
40
--source include/stop_slave.inc
 
41
# Reset slave.
 
42
RESET SLAVE;
 
43
--disable_query_log
 
44
eval CHANGE MASTER TO MASTER_USER='root', MASTER_CONNECT_RETRY=1, MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT;
 
45
--enable_query_log
 
46
 
 
47
# Try to replicate all queries until drop of t1
 
48
connection slave;
 
49
echo START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_drop_t1;
 
50
--disable_query_log
 
51
eval START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=$master_pos_drop_t1;
 
52
--enable_query_log
32
53
--source include/wait_for_slave_sql_to_stop.inc
33
 
# here table should be still not deleted
34
 
select * from t1;
35
 
source include/show_slave_status.inc;
36
 
 
37
 
# this should fail right after start
38
 
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
 
54
 
 
55
# Here table should be still not deleted
 
56
SELECT * FROM t1;
 
57
--replace_result $master_pos_drop_t1 MASTER_POS_DROP_T1
 
58
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
 
59
query_vertical SHOW SLAVE STATUS;
 
60
 
 
61
# This should fail right after start
 
62
START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=291;
39
63
--source include/wait_for_slave_sql_to_stop.inc
40
64
# again this table should be still not deleted
41
 
select * from t1;
42
 
source include/show_slave_status.inc;
 
65
SELECT * FROM t1;
 
66
--replace_result $master_pos_drop_t1 MASTER_POS_DROP_T1
 
67
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
 
68
query_vertical SHOW SLAVE STATUS;
43
69
 
44
 
# try replicate all up to and not including the second insert to t2;
45
 
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=1014;
 
70
# Try replicate all up to and not including the second insert to t2;
 
71
echo START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=relay_pos_insert1_t2;
 
72
--disable_query_log
 
73
eval START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=$relay_pos_insert1_t2;
 
74
--enable_query_log
46
75
--source include/wait_for_slave_sql_to_stop.inc
47
 
select * from t2;
48
 
source include/show_slave_status.inc;
 
76
SELECT * FROM t2;
 
77
--replace_result $relay_pos_insert1_t2 RELAY_POS_INSERT1_T2 $master_pos_insert1_t2 MASTER_POS_INSERT1_T2
 
78
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
 
79
query_vertical SHOW SLAVE STATUS;
49
80
 
50
81
# clean up
51
 
start slave;
 
82
START SLAVE;
 
83
--source include/wait_for_slave_to_start.inc
52
84
connection master;
53
 
save_master_pos;
54
 
connection slave;
55
 
sync_with_master;
56
 
stop slave;
57
 
# Make sure the slave sql and io thread has stopped
58
 
--source include/wait_for_slave_to_stop.inc
 
85
sync_slave_with_master;
 
86
--source include/stop_slave.inc
59
87
 
60
 
# this should stop immediately as we are already there
61
 
start slave until master_log_file='master-bin.000001', master_log_pos=740;
 
88
# This should stop immediately as we are already there
 
89
echo START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2;
 
90
--disable_query_log
 
91
eval START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=$master_pos_create_t2;
 
92
--enable_query_log
 
93
let $slave_param= Until_Log_Pos;
 
94
let $slave_param_value= $master_pos_create_t2;
 
95
--source include/wait_for_slave_param.inc
62
96
--source include/wait_for_slave_sql_to_stop.inc
63
97
# here the sql slave thread should be stopped
64
98
--replace_result bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
65
 
source include/show_slave_status.inc;
 
99
--replace_result $master_pos_create_t2 MASTER_POS_CREATE_T2 $master_pos_drop_t2 MASTER_POS_DROP_T2
 
100
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
 
101
query_vertical SHOW SLAVE STATUS;
66
102
 
67
103
#testing various error conditions
68
104
--error 1277
69
 
start slave until master_log_file='master-bin', master_log_pos=561;
70
 
--error 1277
71
 
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
72
 
--error 1277
73
 
start slave until master_log_file='master-bin.000001';
74
 
--error 1277
75
 
start slave until relay_log_file='slave-relay-bin.000002';
76
 
--error 1277
77
 
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
 
105
START SLAVE UNTIL MASTER_LOG_FILE='master-bin', MASTER_LOG_POS=561;
 
106
--error 1277
 
107
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=561, RELAY_LOG_POS=12;
 
108
--error 1277
 
109
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001';
 
110
--error 1277
 
111
START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000009';
 
112
--error 1277
 
113
START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=561;
78
114
# Warning should be given for second command
79
 
start slave sql_thread;
80
 
start slave until master_log_file='master-bin.000001', master_log_pos=740;
 
115
START SLAVE;
 
116
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=740;