Commit 7073d1fc authored by Zardosht Kasheff's avatar Zardosht Kasheff

[t:2908], add simple test

git-svn-id: file:///svn/mysql/tests/mysql-test@23838 c7de825b-a66e-492c-adef-691d508d4ae1
parent 3772df8b
SET STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
DROP TABLE IF EXISTS foo;
create table foo (a int)engine=TokuDB;
show create table foo;
Table Create Table
foo CREATE TABLE `foo` (
`a` int(11) DEFAULT NULL
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
insert into foo values (1),(2),(3);
begin;
insert into foo values (4);
set session transaction isolation level repeatable read;
# 1,2,3
select * from foo;
a
1
2
3
checksum table foo;
Table Checksum
test.foo 251493421
set session transaction isolation level read committed;
# 1,2,3
select * from foo;
a
1
2
3
checksum table foo;
Table Checksum
test.foo 251493421
set session transaction isolation level read uncommitted;
# 1,2,3,4
select * from foo;
a
1
2
3
4
checksum table foo;
Table Checksum
test.foo 149057747
set session transaction isolation level serializable;
select * from foo;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
# should be NULl
checksum table foo;
Table Checksum
test.foo NULL
commit;
set session transaction isolation level serializable;
DROP TABLE foo;
# ticket 895 is a query optimization problem with the primary key
#--source include/have_tokudb.inc
SET STORAGE_ENGINE = 'tokudb';
--echo # Establish connection conn1 (user = root)
connect (conn1,localhost,root,,);
--disable_warnings
DROP TABLE IF EXISTS foo;
--enable_warnings
connection default;
create table foo (a int)engine=TokuDB;
show create table foo;
insert into foo values (1),(2),(3);
begin;
insert into foo values (4);
connection conn1;
set session transaction isolation level repeatable read;
--echo # 1,2,3
select * from foo;
checksum table foo;
set session transaction isolation level read committed;
--echo # 1,2,3
select * from foo;
checksum table foo;
set session transaction isolation level read uncommitted;
--echo # 1,2,3,4
select * from foo;
checksum table foo;
set session transaction isolation level serializable;
--error ER_LOCK_WAIT_TIMEOUT
select * from foo;
--echo # should be NULl
checksum table foo;
connection default;
commit;
disconnect conn1;
connection default;
# Final cleanup.
set session transaction isolation level serializable;
DROP TABLE foo;
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment