Debian Codegraph @

mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test

raw
1 #
2 # BUG
3 # ---
4 # BUG#39753: Replication failure on MIXED + bit + myisam + no PK
5 #
6 # Description
7 # -----------
8 # Simple statements against a bit column cause failure in mixed-mode
9 # replication.
10 #
11 # Implementation is as follows:
12 # i) A table with two bit fields is created. One of them is a key.
13 # ii) A record is inserted without specifying the key value.
14 # iii) The record is deleted using a where clause that matches it.
15 # iv) repeat i-iii) for bit key that has different size, generating
16 # different extra bits values
17 # v) The slave is synchronized with master
18 # vi) The table is dropped on master and the slave is re-synchronized
19 # with master.
20 #
21 # Step v) made the bug evident before the patch, as the slave would
22 # fail to find the correspondent row in its database (although it did
23 # the insert in step ii) ).
24 #
25 # Obs
26 # ---
27 # This test is based on the "how to repeat" section from the bug report.
28 #
29 #
30
31 --source include/master-slave.inc
32
33 disable_query_log;
34 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
35 enable_query_log;
36
37 --disable_warnings
38 # setup
39
40 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
41 CREATE TABLE t1 (`bit_key` bit, `bit` bit, key (`bit_key` )) ENGINE=MyISAM;
42 CREATE TABLE t2 (`bit_key` bit(4), `bit` bit, key (`bit_key` )) ENGINE=MyISAM;
43 CREATE TABLE t3 (`bit_key` bit(7), `bit` bit, key (`bit_key` )) ENGINE=MyISAM;
44 CREATE TABLE t4 (`bit_key` bit(8), `bit` bit, key (`bit_key` )) ENGINE=MyISAM;
45 CREATE TABLE t5 (`bit_key` bit(9), `bit` bit, key (`bit_key` )) ENGINE=MyISAM;
46 CREATE TABLE t6 (`bit_key` bit(14), `bit` bit, key (`bit_key` )) ENGINE=MyISAM;
47 CREATE TABLE t7 (`bit_key` bit(15), `bit` bit, key (`bit_key` )) ENGINE=MyISAM;
48 CREATE TABLE t8 (`bit_key` bit(16), `bit` bit, key (`bit_key` )) ENGINE=MyISAM;
49
50 # insert and delete
51 INSERT INTO `t1` ( `bit` ) VALUES ( 0 );
52 DELETE FROM `t1` WHERE `bit` < 2 LIMIT 4;
53
54 INSERT INTO `t2` ( `bit` ) VALUES ( 0 );
55 DELETE FROM `t2` WHERE `bit` < 2 LIMIT 4;
56
57 INSERT INTO `t3` ( `bit` ) VALUES ( 0 );
58 DELETE FROM `t3` WHERE `bit` < 2 LIMIT 4;
59
60 INSERT INTO `t4` ( `bit` ) VALUES ( 0 );
61 DELETE FROM `t4` WHERE `bit` < 2 LIMIT 4;
62
63 INSERT INTO `t5` ( `bit` ) VALUES ( 0 );
64 DELETE FROM `t5` WHERE `bit` < 2 LIMIT 4;
65
66 INSERT INTO `t6` ( `bit` ) VALUES ( 0 );
67 DELETE FROM `t6` WHERE `bit` < 2 LIMIT 4;
68
69 INSERT INTO `t7` ( `bit` ) VALUES ( 0 );
70 DELETE FROM `t7` WHERE `bit` < 2 LIMIT 4;
71
72 INSERT INTO `t8` ( `bit` ) VALUES ( 0 );
73 DELETE FROM `t8` WHERE `bit` < 2 LIMIT 4;
74
75
76 --enable_warnings
77 sync_slave_with_master;
78
79 # clean up
80 connection master;
81 DROP TABLE t1, t2, t3, t4, t5, t6, t7, t8;
82 sync_slave_with_master;
83 --source include/rpl_end.inc