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

« back to all changes in this revision

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

  • 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
stop slave;
 
2
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 
3
reset master;
 
4
reset slave;
 
5
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 
6
start slave;
 
7
==== Initialize ====
 
8
[on master]
 
9
CREATE TABLE t1(a INT PRIMARY KEY);
 
10
[on slave]
 
11
==== Test: SQL thread sees 'INSERT' of existing key ====
 
12
---- Prepare slave so that it will get duplicate key error ----
 
13
INSERT INTO t1 VALUES (1);
 
14
---- Insert rows on master ----
 
15
[on master]
 
16
INSERT INTO t1 VALUES (1);
 
17
SELECT * FROM t1;
 
18
a
 
19
1
 
20
[on slave]
 
21
---- Wait until slave stops with an error ----
 
22
Last_SQL_Error = Error 'Duplicate entry '1' for key 'PRIMARY'' on query. Default database: 'test'. Query: 'INSERT INTO t1 VALUES (1)' (expected "duplicate key" error)
 
23
SELECT * FROM t1;
 
24
a
 
25
1
 
26
---- Resolve the conflict on the slave and restart SQL thread ----
 
27
DELETE FROM t1 WHERE a = 1;
 
28
START SLAVE SQL_THREAD;
 
29
---- Sync slave and verify that there is no error ----
 
30
Last_SQL_Error = '' (expected no error)
 
31
SELECT * FROM t1;
 
32
a
 
33
1
 
34
==== Test: SQL thread sees 'DELETE' of non-existing row ====
 
35
---- On master, insert two rows, the second with binlogging off ----
 
36
[on master]
 
37
DELETE FROM t1;
 
38
INSERT INTO t1 VALUES (1);
 
39
[on slave]
 
40
DELETE FROM t1 WHERE a = 1;
 
41
---- On master, remove the row that does not exist on slave ----
 
42
[on master]
 
43
DELETE FROM t1 WHERE a = 1;
 
44
SELECT * FROM t1;
 
45
a
 
46
[on slave]
 
47
---- Sync slave and verify that there is no error ----
 
48
Last_SQL_Error =  (expected no error)
 
49
SELECT * FROM t1;
 
50
a
 
51
==== Clean up ====
 
52
[on master]
 
53
DROP TABLE t1;
 
54
[on slave]