summaryrefslogtreecommitdiff
path: root/mysql-test/suite/tokudb/t/hotindex-insert-2.test
blob: 2496b72ee488c3dad25777df85c657e9f3c30378 (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
source include/have_tokudb.inc;
# test that deletes work when hot indexing is on with replace into optimization
# test is checking #3406

SET DEFAULT_STORAGE_ENGINE='tokudb';

--echo # Establish connection conn1 (user = root)
connect (conn1,localhost,root,,);

connection default;

# create table s
--disable_warnings
drop table if exists s;
--enable_warnings
create table s (a int auto_increment, b int, c int, primary key (a));

--echo # populate table s
--disable_query_log
let $a = 10000;
while ($a) {
    eval insert into s (b,c) values ($a,0),($a,1),($a,2),($a,3),($a,4),($a,5),($a,6),($a,7),($a,8),($a,9);
    dec $a;
}
--enable_query_log

--echo # done inserting elements
set tokudb_create_index_online=1;
send create index i_a on s(c);

connection conn1;

--echo # starting insert while create index is happening
--disable_query_log
let $b=10000;
while ($b) {
    eval replace into s values (1, 1000000000,$b);
    dec $b;
}
--enable_query_log
--echo # done with insert

connection default;
reap;
select count(*) from s use index(primary);
select count(*) from s use index(i_a);
disconnect conn1;

#cleanup
drop table s;