summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test/tokudb/t/mvcc-19.test
blob: 3054797a83fd1ca514520412b6f7d6a076b54684 (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
# ticket 895 is a query optimization problem with the primary key

#--source include/have_tokudb.inc
--source include/not_5_5.inc
SET DEFAULT_STORAGE_ENGINE = 'tokudb';

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

--disable_warnings
DROP TABLE IF EXISTS foo;
--enable_warnings

connection default;
set session transaction isolation level repeatable read;
create table foo (a int, b int, c int, primary key (a))engine=TokuDB;
insert into foo values (1,10,100),(2,20,200),(3,30,300),(4,40,400);
begin;
--echo # should read all four values
select * from foo;

connection conn1;
set session transaction isolation level repeatable read;
set session tokudb_load_save_space=0;
alter table foo add index (b);

connection default;
--echo # should read all four values
select * from foo;
--echo # should fail
--error ER_TABLE_DEF_CHANGED
select sum(b) from foo;
commit;
--echo # should return 100
select sum(b) from foo;

connection default;
disconnect conn1;

connection default;
# Final cleanup.
set session transaction isolation level serializable;
DROP TABLE foo;