1
source include/have_tokudb.inc;
2
source include/have_innodb.inc;
4
set default_storage_engine='tokudb';
7
drop table if exists t;
10
create table tt (id int primary key, x int unsigned);
11
insert into tt values (1,0),(2,pow(2,32)-1);
12
create table ti like tt;
13
alter table ti engine=innodb;
14
insert into ti select * from tt;
16
set tokudb_disable_slow_update=1;
18
update noar tt set x=x+1 where id=1;
19
update noar ti set x=x+1 where id=1;
20
let $diff_tables = test.tt, test.ti;
21
source include/diff_tables.inc;
23
update noar tt set x=x-2 where id=1;
24
update noar ti set x=if(x<2,0,x-2) where id=1;
25
let $diff_tables = test.tt, test.ti;
26
source include/diff_tables.inc;
28
update noar tt set x=x+1 where id=1;
29
update noar ti set x=x+1 where id=1;
30
let $diff_tables = test.tt, test.ti;
31
source include/diff_tables.inc;
33
update noar tt set x=x-1 where id=2;
34
update noar ti set x=x-1 where id=2;
35
let $diff_tables = test.tt, test.ti;
36
source include/diff_tables.inc;
38
update noar tt set x=x+1 where id=2;
39
update noar ti set x=x+1 where id=2;
40
let $diff_tables = test.tt, test.ti;
41
source include/diff_tables.inc;
43
# test clip at maximum
44
insert into tt values (4,pow(2,32)-10);
45
insert into ti values (4,pow(2,32)-10);
46
update noar tt set x=x+20 where id=4;
47
update noar ti set x=x+20 where id=4;
48
let $diff_tables = test.tt, test.ti;
49
source include/diff_tables.inc;
51
# test clip at minimum
52
insert into tt values (5,10);
53
insert into ti values (5,10);
54
update noar tt set x=x-20 where id=5;
55
update noar ti set x=if(x<20,0,x-20) where id=5;
56
let $diff_tables = test.tt, test.ti;
57
source include/diff_tables.inc;