SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
DROP TABLE IF EXISTS foo;
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;
# should read all four values
select * from foo;
a	b	c
1	10	100
2	20	200
3	30	300
4	40	400
set session transaction isolation level repeatable read;
set session tokudb_load_save_space=0;
alter table foo add index (b);
# should read all four values
select * from foo;
a	b	c
1	10	100
2	20	200
3	30	300
4	40	400
# should fail
select sum(b) from foo;
ERROR HY000: Table definition has changed, please retry transaction
commit;
# should return 100
select sum(b) from foo;
sum(b)
100
set session transaction isolation level serializable;
DROP TABLE foo;
