~ubuntu-branches/ubuntu/natty/mysql-5.1/natty-proposed

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 08:30:45 UTC
  • mfrom: (1.4.1)
  • Revision ID: package-import@ubuntu.com-20120222083045-2rd53r4bnyx7qus4
Tags: 5.1.61-0ubuntu0.11.04.1
* SECURITY UPDATE: Update to 5.1.61 to fix multiple security issues
  (LP: #937869)
  - http://www.oracle.com/technetwork/topics/security/cpujan2012-366304.html
  - CVE-2011-2262
  - CVE-2012-0075
  - CVE-2012-0112
  - CVE-2012-0113
  - CVE-2012-0114
  - CVE-2012-0115
  - CVE-2012-0116
  - CVE-2012-0117
  - CVE-2012-0118
  - CVE-2012-0119
  - CVE-2012-0120
  - CVE-2012-0484
  - CVE-2012-0485
  - CVE-2012-0486
  - CVE-2012-0487
  - CVE-2012-0488
  - CVE-2012-0489
  - CVE-2012-0490
  - CVE-2012-0491
  - CVE-2012-0492
  - CVE-2012-0493
  - CVE-2012-0494
  - CVE-2012-0495
  - CVE-2012-0496

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
--source include/master-slave.inc
 
3
--source include/have_debug.inc
 
4
--source include/have_binlog_format_row.inc
 
5
 
 
6
# BUG#11753004: 44360: REPLICATION FAILED 
 
7
 
 
8
## assert that we get an error when checking the
 
9
## identifiers at the slave (instead of a crash or
 
10
## different table being updated)
 
11
 
 
12
--let $t1= t1_11753004
 
13
--let $t2= t2_11753004
 
14
--let $t2_ign= t2_11753004_ign
 
15
 
 
16
## test #1: assert that we get an error raised when multiple
 
17
##          tables in the same RBR statement are mapped with the
 
18
##          same identifier
 
19
 
 
20
--eval CREATE TABLE $t1 (c1 INT)
 
21
--eval CREATE TABLE $t2 (c1 INT)
 
22
--eval INSERT INTO $t1 VALUES (1)
 
23
--eval INSERT INTO $t2 VALUES (2)
 
24
 
 
25
--sync_slave_with_master
 
26
call mtr.add_suppression(".*Found table map event mapping table id 0 which was already mapped but with different settings.*");
 
27
 
 
28
# stop the slave and inject corruption
 
29
--source include/stop_slave.inc
 
30
SET @save_debug= @@global.debug;
 
31
SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
 
32
--source include/start_slave.inc
 
33
--connection master
 
34
# both tables get mapped to 0 (in a way, simulating scenario 
 
35
# originated by BUG#56226)
 
36
--eval UPDATE $t1, $t2 SET $t1.c1=3, $t2.c1=4 WHERE $t1.c1=1 OR $t2.c1=2
 
37
--connection slave
 
38
 
 
39
# wait for error 1593 (ER_SLAVE_FATAL_ERROR)
 
40
--let $slave_sql_errno=1593 
 
41
--source include/wait_for_slave_sql_error.inc
 
42
--source include/stop_slave.inc
 
43
 
 
44
# clean up
 
45
SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
 
46
--source include/start_slave.inc
 
47
--connection master
 
48
--source include/rpl_reset.inc
 
49
--eval DROP TABLE $t1, $t2
 
50
--sync_slave_with_master
 
51
 
 
52
## test #2: assert that ignored tables that may have been mapped
 
53
##          with the same identifier are skipped, thus no error
 
54
##          is raised.
 
55
 
 
56
--connection slave
 
57
--source include/stop_slave.inc
 
58
SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
 
59
--source include/start_slave.inc
 
60
--source include/rpl_reset.inc
 
61
--connection master
 
62
--eval CREATE TABLE $t1 (c1 INT)
 
63
--eval CREATE TABLE $t2_ign (c1 INT)
 
64
--eval INSERT INTO $t1 VALUES (1)
 
65
--eval INSERT INTO $t2_ign VALUES (2)
 
66
--eval UPDATE $t1, $t2_ign SET $t1.c1=3, $t2_ign.c1=4 WHERE $t1.c1=1 OR $t2_ign.c1=2
 
67
 
 
68
# must not raise error as second table is filtered
 
69
--sync_slave_with_master
 
70
 
 
71
 
 
72
## test #3: check that BINLOG statements will also raise an
 
73
##          error if containing table map events mapping different
 
74
##          tables to same table identifier.
 
75
 
 
76
CREATE TABLE t1 (c1 INT);
 
77
CREATE TABLE t2 (c1 INT);
 
78
 
 
79
INSERT INTO t1 VALUES (1);
 
80
INSERT INTO t2 VALUES (1);
 
81
 
 
82
# FD event
 
83
BINLOG '
 
84
SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
 
85
AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8=
 
86
'/*!*/;
 
87
 
 
88
#110708 12:21:44 server id 1  end_log_pos 774   Table_map: `test`.`t1` mapped to number 66
 
89
# at 774
 
90
#110708 12:21:44 server id 1  end_log_pos 815   Table_map: `test`.`t2` mapped to number 67
 
91
# at 815
 
92
#110708 12:21:44 server id 1  end_log_pos 855   Update_rows: table id 66
 
93
# at 855
 
94
#110708 12:21:44 server id 1  end_log_pos 895   Update_rows: table id 67 flags: STMT_END_F
 
95
SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
 
96
--error ER_SLAVE_FATAL_ERROR
 
97
BINLOG '
 
98
SOgWThMBAAAAKQAAAAYDAAAAAEIAAAAAAAEABHRlc3QAAnQxAAEDAAE=
 
99
SOgWThMBAAAAKQAAAC8DAAAAAEMAAAAAAAEABHRlc3QAAnQyAAEDAAE=
 
100
SOgWThgBAAAAKAAAAFcDAAAAAEIAAAAAAAAAAf///gEAAAD+AwAAAA==
 
101
SOgWThgBAAAAKAAAAH8DAAAAAEMAAAAAAAEAAf///gEAAAD+BAAAAA==
 
102
'/*!*/;
 
103
 
 
104
 
 
105
# clean up
 
106
DROP TABLE t1,t2;
 
107
--connection slave
 
108
SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
 
109
--connection master
 
110
--eval DROP TABLE $t1
 
111
--eval DROP TABLE $t2_ign
 
112
--sync_slave_with_master
 
113
SET GLOBAL debug= @save_debug;
 
114
 
 
115
--source include/rpl_end.inc