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/not_group_replication_plugin.inc
32 --source include/force_myisam_default.inc
33 --source include/have_myisam.inc
34 --source include/master-slave.inc
35
36 disable_query_log;
37 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
38 enable_query_log;
39
40 --disable_warnings
41 # setup
42
43 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
44 CREATE TABLE t1 (`bit_key` bit, `bit` bit, key (`bit_key` )) ENGINE=MyISAM;
45 CREATE TABLE t2 (`bit_key` bit(4), `bit` bit, key (`bit_key` )) ENGINE=MyISAM;
46 CREATE TABLE t3 (`bit_key` bit(7), `bit` bit, key (`bit_key` )) ENGINE=MyISAM;
47 CREATE TABLE t4 (`bit_key` bit(8), `bit` bit, key (`bit_key` )) ENGINE=MyISAM;
48 CREATE TABLE t5 (`bit_key` bit(9), `bit` bit, key (`bit_key` )) ENGINE=MyISAM;
49 CREATE TABLE t6 (`bit_key` bit(14), `bit` bit, key (`bit_key` )) ENGINE=MyISAM;
50 CREATE TABLE t7 (`bit_key` bit(15), `bit` bit, key (`bit_key` )) ENGINE=MyISAM;
51 CREATE TABLE t8 (`bit_key` bit(16), `bit` bit, key (`bit_key` )) ENGINE=MyISAM;
52
53 # insert and delete
54 INSERT INTO `t1` ( `bit` ) VALUES ( 0 );
55 DELETE FROM `t1` WHERE `bit` < 2 LIMIT 4;
56
57 INSERT INTO `t2` ( `bit` ) VALUES ( 0 );
58 DELETE FROM `t2` WHERE `bit` < 2 LIMIT 4;
59
60 INSERT INTO `t3` ( `bit` ) VALUES ( 0 );
61 DELETE FROM `t3` WHERE `bit` < 2 LIMIT 4;
62
63 INSERT INTO `t4` ( `bit` ) VALUES ( 0 );
64 DELETE FROM `t4` WHERE `bit` < 2 LIMIT 4;
65
66 INSERT INTO `t5` ( `bit` ) VALUES ( 0 );
67 DELETE FROM `t5` WHERE `bit` < 2 LIMIT 4;
68
69 INSERT INTO `t6` ( `bit` ) VALUES ( 0 );
70 DELETE FROM `t6` WHERE `bit` < 2 LIMIT 4;
71
72 INSERT INTO `t7` ( `bit` ) VALUES ( 0 );
73 DELETE FROM `t7` WHERE `bit` < 2 LIMIT 4;
74
75 INSERT INTO `t8` ( `bit` ) VALUES ( 0 );
76 DELETE FROM `t8` WHERE `bit` < 2 LIMIT 4;
77
78
79 --enable_warnings
80 --source include/sync_slave_sql_with_master.inc
81
82 # clean up
83 connection master;
84 DROP TABLE t1, t2, t3, t4, t5, t6, t7, t8;
85 --source include/sync_slave_sql_with_master.inc
86 --source include/rpl_end.inc