mariadb/mysql-test/suite/tokudb.mvcc/r/mvcc-36.result
Zardosht Kasheff 8ea4ac6085 [t:2922] move mvcc tests
git-svn-id: file:///svn/mysql/tests/mysql-test@23629 c7de825b-a66e-492c-adef-691d508d4ae1
2010-09-08 18:49:31 +00:00

73 lines
2.1 KiB
Text
Executable file

SET STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
DROP TABLE IF EXISTS foo;
set session transaction isolation level serializable;
create table foo (a int, b int, c int, primary key (a), key (b))engine=TokuDB;
show create table foo;
Table Create Table
foo CREATE TABLE `foo` (
`a` int(11) NOT NULL DEFAULT '0',
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `b` (`b`)
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
insert into foo values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500),(6,60,600),(7,70,700),(8,80,800),(9,90,900);
begin;
select * from foo;
a b c
1 10 100
2 20 200
3 30 300
4 40 400
5 50 500
6 60 600
7 70 700
8 80 800
9 90 900
# should use key b
explain select * from foo where b=50;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo ref b b 5 const 1 Using where
# should get (5,50,500)
select * from foo where b=50;
a b c
5 50 500
replace into foo values (5,50,1515);
set session transaction isolation level serializable;
begin;
# should use key b
explain select * from foo where b=50;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo ref b b 5 const 1 Using where
# timeout
select * from foo where b=50;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
# should use key b
explain select * from foo where b=50;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo ref b b 5 const 1 Using where
# should get (5,50,1515)
select * from foo where b=50;
a b c
5 50 1515
# should use key b
explain select * from foo where b=50;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo ref b b 5 const 1 Using where
# should get (5,50,1515)
select * from foo where b=50;
a b c
5 50 1515
commit;
# should use key b
explain select * from foo where b=50;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo ref b b 5 const 1 Using where
# should get (5,50,1515)
select * from foo where b=50;
a b c
5 50 1515
set session transaction isolation level serializable;
DROP TABLE foo;