summaryrefslogtreecommitdiff
path: root/mysql-test/extra/rpl_tests/rpl_record_compare.test
blob: 210aee025d0b04a05e32108e6fc72f5558932e5f (plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

#
# BUG#52868: Wrong handling of NULL value during update, replication out of sync
#
-- echo ## case #1 - last_null_bit_pos==0 in record_compare without X bit

-- source include/rpl_reset.inc
-- connection master

-- eval CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=$engine DEFAULT CHARSET=latin1

INSERT INTO t1 ( c5, c6 ) VALUES ( 1   , 35 );
INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
-- disable_warnings
UPDATE t1 SET c5 = 'a';
-- enable_warnings
-- sync_slave_with_master

-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc

--connection master
DROP TABLE t1;
-- sync_slave_with_master

-- echo ## case #1.1 - last_null_bit_pos==0 in record_compare with X bit
-- echo ##             (1 column less and no varchar)
-- source include/rpl_reset.inc
-- connection master

-- eval CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=$engine DEFAULT CHARSET=latin1

INSERT INTO t1 ( c5, c6 ) VALUES ( 1   , 35 );
INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
-- disable_warnings
UPDATE t1 SET c5 = 'a';
-- enable_warnings
-- sync_slave_with_master

-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc

--connection master
DROP TABLE t1;
-- sync_slave_with_master

-- echo ## case #2 - X bit is wrongly set.

-- source include/rpl_reset.inc
-- connection master

-- eval CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=$engine DEFAULT CHARSET= latin1
INSERT INTO t1(c1) VALUES (10);
INSERT INTO t1(c1) VALUES (NULL);
UPDATE t1 SET c1= 0;
-- sync_slave_with_master

-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc

-- connection master
DROP TABLE t1; 
-- sync_slave_with_master

#
# BUG#11766865: 60091: RBR + NO PK + UPDATE NULL VALUE --> SLAVE BREAK WITH ERROR HA_ERR_END_OF_ 
#

--connection master
--source include/rpl_reset.inc
--connection master

--eval CREATE TABLE t1 (c1 int(11) NOT NULL, c2 int(11) NOT NULL, c3 int(11) DEFAULT '-1') ENGINE=$engine DEFAULT CHARSET=latin1

INSERT INTO t1 VALUES (1,2,NULL);
UPDATE t1 SET c1=1, c2=2, c3=-1 WHERE c1=1 AND c2=2 AND ISNULL(c3);

--sync_slave_with_master

--let $diff_tables=master:test.t1, slave:test.t1
--source include/diff_tables.inc

--connection master
DROP TABLE t1;
--sync_slave_with_master