summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test/tokudb/t/fast_update_int_bounds.test
blob: cf35424323604ea7580e8291f8d84767f5ac029e (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
source include/have_tokudb.inc;
source include/have_innodb.inc;

set default_storage_engine='tokudb';

disable_warnings;
drop table if exists t;
enable_warnings;

create table tt (id int primary key, x int);
insert into tt values (1,0),(2,-pow(2,31)),(3,pow(2,31)-1);
create table ti like tt;
alter table ti engine=innodb;
insert into ti select * from tt;

set tokudb_disable_slow_update=1;

update noar tt set x=x+1 where id=1;
update noar ti set x=x+1 where id=1;
let $diff_tables = test.tt, test.ti;
source include/diff_tables.inc;

update noar tt set x=x-2 where id=1;
update noar ti set x=x-2 where id=1;
let $diff_tables = test.tt, test.ti;
source include/diff_tables.inc;

update noar tt set x=x+1 where id=1;
update noar ti set x=x+1 where id=1;
let $diff_tables = test.tt, test.ti;
source include/diff_tables.inc;

update noar tt set x=x-1 where id=2;
update noar ti set x=x-1 where id=2;
let $diff_tables = test.tt, test.ti;
source include/diff_tables.inc;

update noar tt set x=x+1 where id=2;
update noar ti set x=x+1 where id=2;
let $diff_tables = test.tt, test.ti;
source include/diff_tables.inc;

update noar tt set x=x+1 where id=3;
update noar ti set x=x+1 where id=3;
let $diff_tables = test.tt, test.ti;
source include/diff_tables.inc;

update noar tt set x=x-1 where id=3;
update noar ti set x=x-1 where id=3;
let $diff_tables = test.tt, test.ti;
source include/diff_tables.inc;

# test clip at maximum
insert into tt values (4,pow(2,31)-10);
insert into ti values (4,pow(2,31)-10);
update noar tt set x=x+20 where id=4;
update noar ti set x=x+20 where id=4;
let $diff_tables = test.tt, test.ti;
source include/diff_tables.inc;

insert into tt values (5,pow(2,31)-10);
insert into ti values (5,pow(2,31)-10);
update noar tt set x=x - -20 where id=5;
update noar ti set x=x - -20 where id=5;
let $diff_tables = test.tt, test.ti;
source include/diff_tables.inc;

# test clip at minimum
insert into tt values (6,-pow(2,31)+10);
insert into ti values (6,-pow(2,31)+10);
update noar tt set x=x-20 where id=6;
update noar ti set x=x-20 where id=6;
let $diff_tables = test.tt, test.ti;
source include/diff_tables.inc;

insert into tt values (7,-pow(2,31)+10);
insert into ti values (7,-pow(2,31)+10);
update noar tt set x=x + -20 where id=7;
update noar ti set x=x + -20 where id=7;
let $diff_tables = test.tt, test.ti;
source include/diff_tables.inc;


drop table tt, ti;