~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-201203300109

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/r/rpl_row_conflicts.result

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2011-11-08 11:31:13 UTC
  • Revision ID: package-import@ubuntu.com-20111108113113-3ulw01fvi4vn8m25
Tags: upstream-5.5.17
ImportĀ upstreamĀ versionĀ 5.5.17

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
include/master-slave.inc
 
2
[connection master]
 
3
call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: .*");
 
4
[on slave]
 
5
SET @old_slave_exec_mode= @@global.slave_exec_mode;
 
6
######## Run with slave_exec_mode=STRICT ########
 
7
SET @@global.slave_exec_mode = 'STRICT';
 
8
==== Initialize ====
 
9
[on master]
 
10
CREATE TABLE t1(a INT PRIMARY KEY);
 
11
[on slave]
 
12
==== Test: SQL thread sees 'INSERT' of existing key ====
 
13
---- Prepare slave so that it will get duplicate key error ----
 
14
INSERT INTO t1 VALUES (1);
 
15
---- Insert rows on master ----
 
16
[on master]
 
17
INSERT INTO t1 VALUES (1);
 
18
SELECT * FROM t1;
 
19
a
 
20
1
 
21
[on slave]
 
22
---- Wait until slave stops with an error ----
 
23
include/wait_for_slave_sql_error.inc [errno=1062]
 
24
Last_SQL_Error (expected "duplicate key" error)
 
25
Could not execute Write_rows event on table test.t1; Duplicate entry '1' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log master-bin.000001, end_log_pos END_LOG_POS
 
26
call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* Error_code: 1062");
 
27
SELECT * FROM t1;
 
28
a
 
29
1
 
30
---- Resolve the conflict on the slave and restart SQL thread ----
 
31
DELETE FROM t1 WHERE a = 1;
 
32
START SLAVE SQL_THREAD;
 
33
include/wait_for_slave_sql_to_start.inc
 
34
---- Sync slave and verify that there is no error ----
 
35
Last_SQL_Error = '' (expected no error)
 
36
SELECT * FROM t1;
 
37
a
 
38
1
 
39
==== Test: SQL thread sees 'DELETE' of non-existing row ====
 
40
---- On master, insert two rows, the second with binlogging off ----
 
41
[on master]
 
42
DELETE FROM t1;
 
43
INSERT INTO t1 VALUES (1);
 
44
[on slave]
 
45
DELETE FROM t1 WHERE a = 1;
 
46
---- On master, remove the row that does not exist on slave ----
 
47
[on master]
 
48
DELETE FROM t1 WHERE a = 1;
 
49
SELECT * FROM t1;
 
50
a
 
51
[on slave]
 
52
---- Wait until slave stops with an error ----
 
53
call mtr.add_suppression("Slave SQL.*Can.t find record in .t1., Error_code: 1032");
 
54
include/wait_for_slave_sql_error.inc [errno=1032]
 
55
Last_SQL_Error (expected "duplicate key" error)
 
56
Could not execute Delete_rows event on table test.t1; Can't find record in 't1', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log master-bin.000001, end_log_pos END_LOG_POS
 
57
SELECT * FROM t1;
 
58
a
 
59
---- Resolve the conflict on the slave and restart SQL thread ----
 
60
INSERT INTO t1 VALUES (1);
 
61
START SLAVE SQL_THREAD;
 
62
include/wait_for_slave_sql_to_start.inc
 
63
---- Sync slave and verify that there is no error ----
 
64
Last_SQL_Error =  (expected no error)
 
65
SELECT * FROM t1;
 
66
a
 
67
==== Clean up ====
 
68
[on master]
 
69
DROP TABLE t1;
 
70
[on slave]
 
71
include/rpl_reset.inc
 
72
######## Run with slave_exec_mode=IDEMPOTENT ########
 
73
set @@global.slave_exec_mode= 'IDEMPOTENT';
 
74
==== Initialize ====
 
75
[on master]
 
76
CREATE TABLE t1(a INT PRIMARY KEY);
 
77
[on slave]
 
78
==== Test: SQL thread sees 'INSERT' of existing key ====
 
79
---- Prepare slave so that it will get duplicate key error ----
 
80
INSERT INTO t1 VALUES (1);
 
81
---- Insert rows on master ----
 
82
[on master]
 
83
INSERT INTO t1 VALUES (1);
 
84
SELECT * FROM t1;
 
85
a
 
86
1
 
87
[on slave]
 
88
---- Sync slave and verify that there is no error ----
 
89
Last_SQL_Error = '' (expected no error)
 
90
SELECT * FROM t1;
 
91
a
 
92
1
 
93
==== Test: SQL thread sees 'DELETE' of non-existing row ====
 
94
---- On master, insert two rows, the second with binlogging off ----
 
95
[on master]
 
96
DELETE FROM t1;
 
97
INSERT INTO t1 VALUES (1);
 
98
[on slave]
 
99
DELETE FROM t1 WHERE a = 1;
 
100
---- On master, remove the row that does not exist on slave ----
 
101
[on master]
 
102
DELETE FROM t1 WHERE a = 1;
 
103
SELECT * FROM t1;
 
104
a
 
105
[on slave]
 
106
---- Sync slave and verify that there is no error ----
 
107
Last_SQL_Error =  (expected no error)
 
108
SELECT * FROM t1;
 
109
a
 
110
==== Clean up ====
 
111
[on master]
 
112
DROP TABLE t1;
 
113
[on slave]
 
114
SET @@global.slave_exec_mode= @old_slave_exec_mode;
 
115
include/rpl_end.inc