summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test/tokudb/t/fast_update_char.test
blob: 173648459428d8bf8323c7737b03bfaab3c2b0e9 (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
88
89
90
91
92
93
94
95
96
97
98
99
# test that char field updates are fast
# test that char field primary keys are fast

source include/have_tokudb.inc;
source include/have_innodb.inc;

set tokudb_enable_fast_update=1;
source ../include/setup_fast_update_upsert.inc;

create table tt (id int primary key, c char(32), b binary(32)) engine = tokudb;
create table ti like tt;
alter table ti engine=innodb;

insert into tt values (1,null,null);
insert into ti values (1,null,null);

update tt set c='hi' where id=1;
update ti set c='hi' where id=1;
let $diff_tables = test.tt, test.ti;
source include/diff_tables.inc;

update tt set c='there' where id=1;
update ti set c='there' where id=1;
let $diff_tables = test.tt, test.ti;
source include/diff_tables.inc;

drop table tt, ti;

create table tt (id char(8) primary key,
                 c char(32),
                 b binary(32)) engine = tokudb;
create table ti like tt;
alter table ti engine=innodb;

insert into tt values ('1',null,null);
insert into ti values ('1',null,null);

update tt set c='hi' where id='1';
update ti set c='hi' where id='1';
let $diff_tables = test.tt, test.ti;
source include/diff_tables.inc;

update tt set c='there' where id='1';
update ti set c='there' where id='1';
let $diff_tables = test.tt, test.ti;
source include/diff_tables.inc;

drop table tt, ti;

create table tt (id varchar(8) primary key,
                 a int,
                 b char(32),
                 c char(32),
                 d binary(32)) engine = tokudb;
create table ti like tt;
alter table ti engine=innodb;

insert into tt values ('1',null,null,null,null);
insert into ti values ('1',null,null,null,null);

update tt set b='hi' where id='1';
update ti set b='hi' where id='1';
let $diff_tables = test.tt, test.ti;
source include/diff_tables.inc;

update tt set c='there' where id='1';
update ti set c='there' where id='1';
let $diff_tables = test.tt, test.ti;
source include/diff_tables.inc;

drop table tt, ti;

create table tt (id varchar(8) primary key,
                 a int,
                 b char(32),
                 c char(32),
                 d binary(32)) engine = tokudb;
create table ti like tt;
alter table ti engine=innodb;

insert into tt values ('1',null,null,null,null);
insert into ti values ('1',null,null,null,null);

update tt set b='123' where id='1';
update ti set b='123' where id='1';
let $diff_tables = test.tt, test.ti;
source include/diff_tables.inc;

update tt set c=456 where id='1';
update ti set c=456 where id='1';
let $diff_tables = test.tt, test.ti;
source include/diff_tables.inc;

update tt set c=789 where id=1;
update ti set c=789 where id=1;
let $diff_tables = test.tt, test.ti;
source include/diff_tables.inc;

drop table tt, ti;