fast_update_binlog_statement.test 1.05 KB
Newer Older
1
source include/master-slave.inc;
2 3 4
source include/have_binlog_format_statement.inc;
source include/have_tokudb.inc;

5
set default_storage_engine='tokudb';
6 7 8 9
create table tt (id int primary key, x int);

set session tokudb_disable_slow_upsert=1;

10 11 12
connection master;
show variables like 'binlog_format';
show variables like 'server_id';
13

14 15 16
connection slave;
show variables like 'binlog_format';
show variables like 'server_id';
17

18
connection master;
19

20
let $n=100;
21

22 23 24 25 26 27
# 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;
}
28

29 30 31 32 33 34
# 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;
}
35

36 37 38 39 40 41 42 43 44 45 46 47 48 49
# 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;
50
drop table tt;
51 52 53

source include/rpl_end.inc;