summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test/rpl/t/rpl_rfr_disable_on_expl_pk_absence.test
blob: 67e77c1511c02719001440bf5e37d98c950fc9ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Test case for bug#1536663
#
# When read-free-replication is enabled for tokudb and there is no explicit
# pk for replicated table there can be dublicated records in the table on
# update operation.
#
# Consider this update operation:
# UPDATE t SET a = a + 10 WHERE b = 'b';
# The master does rows lookup and updates the rows which values correspond to
# the condition. The update events are written to binary log with
# rows values from the master. As rows lookup is forbidden for slave
# the new rows are added instead of updating corresponding rows.
#
# Without the fix there will be several rows with b = 'b' in the table on slave
# instead of one updated row.
#

--source include/have_tokudb.inc
--source include/have_binlog_format_row.inc
--source include/master-slave.inc

call mtr.add_suppression("read free replication is disabled for tokudb table");

--connection master
CREATE TABLE t (a int(11), b char(20)) ENGINE = TokuDB;
INSERT INTO t (a, b) VALUES (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e');

--sync_slave_with_master
--sorted_result
SELECT * FROM t;

--let $i = 2
--while($i) {
  --dec $i
  --connection master
  UPDATE t SET a = a + 10 WHERE b = 'b';
  --sorted_result
  SELECT * FROM t;
  --sync_slave_with_master
  --sorted_result
  SELECT * FROM t;
}

--connection master
DROP TABLE t;
--sync_slave_with_master

--source include/rpl_end.inc