1 2# 3# BUG#52868: Wrong handling of NULL value during update, replication out of sync 4# 5-- echo ## case #1 - last_null_bit_pos==0 in record_compare without X bit 6 7-- source include/rpl_reset.inc 8-- connection master 9 10-- 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 11 12INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 ); 13INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 ); 14-- disable_warnings 15UPDATE IGNORE t1 SET c5 = 'a'; 16-- enable_warnings 17-- sync_slave_with_master 18 19-- let $diff_tables= master:t1, slave:t1 20-- source include/diff_tables.inc 21 22--connection master 23DROP TABLE t1; 24-- sync_slave_with_master 25 26-- echo ## case #1.1 - last_null_bit_pos==0 in record_compare with X bit 27-- echo ## (1 column less and no varchar) 28-- source include/rpl_reset.inc 29-- connection master 30 31-- 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 32 33INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 ); 34INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 ); 35-- disable_warnings 36UPDATE IGNORE t1 SET c5 = 'a'; 37-- enable_warnings 38-- sync_slave_with_master 39 40-- let $diff_tables= master:t1, slave:t1 41-- source include/diff_tables.inc 42 43--connection master 44DROP TABLE t1; 45-- sync_slave_with_master 46 47-- echo ## case #2 - X bit is wrongly set. 48 49-- source include/rpl_reset.inc 50-- connection master 51 52-- eval CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=$engine DEFAULT CHARSET= latin1 53INSERT INTO t1(c1) VALUES (10); 54INSERT INTO t1(c1) VALUES (NULL); 55UPDATE t1 SET c1= 0; 56-- sync_slave_with_master 57 58-- let $diff_tables= master:t1, slave:t1 59-- source include/diff_tables.inc 60 61-- connection master 62DROP TABLE t1; 63-- sync_slave_with_master 64 65