1create table tt (id int primary key, x int unsigned) engine = tokudb;
2insert into tt values (1,0),(2,pow(2,32)-1);
3create table ti like tt;
4alter table ti engine=innodb;
5insert into ti select * from tt;
6set tokudb_enable_fast_update=1;
7set session sql_mode=(select replace(@@sql_mode,'STRICT_TRANS_TABLES',''));
8set session sql_mode=(select replace(@@sql_mode,'STRICT_ALL_TABLES',''));
9update tt set x=x+1 where id=1;
10update ti set x=x+1 where id=1;
11include/diff_tables.inc [test.tt, test.ti]
12update tt set x=x-2 where id=1;
13update ti set x=if(x<2,0,x-2) where id=1;
14include/diff_tables.inc [test.tt, test.ti]
15update tt set x=x+1 where id=1;
16update ti set x=x+1 where id=1;
17include/diff_tables.inc [test.tt, test.ti]
18update tt set x=x-1 where id=2;
19update ti set x=x-1 where id=2;
20include/diff_tables.inc [test.tt, test.ti]
21update tt set x=x+1 where id=2;
22update ti set x=x+1 where id=2;
23include/diff_tables.inc [test.tt, test.ti]
24insert into tt values (4,pow(2,32)-10);
25insert into ti values (4,pow(2,32)-10);
26update tt set x=x+20 where id=4;
27update ti set x=x+20 where id=4;
28Warnings:
29Warning	1264	Out of range value for column 'x' at row 1
30include/diff_tables.inc [test.tt, test.ti]
31insert into tt values (5,10);
32insert into ti values (5,10);
33update tt set x=x-20 where id=5;
34update ti set x=if(x<20,0,x-20) where id=5;
35include/diff_tables.inc [test.tt, test.ti]
36drop table tt, ti;
37