1SET DEFAULT_STORAGE_ENGINE = 'tokudb';
2# Establish connection conn1 (user = root)
3connect  conn1,localhost,root,,;
4DROP TABLE IF EXISTS foo;
5connection conn1;
6set session transaction isolation level repeatable read;
7connection default;
8set session transaction isolation level repeatable read;
9create table foo (a int, b int, primary key (a))engine=TokUDB;
10insert into foo values (1,1),(2,2),(3,3),(4,4),(5,5),(10,10),(20,20),(30,30),(40,40),(50,50);
11connection conn1;
12begin;
13select * from foo;
14a	b
151	1
162	2
173	3
184	4
195	5
2010	10
2120	20
2230	30
2340	40
2450	50
25# number of rows should be 9
26explain select * from foo where a > 1;
27id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
281	SIMPLE	foo	range	PRIMARY	PRIMARY	4	NULL	9	Using where
29connection default;
30delete from foo where a > 5;
31# number of rows should be 9
32explain select * from foo where a > 1;
33id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
341	SIMPLE	foo	range	PRIMARY	PRIMARY	4	NULL	5	Using where
35# should have just 4 values
36select * from foo where a > 1;
37a	b
382	2
393	3
404	4
415	5
42connection conn1;
43# number of rows should be 9
44explain select * from foo where a > 1;
45id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
461	SIMPLE	foo	range	PRIMARY	PRIMARY	4	NULL	5	Using where
47# 9 values
48select * From foo where a > 1;
49a	b
502	2
513	3
524	4
535	5
5410	10
5520	20
5630	30
5740	40
5850	50
59commit;
60connection default;
61disconnect conn1;
62connection default;
63set session transaction isolation level serializable;
64DROP TABLE foo;
65