diff options
author | Luis Soares <luis.soares@sun.com> | 2010-01-26 08:55:22 +0000 |
---|---|---|
committer | Luis Soares <luis.soares@sun.com> | 2010-01-26 08:55:22 +0000 |
commit | 9ac2343cc3fbba20a7615dfcb34a88d183c7bea5 (patch) | |
tree | d08a1a654cc33156dd9f60ed64d5992a7ab9fb28 /mysql-test/extra | |
parent | c7cb4b3c42ceeabf0e6ce289dccee560896faacc (diff) | |
parent | 73f10f0662ce40b5cc6e8bc4d04f6cee45768ae7 (diff) | |
download | mariadb-git-9ac2343cc3fbba20a7615dfcb34a88d183c7bea5.tar.gz |
automerge: mysql-5.1-bugteam branch --> mysql-5.1-bugteam latest
NOTE: added TODO to the comments requested by reviewer during this
merge.
Diffstat (limited to 'mysql-test/extra')
-rw-r--r-- | mysql-test/extra/rpl_tests/rpl_set_null.test | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/mysql-test/extra/rpl_tests/rpl_set_null.test b/mysql-test/extra/rpl_tests/rpl_set_null.test new file mode 100644 index 00000000000..f2aba089279 --- /dev/null +++ b/mysql-test/extra/rpl_tests/rpl_set_null.test @@ -0,0 +1,86 @@ +# Both of the following tests check that comparison of binlog BI +# against SE record will not fail due to remains from previous values +# in the SE record (before a given field was set to null). +# +# In MIXED mode: +# - Insert and update are executed as statements +# - Delete is executed as a row event +# - Assertion: checks that comparison will not fail because the update +# statement will clear the record contents for the nulled +# field. If data was not cleared, some engines may keep +# the value and return it later as garbage - despite the +# fact that field is null. This may cause slave to +# falsely fail in the comparison (memcmp would fail +# because of "garbage" in record data). +# +# In ROW mode: +# - Insert, update and delete are executed as row events. +# - Assertion: checks that comparison will not fail because the update +# rows event will clear the record contents before +# feeding the new value to the SE. This protects against +# SEs that do not clear record contents when storing +# nulled fields. If the engine did not clear the data it +# would cause slave to falsely fail in the comparison +# (memcmp would fail because of "garbage" in record +# data). This scenario is pretty much the same described +# above in MIXED mode, but checks different execution +# path in the slave. + +# BUG#49481: RBR: MyISAM and bit fields may cause slave to stop on +# delete cant find record + +-- source include/master-slave-reset.inc + +-- connection master +-- eval CREATE TABLE t1 (c1 BIT, c2 INT) Engine=$engine +INSERT INTO `t1` VALUES ( 1, 1 ); +UPDATE t1 SET c1=NULL where c2=1; +-- sync_slave_with_master + +-- let $diff_table_1=master:test.t1 +-- let $diff_table_2=slave:test.t1 +-- source include/diff_tables.inc + +-- connection master +# triggers switch to row mode when on mixed +DELETE FROM t1 WHERE c2=1 LIMIT 1; +-- sync_slave_with_master + +-- let $diff_table_1=master:test.t1 +-- let $diff_table_2=slave:test.t1 +-- source include/diff_tables.inc + +-- connection master +DROP TABLE t1; +-- sync_slave_with_master + +-- source include/master-slave-reset.inc + +-- connection master + +# BUG#49482: RBR: Replication may break on deletes when MyISAM tables +# + char field are used + +-- eval CREATE TABLE t1 (c1 CHAR) Engine=$engine + +INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ; +SELECT * FROM t1; +UPDATE t1 SET c1=NULL WHERE c1='w'; +-- sync_slave_with_master + +-- let $diff_table_1=master:test.t1 +-- let $diff_table_2=slave:test.t1 +-- source include/diff_tables.inc + +-- connection master +# triggers switch to row mode when on mixed +DELETE FROM t1 LIMIT 2; +-- sync_slave_with_master + +-- let $diff_table_1=master:test.t1 +-- let $diff_table_2=slave:test.t1 +-- source include/diff_tables.inc + +-- connection master +DROP TABLE t1; +-- sync_slave_with_master |