|
| 1 | +# Both of the following tests check that comparison of binlog BI |
| 2 | +# against SE record will not fail due to remains from previous values |
| 3 | +# in the SE record (before a given field was set to null). |
| 4 | +# |
| 5 | +# In MIXED mode: |
| 6 | +# - Insert and update are executed as statements |
| 7 | +# - Delete is executed as a row event |
| 8 | +# - Assertion: checks that comparison will not fail because the update |
| 9 | +# statement will clear the record contents for the nulled |
| 10 | +# field. If data was not cleared, some engines may keep |
| 11 | +# the value and return it later as garbage - despite the |
| 12 | +# fact that field is null. This may cause slave to |
| 13 | +# falsely fail in the comparison (memcmp would fail |
| 14 | +# because of "garbage" in record data). |
| 15 | +# |
| 16 | +# In ROW mode: |
| 17 | +# - Insert, update and delete are executed as row events. |
| 18 | +# - Assertion: checks that comparison will not fail because the update |
| 19 | +# rows event will clear the record contents before |
| 20 | +# feeding the new value to the SE. This protects against |
| 21 | +# SEs that do not clear record contents when storing |
| 22 | +# nulled fields. If the engine did not clear the data it |
| 23 | +# would cause slave to falsely fail in the comparison |
| 24 | +# (memcmp would fail because of "garbage" in record |
| 25 | +# data). This scenario is pretty much the same described |
| 26 | +# above in MIXED mode, but checks different execution |
| 27 | +# path in the slave. |
| 28 | + |
| 29 | +# BUG#49481: RBR: MyISAM and bit fields may cause slave to stop on |
| 30 | +# delete cant find record |
| 31 | + |
| 32 | +-- source include/master-slave-reset.inc |
| 33 | + |
| 34 | +-- connection master |
| 35 | +-- eval CREATE TABLE t1 (c1 BIT, c2 INT) Engine=$engine |
| 36 | +INSERT INTO `t1` VALUES ( 1, 1 ); |
| 37 | +UPDATE t1 SET c1=NULL where c2=1; |
| 38 | +-- sync_slave_with_master |
| 39 | + |
| 40 | +-- let $diff_table_1=master:test.t1 |
| 41 | +-- let $diff_table_2=slave:test.t1 |
| 42 | +-- source include/diff_tables.inc |
| 43 | + |
| 44 | +-- connection master |
| 45 | +# triggers switch to row mode when on mixed |
| 46 | +DELETE FROM t1 WHERE c2=1 LIMIT 1; |
| 47 | +-- sync_slave_with_master |
| 48 | + |
| 49 | +-- let $diff_table_1=master:test.t1 |
| 50 | +-- let $diff_table_2=slave:test.t1 |
| 51 | +-- source include/diff_tables.inc |
| 52 | + |
| 53 | +-- connection master |
| 54 | +DROP TABLE t1; |
| 55 | +-- sync_slave_with_master |
| 56 | + |
| 57 | +-- source include/master-slave-reset.inc |
| 58 | + |
| 59 | +-- connection master |
| 60 | + |
| 61 | +# BUG#49482: RBR: Replication may break on deletes when MyISAM tables |
| 62 | +# + char field are used |
| 63 | + |
| 64 | +-- eval CREATE TABLE t1 (c1 CHAR) Engine=$engine |
| 65 | + |
| 66 | +INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ; |
| 67 | +SELECT * FROM t1; |
| 68 | +UPDATE t1 SET c1=NULL WHERE c1='w'; |
| 69 | +-- sync_slave_with_master |
| 70 | + |
| 71 | +-- let $diff_table_1=master:test.t1 |
| 72 | +-- let $diff_table_2=slave:test.t1 |
| 73 | +-- source include/diff_tables.inc |
| 74 | + |
| 75 | +-- connection master |
| 76 | +# triggers switch to row mode when on mixed |
| 77 | +DELETE FROM t1 LIMIT 2; |
| 78 | +-- sync_slave_with_master |
| 79 | + |
| 80 | +-- let $diff_table_1=master:test.t1 |
| 81 | +-- let $diff_table_2=slave:test.t1 |
| 82 | +-- source include/diff_tables.inc |
| 83 | + |
| 84 | +-- connection master |
| 85 | +DROP TABLE t1; |
| 86 | +-- sync_slave_with_master |
0 commit comments