~vadim-tk/percona-server/percona-galera-5.1.57

« back to all changes in this revision

Viewing changes to mysql-test/extra/rpl_tests/rpl_set_null.test

  • Committer: root
  • Date: 2011-07-10 16:09:24 UTC
  • Revision ID: root@r815.office.percona.com-20110710160924-fyffqsbaclgu6vui
Initial port

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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/rpl_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_tables= master:t1, slave:t1
 
41
-- source include/diff_tables.inc
 
42
 
 
43
-- connection master
 
44
# triggers switch to row mode when on mixed 
 
45
DELETE FROM t1 WHERE c2=1 LIMIT 1;
 
46
-- sync_slave_with_master
 
47
 
 
48
-- let $diff_tables= master:t1, slave:t1
 
49
-- source include/diff_tables.inc
 
50
 
 
51
-- connection master
 
52
DROP TABLE t1;
 
53
-- sync_slave_with_master
 
54
 
 
55
-- source include/rpl_reset.inc
 
56
 
 
57
-- connection master
 
58
 
 
59
# BUG#49482: RBR: Replication may break on deletes when MyISAM tables
 
60
#  + char field are used
 
61
 
 
62
-- eval CREATE TABLE t1 (c1 CHAR) Engine=$engine
 
63
 
 
64
INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ;
 
65
SELECT * FROM t1;
 
66
UPDATE t1 SET c1=NULL WHERE c1='w';
 
67
-- sync_slave_with_master
 
68
 
 
69
-- let $diff_tables= master:t1, slave:t1
 
70
-- source include/diff_tables.inc
 
71
 
 
72
-- connection master
 
73
# triggers switch to row mode when on mixed 
 
74
DELETE FROM t1 LIMIT 2;
 
75
-- sync_slave_with_master
 
76
 
 
77
-- let $diff_tables= master:t1, slave:t1
 
78
-- source include/diff_tables.inc
 
79
 
 
80
-- connection master
 
81
DROP TABLE t1;
 
82
-- sync_slave_with_master