1# simple keyrange64 test, ensure that it reads number of leafentries in the system
2
3--source include/have_tokudb.inc
4SET DEFAULT_STORAGE_ENGINE = 'tokudb';
5
6--echo # Establish connection conn1 (user = root)
7connect (conn1,localhost,root,,);
8
9--disable_warnings
10DROP TABLE IF EXISTS foo;
11--enable_warnings
12
13connection conn1;
14set session transaction isolation level repeatable read;
15
16connection default;
17set session transaction isolation level repeatable read;
18create table foo (a int, b int, primary key (a))engine=TokUDB;
19insert into foo values (1,1),(2,2),(3,3),(4,4),(5,5),(10,10),(20,20),(30,30),(40,40),(50,50);
20
21connection conn1;
22begin;
23select * from foo;
24--echo # number of rows should be 8
25explain select * from foo where a > 1 and a < 50;
26
27connection default;
28delete from foo where a = 2 or a = 4 or a = 10 or a = 30 or a = 50;
29--echo # number of rows should be 8
30explain select * from foo where a > 1 and a < 50;
31--echo # should have just 4 values
32select * from foo where a > 1 and a < 50;
33
34connection conn1;
35--echo # number of rows should be 8
36explain select * from foo where a > 1 and a < 50;
37--echo # 8 values
38select * from foo where a > 1 and a < 50;
39commit;
40
41connection default;
42disconnect conn1;
43
44connection default;
45# Final cleanup.
46set session transaction isolation level serializable;
47DROP TABLE foo;