summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test/tokudb/t/fast_update_binlog_statement.test
blob: bab2aadb340d2e9e6772f30be90fb79ebce472c8 (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
49
50
51
52
53
source include/master-slave.inc;
source include/have_binlog_format_statement.inc;
source include/have_tokudb.inc;

set default_storage_engine='tokudb';
create table tt (id int primary key, x int);

set session tokudb_disable_slow_upsert=1;

connection master;
show variables like 'binlog_format';
show variables like 'server_id';

connection slave;
show variables like 'binlog_format';
show variables like 'server_id';

connection master;

let $n=100;

# insert a bunch of new rows
let $i=0;
while ($i < $n) {
        eval insert into tt values ($i,0) on duplicate key update x=x+1;
        inc $i;
}

# upsert a bunch of rows
let $i=0;
while ($i < $n) {
        eval insert into tt values ($i,0) on duplicate key update x=x+1;
        inc $i;
}

# update a bunch of rows
let $i=0;
while ($i < $n) {
        eval update noar tt set x=x+1 where id=$i;
        inc $i;
}
select * from tt where x != 2;

sync_slave_with_master;

let $diff_tables= master:test.tt, slave:test.tt;
source include/diff_tables.inc;

connection master;
drop table tt;

source include/rpl_end.inc;