mirror of
https://github.com/MariaDB/server.git
synced 2025-02-01 03:21:53 +01:00
[t:2922] move mvcc tests
git-svn-id: file:///svn/mysql/tests/mysql-test@23629 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
cf14cd6260
commit
c61464298f
80 changed files with 3840 additions and 0 deletions
58
mysql-test/suite/tokudb.mvcc/r/2808-read-committed.result
Executable file
58
mysql-test/suite/tokudb.mvcc/r/2808-read-committed.result
Executable file
|
@ -0,0 +1,58 @@
|
|||
# Establish connection conn1 (user = root)
|
||||
SET STORAGE_ENGINE = 'tokudb';
|
||||
DROP TABLE IF EXISTS foo,foo_isam;
|
||||
set session transaction isolation level read committed;
|
||||
create table foo ( a int, b int, primary key (a));
|
||||
insert into foo values (1,1),(2,2),(3,1),(4,3);
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
3 1
|
||||
4 3
|
||||
begin;
|
||||
update foo set b=10 where b=1;
|
||||
select * from foo;
|
||||
a b
|
||||
1 10
|
||||
2 2
|
||||
3 10
|
||||
4 3
|
||||
insert into foo values (5,5);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
rollback;
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
3 1
|
||||
4 3
|
||||
begin;
|
||||
delete from foo where b=2;
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
3 1
|
||||
4 3
|
||||
insert into foo values (5,5);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
rollback;
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
3 1
|
||||
4 3
|
||||
create table foo_isam (a int, b int)engine=MyISAM;
|
||||
begin;
|
||||
insert into foo_isam select * from foo;
|
||||
insert into foo values (5,5);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
3 1
|
||||
4 3
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo, foo_isam;
|
58
mysql-test/suite/tokudb.mvcc/r/2808-read-uncommitted.result
Executable file
58
mysql-test/suite/tokudb.mvcc/r/2808-read-uncommitted.result
Executable file
|
@ -0,0 +1,58 @@
|
|||
# Establish connection conn1 (user = root)
|
||||
SET STORAGE_ENGINE = 'tokudb';
|
||||
DROP TABLE IF EXISTS foo,foo_isam;
|
||||
set session transaction isolation level read uncommitted;
|
||||
create table foo ( a int, b int, primary key (a));
|
||||
insert into foo values (1,1),(2,2),(3,1),(4,3);
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
3 1
|
||||
4 3
|
||||
begin;
|
||||
update foo set b=10 where b=1;
|
||||
select * from foo;
|
||||
a b
|
||||
1 10
|
||||
2 2
|
||||
3 10
|
||||
4 3
|
||||
insert into foo values (5,5);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
rollback;
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
3 1
|
||||
4 3
|
||||
begin;
|
||||
delete from foo where b=2;
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
3 1
|
||||
4 3
|
||||
insert into foo values (5,5);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
rollback;
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
3 1
|
||||
4 3
|
||||
create table foo_isam (a int, b int)engine=MyISAM;
|
||||
begin;
|
||||
insert into foo_isam select * from foo;
|
||||
insert into foo values (5,5);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
3 1
|
||||
4 3
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo, foo_isam;
|
24
mysql-test/suite/tokudb.mvcc/r/mvcc-1.result
Executable file
24
mysql-test/suite/tokudb.mvcc/r/mvcc-1.result
Executable file
|
@ -0,0 +1,24 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
DROP TABLE IF EXISTS foo;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int);
|
||||
select * from foo;
|
||||
a
|
||||
begin;
|
||||
insert into foo values (1);
|
||||
select * from foo;
|
||||
a
|
||||
1
|
||||
rollback;
|
||||
select * from foo;
|
||||
a
|
||||
set session transaction isolation level read committed;
|
||||
begin;
|
||||
insert into foo values (1);
|
||||
select * from foo;
|
||||
a
|
||||
1
|
||||
rollback;
|
||||
select * from foo;
|
||||
a
|
||||
DROP TABLE foo;
|
51
mysql-test/suite/tokudb.mvcc/r/mvcc-10.result
Executable file
51
mysql-test/suite/tokudb.mvcc/r/mvcc-10.result
Executable file
|
@ -0,0 +1,51 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo;
|
||||
create table foo (a int, b varchar (100), primary key (a)) engine=TokuDB;
|
||||
show create table foo;
|
||||
Table Create Table
|
||||
foo CREATE TABLE `foo` (
|
||||
`a` int(11) NOT NULL DEFAULT '0',
|
||||
`b` varchar(100) DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
replace into foo values (1, "a");
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 a
|
||||
delete from foo;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
replace into foo values (1,"abc");
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 abc
|
||||
delete from foo;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
select * from foo;
|
||||
a b
|
||||
select * from foo;
|
||||
a b
|
||||
1 a
|
||||
select * from foo;
|
||||
a b
|
||||
select * from foo;
|
||||
a b
|
||||
1 abc
|
||||
select * from foo;
|
||||
a b
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
23
mysql-test/suite/tokudb.mvcc/r/mvcc-11.result
Executable file
23
mysql-test/suite/tokudb.mvcc/r/mvcc-11.result
Executable file
|
@ -0,0 +1,23 @@
|
|||
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);
|
||||
begin;
|
||||
insert into foo values (2);
|
||||
set session transaction isolation level serializable;
|
||||
select * from foo;
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
set session transaction isolation level read uncommitted;
|
||||
select * from foo;
|
||||
a
|
||||
1
|
||||
2
|
||||
commit;
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
30
mysql-test/suite/tokudb.mvcc/r/mvcc-12.result
Executable file
30
mysql-test/suite/tokudb.mvcc/r/mvcc-12.result
Executable file
|
@ -0,0 +1,30 @@
|
|||
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) 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);
|
||||
begin;
|
||||
select * from foo;
|
||||
a
|
||||
1
|
||||
set session transaction isolation level serializable;
|
||||
insert into foo values (3);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
set session transaction isolation level repeatable read;
|
||||
insert into foo values (3);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
set session transaction isolation level read committed;
|
||||
insert into foo values (3);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
set session transaction isolation level read uncommitted;
|
||||
insert into foo values (3);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
commit;
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
20
mysql-test/suite/tokudb.mvcc/r/mvcc-13.result
Executable file
20
mysql-test/suite/tokudb.mvcc/r/mvcc-13.result
Executable file
|
@ -0,0 +1,20 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo,foo1;
|
||||
set session transaction isolation level repeatable read;
|
||||
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
|
||||
begin;
|
||||
select * from foo;
|
||||
a
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo1(a int) engine=TokuDB;
|
||||
insert into foo1 values(1);
|
||||
select * from foo1;
|
||||
ERROR HY000: Table definition has changed, please retry transaction
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo,foo1;
|
21
mysql-test/suite/tokudb.mvcc/r/mvcc-14.result
Executable file
21
mysql-test/suite/tokudb.mvcc/r/mvcc-14.result
Executable file
|
@ -0,0 +1,21 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo,foo1;
|
||||
set session transaction isolation level read uncommitted;
|
||||
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
|
||||
begin;
|
||||
select * from foo;
|
||||
a
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo1(a int) engine=TokuDB;
|
||||
insert into foo1 values(1);
|
||||
select * from foo1;
|
||||
a
|
||||
1
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo,foo1;
|
21
mysql-test/suite/tokudb.mvcc/r/mvcc-15.result
Executable file
21
mysql-test/suite/tokudb.mvcc/r/mvcc-15.result
Executable file
|
@ -0,0 +1,21 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo,foo1;
|
||||
set session transaction isolation level serializable;
|
||||
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
|
||||
begin;
|
||||
select * from foo;
|
||||
a
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo1(a int) engine=TokuDB;
|
||||
insert into foo1 values(1);
|
||||
select * from foo1;
|
||||
a
|
||||
1
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo,foo1;
|
30
mysql-test/suite/tokudb.mvcc/r/mvcc-16.result
Executable file
30
mysql-test/suite/tokudb.mvcc/r/mvcc-16.result
Executable file
|
@ -0,0 +1,30 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo,foo1;
|
||||
set session transaction isolation level repeatable read;
|
||||
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
|
||||
begin;
|
||||
select * from foo;
|
||||
a
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo1(a int, b int, c int, primary key (a)) engine=TokuDB;
|
||||
insert into foo1 values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500);
|
||||
select a from foo1;
|
||||
ERROR HY000: Table definition has changed, please retry transaction
|
||||
select a from foo1 order by a desc;
|
||||
ERROR HY000: Table definition has changed, please retry transaction
|
||||
select * from foo1 where a=3;
|
||||
ERROR HY000: Table definition has changed, please retry transaction
|
||||
select * from foo1 where a>3;
|
||||
ERROR HY000: Table definition has changed, please retry transaction
|
||||
select * from foo1 where a>3 order by a desc;
|
||||
ERROR HY000: Table definition has changed, please retry transaction
|
||||
select * from foo1;
|
||||
ERROR HY000: Table definition has changed, please retry transaction
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo,foo1;
|
41
mysql-test/suite/tokudb.mvcc/r/mvcc-17.result
Executable file
41
mysql-test/suite/tokudb.mvcc/r/mvcc-17.result
Executable file
|
@ -0,0 +1,41 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo;
|
||||
set session tokudb_load_save_space=0;
|
||||
set session transaction isolation level repeatable read;
|
||||
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
|
||||
set session tokudb_load_save_space=0;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a
|
||||
begin;
|
||||
insert into foo values (1),(2),(3);
|
||||
# should return 1,2,3
|
||||
select * from foo;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
# should be empty
|
||||
select * from foo;
|
||||
a
|
||||
# verify that a bulk load was done, by trying to insert and fail due to ER_LOCK_WAIT_TIMEOUT
|
||||
insert into foo values (10000);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
commit;
|
||||
commit;
|
||||
# should see 1,2,3
|
||||
select * from foo;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
commit;
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
41
mysql-test/suite/tokudb.mvcc/r/mvcc-18.result
Executable file
41
mysql-test/suite/tokudb.mvcc/r/mvcc-18.result
Executable file
|
@ -0,0 +1,41 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo;
|
||||
set session tokudb_load_save_space=1;
|
||||
set session transaction isolation level repeatable read;
|
||||
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
|
||||
set session tokudb_load_save_space=1;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a
|
||||
begin;
|
||||
insert into foo values (1),(2),(3);
|
||||
# should return 1,2,3
|
||||
select * from foo;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
# should be empty
|
||||
select * from foo;
|
||||
a
|
||||
# verify that a bulk load was done, by trying to insert and fail due to ER_LOCK_WAIT_TIMEOUT
|
||||
insert into foo values (10000);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
commit;
|
||||
commit;
|
||||
# should see 1,2,3
|
||||
select * from foo;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
commit;
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
34
mysql-test/suite/tokudb.mvcc/r/mvcc-19.result
Executable file
34
mysql-test/suite/tokudb.mvcc/r/mvcc-19.result
Executable file
|
@ -0,0 +1,34 @@
|
|||
SET 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;
|
22
mysql-test/suite/tokudb.mvcc/r/mvcc-2.result
Executable file
22
mysql-test/suite/tokudb.mvcc/r/mvcc-2.result
Executable file
|
@ -0,0 +1,22 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
set session transaction isolation level repeatable read;
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int) engine=TokuDB;
|
||||
insert into foo values (1);
|
||||
begin;
|
||||
select * from foo;
|
||||
a
|
||||
1
|
||||
insert into foo values (1000000);
|
||||
select * From foo;
|
||||
a
|
||||
1
|
||||
select * from foo;
|
||||
a
|
||||
1
|
||||
1000000
|
||||
commit;
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
34
mysql-test/suite/tokudb.mvcc/r/mvcc-20.result
Executable file
34
mysql-test/suite/tokudb.mvcc/r/mvcc-20.result
Executable file
|
@ -0,0 +1,34 @@
|
|||
SET 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=1;
|
||||
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;
|
88
mysql-test/suite/tokudb.mvcc/r/mvcc-21.result
Executable file
88
mysql-test/suite/tokudb.mvcc/r/mvcc-21.result
Executable file
|
@ -0,0 +1,88 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo;
|
||||
create table foo (a int, b varchar (100), primary key (a)) engine=TokuDB;
|
||||
show create table foo;
|
||||
Table Create Table
|
||||
foo CREATE TABLE `foo` (
|
||||
`a` int(11) NOT NULL DEFAULT '0',
|
||||
`b` varchar(100) DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
replace into foo values (1, "a");
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 a
|
||||
replace into foo values (1,"abGARBAGE"), (2, "abGARBAGE");
|
||||
replace into foo values (1,"ab"), (2, "ab");
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 ab
|
||||
2 ab
|
||||
replace into foo values (1,"abcGARBAGE"),(2,"abcGARBAGE"),(3, "abcGARBAGE");
|
||||
replace into foo values (1,"abc"),(2,"abc"),(3, "abc");
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 abc
|
||||
2 abc
|
||||
3 abc
|
||||
replace into foo values (1,"abcdGARBAGE"),(2,"abcdGARBAGE"),(3, "abcdGARBAGE"),(4, "abcdGARBAGE");
|
||||
replace into foo values (1,"abcd"),(2,"abcd"),(3, "abcd"),(4, "abcd");
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 abcd
|
||||
2 abcd
|
||||
3 abcd
|
||||
4 abcd
|
||||
select * from foo;
|
||||
a b
|
||||
commit;
|
||||
select * from foo;
|
||||
a b
|
||||
1 a
|
||||
commit;
|
||||
select * from foo;
|
||||
a b
|
||||
1 ab
|
||||
2 ab
|
||||
commit;
|
||||
select * from foo;
|
||||
a b
|
||||
1 abc
|
||||
2 abc
|
||||
3 abc
|
||||
commit;
|
||||
select * from foo;
|
||||
a b
|
||||
1 abcd
|
||||
2 abcd
|
||||
3 abcd
|
||||
4 abcd
|
||||
commit;
|
||||
select * from foo;
|
||||
a b
|
||||
1 abcd
|
||||
2 abcd
|
||||
3 abcd
|
||||
4 abcd
|
||||
replace into foo values (1,"1"),(2,"2"),(3,"3"),(4,"4");
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
3 3
|
||||
4 4
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
71
mysql-test/suite/tokudb.mvcc/r/mvcc-22.result
Executable file
71
mysql-test/suite/tokudb.mvcc/r/mvcc-22.result
Executable file
|
@ -0,0 +1,71 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo;
|
||||
create table foo (a int, b varchar (100), primary key (a)) engine=TokuDB;
|
||||
show create table foo;
|
||||
Table Create Table
|
||||
foo CREATE TABLE `foo` (
|
||||
`a` int(11) NOT NULL DEFAULT '0',
|
||||
`b` varchar(100) DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
replace into foo values (1,"aGARBAGE");
|
||||
replace into foo values (1, "a");
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 a
|
||||
replace into foo values (1,"abGARBAGE");
|
||||
replace into foo values (1,"ab");
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 ab
|
||||
replace into foo values (1,"abcGARBAGE");
|
||||
replace into foo values (1,"abc");
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 abc
|
||||
replace into foo values (1,"abcdGARBAGE");
|
||||
replace into foo values (1,"abcd");
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 abcd
|
||||
select * from foo;
|
||||
a b
|
||||
commit;
|
||||
select * from foo;
|
||||
a b
|
||||
1 a
|
||||
commit;
|
||||
select * from foo;
|
||||
a b
|
||||
1 ab
|
||||
commit;
|
||||
select * from foo;
|
||||
a b
|
||||
1 abc
|
||||
commit;
|
||||
select * from foo;
|
||||
a b
|
||||
1 abcd
|
||||
commit;
|
||||
select * from foo;
|
||||
a b
|
||||
1 abcd
|
||||
replace into foo values (1,"1");
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
59
mysql-test/suite/tokudb.mvcc/r/mvcc-23.result
Executable file
59
mysql-test/suite/tokudb.mvcc/r/mvcc-23.result
Executable file
|
@ -0,0 +1,59 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo;
|
||||
create table foo (a int, b varchar (100), primary key (a)) engine=TokuDB;
|
||||
show create table foo;
|
||||
Table Create Table
|
||||
foo CREATE TABLE `foo` (
|
||||
`a` int(11) NOT NULL DEFAULT '0',
|
||||
`b` varchar(100) DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
replace into foo values (1, "aGARBAGE");
|
||||
replace into foo values (1, "a");
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 a
|
||||
replace into foo values (1, "delete1Garbage");
|
||||
delete from foo;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
replace into foo values (1,"abcGARBAGE");
|
||||
replace into foo values (1,"abc");
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 abc
|
||||
delete from foo;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
select * from foo;
|
||||
a b
|
||||
commit;
|
||||
select * from foo;
|
||||
a b
|
||||
1 a
|
||||
commit;
|
||||
select * from foo;
|
||||
a b
|
||||
commit;
|
||||
select * from foo;
|
||||
a b
|
||||
1 abc
|
||||
commit;
|
||||
select * from foo;
|
||||
a b
|
||||
commit;
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
28
mysql-test/suite/tokudb.mvcc/r/mvcc-24.result
Executable file
28
mysql-test/suite/tokudb.mvcc/r/mvcc-24.result
Executable file
|
@ -0,0 +1,28 @@
|
|||
SET 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 varchar (100), primary key (a))engine=TokuDB;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
# should return nothing
|
||||
select * from foo;
|
||||
a b
|
||||
insert into foo values (1, "G");
|
||||
replace into foo values (1, "Ga");
|
||||
replace into foo values (1, "Gar");
|
||||
replace into foo values (1, "Garb");
|
||||
replace into foo values (1, "Garba");
|
||||
replace into foo values (1, "a");
|
||||
begin;
|
||||
# Should read (1, "a")
|
||||
select * from foo;
|
||||
a b
|
||||
1 a
|
||||
# Should be empty
|
||||
select * from foo;
|
||||
a b
|
||||
commit;
|
||||
commit;
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
54
mysql-test/suite/tokudb.mvcc/r/mvcc-25.result
Executable file
54
mysql-test/suite/tokudb.mvcc/r/mvcc-25.result
Executable file
|
@ -0,0 +1,54 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo,bar;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int, b varchar (100), primary key (a))engine=TokuDB;
|
||||
create table bar like foo;
|
||||
show create table foo;
|
||||
Table Create Table
|
||||
foo CREATE TABLE `foo` (
|
||||
`a` int(11) NOT NULL DEFAULT '0',
|
||||
`b` varchar(100) DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||
show create table bar;
|
||||
Table Create Table
|
||||
bar CREATE TABLE `bar` (
|
||||
`a` int(11) NOT NULL DEFAULT '0',
|
||||
`b` varchar(100) DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
# should be empty
|
||||
select * from foo;
|
||||
a b
|
||||
begin;
|
||||
# should be empty
|
||||
select * from bar;
|
||||
a b
|
||||
begin;
|
||||
# should be empty
|
||||
select * from foo;
|
||||
a b
|
||||
insert into foo values (1,"g");
|
||||
commit;
|
||||
replace into foo values (1,"ga");
|
||||
replace into foo values (1,"gar");
|
||||
replace into foo values (1,"garb");
|
||||
replace into foo values (1,"aaaa");
|
||||
# should have one value
|
||||
select * from foo;
|
||||
a b
|
||||
1 aaaa
|
||||
commit;
|
||||
# should be empty
|
||||
select * from foo;
|
||||
a b
|
||||
commit;
|
||||
# should be empty
|
||||
select * from foo;
|
||||
a b
|
||||
commit;
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo,bar;
|
36
mysql-test/suite/tokudb.mvcc/r/mvcc-26.result
Executable file
36
mysql-test/suite/tokudb.mvcc/r/mvcc-26.result
Executable file
|
@ -0,0 +1,36 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
DROP TABLE IF EXISTS foo;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int);
|
||||
select * from foo;
|
||||
a
|
||||
begin;
|
||||
insert into foo values (1),(2),(3);
|
||||
select * from foo;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
rollback;
|
||||
select * from foo;
|
||||
a
|
||||
optimize table foo;
|
||||
Table Op Msg_type Msg_text
|
||||
test.foo optimize status OK
|
||||
select * from foo;
|
||||
a
|
||||
insert into foo values (1),(2),(3);
|
||||
select * from foo;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
optimize table foo;
|
||||
Table Op Msg_type Msg_text
|
||||
test.foo optimize status OK
|
||||
select * from foo;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
DROP TABLE foo;
|
36
mysql-test/suite/tokudb.mvcc/r/mvcc-27.result
Executable file
36
mysql-test/suite/tokudb.mvcc/r/mvcc-27.result
Executable file
|
@ -0,0 +1,36 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo;
|
||||
create table foo (a int, b varchar(100), primary key (a))engine=TokudB;
|
||||
# should return nothing
|
||||
select * from foo;
|
||||
a b
|
||||
begin;
|
||||
set session transaction isolation level repeatable read;
|
||||
select * from foo;
|
||||
a b
|
||||
replace into foo values (1,"G");
|
||||
replace into foo values (1,"GA");
|
||||
replace into foo values (1,"GAR");
|
||||
replace into foo values (1,"GARB");
|
||||
replace into foo values (1,"GARBA");
|
||||
replace into foo values (1,"GARBAG");
|
||||
replace into foo values (1,"GARBAGE");
|
||||
replace into foo values (1,"a");
|
||||
# should return one element,
|
||||
select * from foo;
|
||||
a b
|
||||
1 a
|
||||
optimize table foo;
|
||||
Table Op Msg_type Msg_text
|
||||
test.foo optimize status OK
|
||||
# should return nothing
|
||||
select * from foo;
|
||||
a b
|
||||
commit;
|
||||
# should return one element,
|
||||
select * from foo;
|
||||
a b
|
||||
1 a
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
29
mysql-test/suite/tokudb.mvcc/r/mvcc-28.result
Executable file
29
mysql-test/suite/tokudb.mvcc/r/mvcc-28.result
Executable file
|
@ -0,0 +1,29 @@
|
|||
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 varchar(10), primary key (a))engine=TokuDB;
|
||||
insert into foo values (1,"a");
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
# should read ONLY (1,"a")
|
||||
select * from foo;
|
||||
a b
|
||||
1 a
|
||||
delete from foo where a=1;
|
||||
insert into foo values (2,"bb");
|
||||
# should read ONLY (2,"bb")
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
2 bb
|
||||
# should read ONLY (1,"a")
|
||||
select * From foo;
|
||||
a b
|
||||
1 a
|
||||
commit;
|
||||
insert into foo values ("101000","asdf");
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
commit;
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
55
mysql-test/suite/tokudb.mvcc/r/mvcc-29.result
Executable file
55
mysql-test/suite/tokudb.mvcc/r/mvcc-29.result
Executable file
|
@ -0,0 +1,55 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo;
|
||||
set session transaction isolation level repeatable read;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int, b int, primary key (a))engine=TokUDB;
|
||||
insert into foo values (1,1),(2,2),(3,3),(4,4),(5,5),(10,10),(20,20),(30,30),(40,40),(50,50);
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
3 3
|
||||
4 4
|
||||
5 5
|
||||
10 10
|
||||
20 20
|
||||
30 30
|
||||
40 40
|
||||
50 50
|
||||
# number of rows should be 9
|
||||
explain select * from foo where a > 1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE foo range PRIMARY PRIMARY 4 NULL 9 Using where
|
||||
delete from foo where a > 5;
|
||||
# number of rows should be 9
|
||||
explain select * from foo where a > 1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE foo range PRIMARY PRIMARY 4 NULL 9 Using where
|
||||
# should have just 4 values
|
||||
select * from foo where a > 1;
|
||||
a b
|
||||
2 2
|
||||
3 3
|
||||
4 4
|
||||
5 5
|
||||
# number of rows should be 9
|
||||
explain select * from foo where a > 1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE foo range PRIMARY PRIMARY 4 NULL 9 Using where
|
||||
# 9 values
|
||||
select * From foo where a > 1;
|
||||
a b
|
||||
2 2
|
||||
3 3
|
||||
4 4
|
||||
5 5
|
||||
10 10
|
||||
20 20
|
||||
30 30
|
||||
40 40
|
||||
50 50
|
||||
commit;
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
45
mysql-test/suite/tokudb.mvcc/r/mvcc-3.result
Executable file
45
mysql-test/suite/tokudb.mvcc/r/mvcc-3.result
Executable file
|
@ -0,0 +1,45 @@
|
|||
set session transaction isolation level repeatable read;
|
||||
SET 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, primary key (a))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,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||
insert into foo values (1,1);
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
replace into foo values (1,100), (2,200);
|
||||
#transaction that did the insert about to read
|
||||
select * from foo;
|
||||
a b
|
||||
1 100
|
||||
2 200
|
||||
#this should read just (1,1)
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
commit;
|
||||
# this should read 2 values, (1,100) and (2,200)
|
||||
select * from foo;
|
||||
a b
|
||||
1 100
|
||||
2 200
|
||||
#this should read just (1,1)
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
commit;
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
55
mysql-test/suite/tokudb.mvcc/r/mvcc-30.result
Executable file
55
mysql-test/suite/tokudb.mvcc/r/mvcc-30.result
Executable file
|
@ -0,0 +1,55 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo;
|
||||
set session transaction isolation level repeatable read;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int, b int, primary key (a))engine=TokUDB;
|
||||
insert into foo values (1,1),(2,2),(3,3),(4,4),(5,5),(10,10),(20,20),(30,30),(40,40),(50,50);
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
3 3
|
||||
4 4
|
||||
5 5
|
||||
10 10
|
||||
20 20
|
||||
30 30
|
||||
40 40
|
||||
50 50
|
||||
# number of rows should be 9
|
||||
explain select * from foo where a < 50;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE foo range PRIMARY PRIMARY 4 NULL 9 Using where
|
||||
delete from foo where a < 10;
|
||||
# number of rows should be 9
|
||||
explain select * from foo where a < 50;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE foo range PRIMARY PRIMARY 4 NULL 9 Using where
|
||||
# should have just 4 values
|
||||
select * from foo where a < 50;
|
||||
a b
|
||||
10 10
|
||||
20 20
|
||||
30 30
|
||||
40 40
|
||||
# number of rows should be 9
|
||||
explain select * from foo where a < 50;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE foo range PRIMARY PRIMARY 4 NULL 9 Using where
|
||||
# 9 values
|
||||
select * From foo where a < 50;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
3 3
|
||||
4 4
|
||||
5 5
|
||||
10 10
|
||||
20 20
|
||||
30 30
|
||||
40 40
|
||||
commit;
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
54
mysql-test/suite/tokudb.mvcc/r/mvcc-31.result
Executable file
54
mysql-test/suite/tokudb.mvcc/r/mvcc-31.result
Executable file
|
@ -0,0 +1,54 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo;
|
||||
set session transaction isolation level repeatable read;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int, b int, primary key (a))engine=TokUDB;
|
||||
insert into foo values (1,1),(2,2),(3,3),(4,4),(5,5),(10,10),(20,20),(30,30),(40,40),(50,50);
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
3 3
|
||||
4 4
|
||||
5 5
|
||||
10 10
|
||||
20 20
|
||||
30 30
|
||||
40 40
|
||||
50 50
|
||||
# number of rows should be 8
|
||||
explain select * from foo where a > 1 and a < 50;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE foo range PRIMARY PRIMARY 4 NULL 8 Using where
|
||||
delete from foo where a = 2 or a = 4 or a = 10 or a = 30 or a = 50;
|
||||
# number of rows should be 8
|
||||
explain select * from foo where a > 1 and a < 50;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE foo range PRIMARY PRIMARY 4 NULL 8 Using where
|
||||
# should have just 4 values
|
||||
select * from foo where a > 1 and a < 50;
|
||||
a b
|
||||
3 3
|
||||
5 5
|
||||
20 20
|
||||
40 40
|
||||
# number of rows should be 8
|
||||
explain select * from foo where a > 1 and a < 50;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE foo range PRIMARY PRIMARY 4 NULL 8 Using where
|
||||
# 8 values
|
||||
select * from foo where a > 1 and a < 50;
|
||||
a b
|
||||
2 2
|
||||
3 3
|
||||
4 4
|
||||
5 5
|
||||
10 10
|
||||
20 20
|
||||
30 30
|
||||
40 40
|
||||
commit;
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
21
mysql-test/suite/tokudb.mvcc/r/mvcc-32.result
Executable file
21
mysql-test/suite/tokudb.mvcc/r/mvcc-32.result
Executable file
|
@ -0,0 +1,21 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
DROP TABLE IF EXISTS foo;
|
||||
create table foo (a int, b int, primary key (a))engine=TokuDB;
|
||||
insert into foo values (1,10),(2,20),(3,30),(4,40),(5,50),(6,60),(7,70),(8,80),(9,90);
|
||||
insert into foo values (10,100),(20,200),(30,300),(40,400),(50,500),(60,600),(70,700),(80,800),(90,900);
|
||||
# row estimate should be 6
|
||||
explain select count(*) from foo where a > 30;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE foo range PRIMARY PRIMARY 4 NULL 6 Using where; Using index
|
||||
select count(*) from foo where a > 30;
|
||||
count(*)
|
||||
6
|
||||
delete from foo where a > 50;
|
||||
# row estimate should be 2
|
||||
explain select count(*) from foo where a > 30;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE foo range PRIMARY PRIMARY 4 NULL 2 Using where; Using index
|
||||
select count(*) from foo where a > 30;
|
||||
count(*)
|
||||
2
|
||||
DROP TABLE foo;
|
63
mysql-test/suite/tokudb.mvcc/r/mvcc-33.result
Executable file
63
mysql-test/suite/tokudb.mvcc/r/mvcc-33.result
Executable file
|
@ -0,0 +1,63 @@
|
|||
SET 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), 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
|
||||
set session transaction isolation level repeatable read;
|
||||
replace into foo values (5,50,555);
|
||||
select * from foo;
|
||||
a b c
|
||||
1 10 100
|
||||
2 20 200
|
||||
3 30 300
|
||||
4 40 400
|
||||
5 50 555
|
||||
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,111111111);
|
||||
# should get (5,50,111111111)
|
||||
select * from foo where b=50;
|
||||
a b c
|
||||
5 50 111111111
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
74
mysql-test/suite/tokudb.mvcc/r/mvcc-34.result
Executable file
74
mysql-test/suite/tokudb.mvcc/r/mvcc-34.result
Executable file
|
@ -0,0 +1,74 @@
|
|||
SET 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), 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 repeatable read;
|
||||
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
|
||||
# should get (5,50,500)
|
||||
select * from foo where b=50;
|
||||
a b c
|
||||
5 50 500
|
||||
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,500)
|
||||
select * from foo where b=50;
|
||||
a b c
|
||||
5 50 500
|
||||
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;
|
74
mysql-test/suite/tokudb.mvcc/r/mvcc-35.result
Executable file
74
mysql-test/suite/tokudb.mvcc/r/mvcc-35.result
Executable file
|
@ -0,0 +1,74 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo;
|
||||
set session transaction isolation level read committed;
|
||||
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 read committed;
|
||||
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
|
||||
# should get (5,50,500)
|
||||
select * from foo where b=50;
|
||||
a b c
|
||||
5 50 500
|
||||
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;
|
73
mysql-test/suite/tokudb.mvcc/r/mvcc-36.result
Executable file
73
mysql-test/suite/tokudb.mvcc/r/mvcc-36.result
Executable file
|
@ -0,0 +1,73 @@
|
|||
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;
|
74
mysql-test/suite/tokudb.mvcc/r/mvcc-37.result
Executable file
74
mysql-test/suite/tokudb.mvcc/r/mvcc-37.result
Executable file
|
@ -0,0 +1,74 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo;
|
||||
set session transaction isolation level read uncommitted;
|
||||
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 read uncommitted;
|
||||
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
|
||||
# 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
|
||||
# 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;
|
44
mysql-test/suite/tokudb.mvcc/r/mvcc-38.result
Executable file
44
mysql-test/suite/tokudb.mvcc/r/mvcc-38.result
Executable file
|
@ -0,0 +1,44 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo, foo_isam;
|
||||
set session transaction isolation level repeatable read;
|
||||
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
|
||||
create table foo_isam (a int, b int, c int) engine=MyISAM;
|
||||
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 grab a read lock on the main table on (5,50,500)
|
||||
insert into foo_isam select * from foo where b=50;
|
||||
# should get (5,50,500)
|
||||
select * From foo_isam;
|
||||
a b c
|
||||
5 50 500
|
||||
set session transaction isolation level repeatable read;
|
||||
# should fail with lock timeout because of read lock grabbed earlier
|
||||
replace into foo values (5, 1,1);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo, foo_isam;
|
28
mysql-test/suite/tokudb.mvcc/r/mvcc-4.result
Executable file
28
mysql-test/suite/tokudb.mvcc/r/mvcc-4.result
Executable file
|
@ -0,0 +1,28 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
set session transaction isolation level repeatable read;
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int, b int, primary key (a))engine=TokuDB;
|
||||
insert into foo values (1,1);
|
||||
show create table foo;
|
||||
Table Create Table
|
||||
foo CREATE TABLE `foo` (
|
||||
`a` int(11) NOT NULL DEFAULT '0',
|
||||
`b` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||
#should read (1,1)
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
begin;
|
||||
replace into foo values (1,100), (2,200);
|
||||
commit;
|
||||
#should read (1,100),(2,200)
|
||||
select * from foo;
|
||||
a b
|
||||
1 100
|
||||
2 200
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
50
mysql-test/suite/tokudb.mvcc/r/mvcc-5.result
Executable file
50
mysql-test/suite/tokudb.mvcc/r/mvcc-5.result
Executable file
|
@ -0,0 +1,50 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
set session transaction isolation level repeatable read;
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo;
|
||||
create table foo (a int, b int, primary key (a))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,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||
insert into foo values (1,1);
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
# Should read just (1,1)
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
set session transaction isolation level read committed;
|
||||
begin;
|
||||
# Should read just (1,1)
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
replace into foo values (1,10),(2,20);
|
||||
# Should read just (1,1)
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
# Should read just (1,10), (2,20)
|
||||
select * from foo;
|
||||
a b
|
||||
1 10
|
||||
2 20
|
||||
replace into foo values (1,100),(2,200),(3,300);
|
||||
# Should read just (1,1)
|
||||
select * from foo;
|
||||
a b
|
||||
1 1
|
||||
commit;
|
||||
# Should read just (1,100), (2,200),(3,300)
|
||||
select * from foo;
|
||||
a b
|
||||
1 100
|
||||
2 200
|
||||
3 300
|
||||
commit;
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
43
mysql-test/suite/tokudb.mvcc/r/mvcc-6.result
Executable file
43
mysql-test/suite/tokudb.mvcc/r/mvcc-6.result
Executable file
|
@ -0,0 +1,43 @@
|
|||
SET 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, 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,
|
||||
PRIMARY KEY (`a`),
|
||||
KEY `b` (`b`)
|
||||
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||
insert into foo values (100,100);
|
||||
begin;
|
||||
insert into foo values (1,100);
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
# should NOT see (1,100)
|
||||
select * from foo;
|
||||
a b
|
||||
100 100
|
||||
# should be empty
|
||||
select * from foo where a=1;
|
||||
a b
|
||||
# should fail with a lock wait timeout
|
||||
insert into foo values (1,1000);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
commit;
|
||||
# should return two values
|
||||
select * from foo;
|
||||
a b
|
||||
1 100
|
||||
100 100
|
||||
# should be empty
|
||||
select * from foo where a=1;
|
||||
a b
|
||||
# should fail with a dup entry
|
||||
insert into foo values (1,1000);
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
commit;
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
40
mysql-test/suite/tokudb.mvcc/r/mvcc-7.result
Executable file
40
mysql-test/suite/tokudb.mvcc/r/mvcc-7.result
Executable file
|
@ -0,0 +1,40 @@
|
|||
SET 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, primary key (a))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,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||
insert into foo values (1,100);
|
||||
select * from foo;
|
||||
a b
|
||||
1 100
|
||||
begin;
|
||||
insert into foo values (100,100);
|
||||
# should see (1,100)
|
||||
select * from foo;
|
||||
a b
|
||||
1 100
|
||||
100 100
|
||||
set session transaction isolation level repeatable read;
|
||||
# should NOT see (1,100)
|
||||
select * from foo;
|
||||
a b
|
||||
1 100
|
||||
# should see (1,100)
|
||||
select * from foo;
|
||||
a b
|
||||
1 100
|
||||
100 100
|
||||
rollback;
|
||||
# should NOT see (1,100)
|
||||
select * from foo;
|
||||
a b
|
||||
1 100
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
29
mysql-test/suite/tokudb.mvcc/r/mvcc-8.result
Executable file
29
mysql-test/suite/tokudb.mvcc/r/mvcc-8.result
Executable file
|
@ -0,0 +1,29 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo, foo_isam;
|
||||
set session transaction isolation level repeatable read;
|
||||
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);
|
||||
create table foo_isam (a int, b int, c int);
|
||||
# should use key b
|
||||
explain select * from foo where b=30;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE foo ref b b 5 const 1 Using where
|
||||
begin;
|
||||
insert into foo_isam select * from foo where b=30;
|
||||
set session transaction isolation level repeatable read;
|
||||
# should get a lock error
|
||||
replace into foo values (3,3,3);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
commit;
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo, foo_isam;
|
67
mysql-test/suite/tokudb.mvcc/r/mvcc-9.result
Executable file
67
mysql-test/suite/tokudb.mvcc/r/mvcc-9.result
Executable file
|
@ -0,0 +1,67 @@
|
|||
SET STORAGE_ENGINE = 'tokudb';
|
||||
# Establish connection conn1 (user = root)
|
||||
DROP TABLE IF EXISTS foo;
|
||||
create table foo (a int, b varchar (100), primary key (a)) engine=TokuDB;
|
||||
show create table foo;
|
||||
Table Create Table
|
||||
foo CREATE TABLE `foo` (
|
||||
`a` int(11) NOT NULL DEFAULT '0',
|
||||
`b` varchar(100) DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=TOKUDB DEFAULT CHARSET=latin1
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
replace into foo values (1, "a");
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 a
|
||||
replace into foo values (1,"ab"), (2, "ab");
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 ab
|
||||
2 ab
|
||||
replace into foo values (1,"abc"),(2,"abc"),(3, "abc");
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 abc
|
||||
2 abc
|
||||
3 abc
|
||||
replace into foo values (1,"abcd"),(2,"abcd"),(3, "abcd"),(4, "abcd");
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
a b
|
||||
1 abcd
|
||||
2 abcd
|
||||
3 abcd
|
||||
4 abcd
|
||||
select * from foo;
|
||||
a b
|
||||
select * from foo;
|
||||
a b
|
||||
1 a
|
||||
select * from foo;
|
||||
a b
|
||||
1 ab
|
||||
2 ab
|
||||
select * from foo;
|
||||
a b
|
||||
1 abc
|
||||
2 abc
|
||||
3 abc
|
||||
select * from foo;
|
||||
a b
|
||||
1 abcd
|
||||
2 abcd
|
||||
3 abcd
|
||||
4 abcd
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
54
mysql-test/suite/tokudb.mvcc/t/2808-read-committed.test
Executable file
54
mysql-test/suite/tokudb.mvcc/t/2808-read-committed.test
Executable file
|
@ -0,0 +1,54 @@
|
|||
# ticket 895 is a query optimization problem with the primary key
|
||||
|
||||
#--source include/have_tokudb.inc
|
||||
--echo # Establish connection conn1 (user = root)
|
||||
connect (conn1,localhost,root,,);
|
||||
SET STORAGE_ENGINE = 'tokudb';
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS foo,foo_isam;
|
||||
--enable_warnings
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level read committed;
|
||||
create table foo ( a int, b int, primary key (a));
|
||||
insert into foo values (1,1),(2,2),(3,1),(4,3);
|
||||
select * from foo;
|
||||
begin;
|
||||
update foo set b=10 where b=1;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
insert into foo values (5,5);
|
||||
|
||||
connection conn1;
|
||||
rollback;
|
||||
select * from foo;
|
||||
begin;
|
||||
delete from foo where b=2;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
insert into foo values (5,5);
|
||||
|
||||
connection conn1;
|
||||
rollback;
|
||||
select * from foo;
|
||||
create table foo_isam (a int, b int)engine=MyISAM;
|
||||
begin;
|
||||
insert into foo_isam select * from foo;
|
||||
|
||||
connection default;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
insert into foo values (5,5);
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo, foo_isam;
|
54
mysql-test/suite/tokudb.mvcc/t/2808-read-uncommitted.test
Executable file
54
mysql-test/suite/tokudb.mvcc/t/2808-read-uncommitted.test
Executable file
|
@ -0,0 +1,54 @@
|
|||
# ticket 895 is a query optimization problem with the primary key
|
||||
|
||||
#--source include/have_tokudb.inc
|
||||
--echo # Establish connection conn1 (user = root)
|
||||
connect (conn1,localhost,root,,);
|
||||
SET STORAGE_ENGINE = 'tokudb';
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS foo,foo_isam;
|
||||
--enable_warnings
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level read uncommitted;
|
||||
create table foo ( a int, b int, primary key (a));
|
||||
insert into foo values (1,1),(2,2),(3,1),(4,3);
|
||||
select * from foo;
|
||||
begin;
|
||||
update foo set b=10 where b=1;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
insert into foo values (5,5);
|
||||
|
||||
connection conn1;
|
||||
rollback;
|
||||
select * from foo;
|
||||
begin;
|
||||
delete from foo where b=2;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
insert into foo values (5,5);
|
||||
|
||||
connection conn1;
|
||||
rollback;
|
||||
select * from foo;
|
||||
create table foo_isam (a int, b int)engine=MyISAM;
|
||||
begin;
|
||||
insert into foo_isam select * from foo;
|
||||
|
||||
connection default;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
insert into foo values (5,5);
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo, foo_isam;
|
24
mysql-test/suite/tokudb.mvcc/t/mvcc-1.test
Executable file
24
mysql-test/suite/tokudb.mvcc/t/mvcc-1.test
Executable file
|
@ -0,0 +1,24 @@
|
|||
# ticket 895 is a query optimization problem with the primary key
|
||||
SET STORAGE_ENGINE = 'tokudb';
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS foo;
|
||||
--enable_warnings
|
||||
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int);
|
||||
select * from foo;
|
||||
begin;
|
||||
insert into foo values (1);
|
||||
select * from foo;
|
||||
rollback;
|
||||
select * from foo;
|
||||
|
||||
set session transaction isolation level read committed;
|
||||
begin;
|
||||
insert into foo values (1);
|
||||
select * from foo;
|
||||
rollback;
|
||||
select * from foo;
|
||||
|
||||
DROP TABLE foo;
|
84
mysql-test/suite/tokudb.mvcc/t/mvcc-10.test
Executable file
84
mysql-test/suite/tokudb.mvcc/t/mvcc-10.test
Executable file
|
@ -0,0 +1,84 @@
|
|||
# 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,,);
|
||||
connect (conn2,localhost,root,,);
|
||||
connect (conn3,localhost,root,,);
|
||||
connect (conn4,localhost,root,,);
|
||||
connect (conn5,localhost,root,,);
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS foo;
|
||||
--enable_warnings
|
||||
|
||||
connection default;
|
||||
create table foo (a int, b varchar (100), primary key (a)) engine=TokuDB;
|
||||
show create table foo;
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
replace into foo values (1, "a");
|
||||
|
||||
connection conn2;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
delete from foo;
|
||||
|
||||
connection conn3;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
replace into foo values (1,"abc");
|
||||
|
||||
connection conn4;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
delete from foo;
|
||||
|
||||
connection conn5;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
select * from foo;
|
||||
|
||||
connection conn2;
|
||||
select * from foo;
|
||||
|
||||
connection conn3;
|
||||
select * from foo;
|
||||
|
||||
connection conn4;
|
||||
select * from foo;
|
||||
|
||||
connection conn5;
|
||||
select * from foo;
|
||||
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
disconnect conn2;
|
||||
disconnect conn3;
|
||||
disconnect conn4;
|
||||
disconnect conn5;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
34
mysql-test/suite/tokudb.mvcc/t/mvcc-11.test
Executable file
34
mysql-test/suite/tokudb.mvcc/t/mvcc-11.test
Executable file
|
@ -0,0 +1,34 @@
|
|||
# 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);
|
||||
begin;
|
||||
insert into foo values (2);
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level serializable;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
select * from foo;
|
||||
set session transaction isolation level read uncommitted;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
commit;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
42
mysql-test/suite/tokudb.mvcc/t/mvcc-12.test
Executable file
42
mysql-test/suite/tokudb.mvcc/t/mvcc-12.test
Executable file
|
@ -0,0 +1,42 @@
|
|||
# simple serializable test
|
||||
|
||||
#--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;
|
||||
set session transaction isolation level serializable;
|
||||
create table foo (a int) engine=TokuDB;
|
||||
show create table foo;
|
||||
insert into foo values (1);
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level serializable;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
insert into foo values (3);
|
||||
set session transaction isolation level repeatable read;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
insert into foo values (3);
|
||||
set session transaction isolation level read committed;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
insert into foo values (3);
|
||||
set session transaction isolation level read uncommitted;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
insert into foo values (3);
|
||||
|
||||
connection default;
|
||||
commit;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
35
mysql-test/suite/tokudb.mvcc/t/mvcc-13.test
Executable file
35
mysql-test/suite/tokudb.mvcc/t/mvcc-13.test
Executable file
|
@ -0,0 +1,35 @@
|
|||
# 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,foo1;
|
||||
--enable_warnings
|
||||
|
||||
connection default;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int) engine=TokuDB;
|
||||
show create table foo;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo1(a int) engine=TokuDB;
|
||||
insert into foo1 values(1);
|
||||
|
||||
connection default;
|
||||
--error ER_TABLE_DEF_CHANGED
|
||||
select * from foo1;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo,foo1;
|
34
mysql-test/suite/tokudb.mvcc/t/mvcc-14.test
Executable file
34
mysql-test/suite/tokudb.mvcc/t/mvcc-14.test
Executable file
|
@ -0,0 +1,34 @@
|
|||
# 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,foo1;
|
||||
--enable_warnings
|
||||
|
||||
connection default;
|
||||
set session transaction isolation level read uncommitted;
|
||||
create table foo (a int) engine=TokuDB;
|
||||
show create table foo;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo1(a int) engine=TokuDB;
|
||||
insert into foo1 values(1);
|
||||
|
||||
connection default;
|
||||
select * from foo1;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo,foo1;
|
34
mysql-test/suite/tokudb.mvcc/t/mvcc-15.test
Executable file
34
mysql-test/suite/tokudb.mvcc/t/mvcc-15.test
Executable file
|
@ -0,0 +1,34 @@
|
|||
# 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,foo1;
|
||||
--enable_warnings
|
||||
|
||||
connection default;
|
||||
set session transaction isolation level serializable;
|
||||
create table foo (a int) engine=TokuDB;
|
||||
show create table foo;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo1(a int) engine=TokuDB;
|
||||
insert into foo1 values(1);
|
||||
|
||||
connection default;
|
||||
select * from foo1;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo,foo1;
|
45
mysql-test/suite/tokudb.mvcc/t/mvcc-16.test
Executable file
45
mysql-test/suite/tokudb.mvcc/t/mvcc-16.test
Executable file
|
@ -0,0 +1,45 @@
|
|||
# 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,foo1;
|
||||
--enable_warnings
|
||||
|
||||
connection default;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int) engine=TokuDB;
|
||||
show create table foo;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo1(a int, b int, c int, primary key (a)) engine=TokuDB;
|
||||
insert into foo1 values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500);
|
||||
|
||||
connection default;
|
||||
--error ER_TABLE_DEF_CHANGED
|
||||
select a from foo1;
|
||||
--error ER_TABLE_DEF_CHANGED
|
||||
select a from foo1 order by a desc;
|
||||
--error ER_TABLE_DEF_CHANGED
|
||||
select * from foo1 where a=3;
|
||||
--error ER_TABLE_DEF_CHANGED
|
||||
select * from foo1 where a>3;
|
||||
--error ER_TABLE_DEF_CHANGED
|
||||
select * from foo1 where a>3 order by a desc;
|
||||
--error ER_TABLE_DEF_CHANGED
|
||||
select * from foo1;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo,foo1;
|
54
mysql-test/suite/tokudb.mvcc/t/mvcc-17.test
Executable file
54
mysql-test/suite/tokudb.mvcc/t/mvcc-17.test
Executable file
|
@ -0,0 +1,54 @@
|
|||
# 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;
|
||||
set session tokudb_load_save_space=0;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int)engine=TokuDB;
|
||||
show create table foo;
|
||||
|
||||
connection conn1;
|
||||
set session tokudb_load_save_space=0;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
begin;
|
||||
insert into foo values (1),(2),(3);
|
||||
--echo # should return 1,2,3
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
--echo # should be empty
|
||||
select * from foo;
|
||||
--echo # verify that a bulk load was done, by trying to insert and fail due to ER_LOCK_WAIT_TIMEOUT
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
insert into foo values (10000);
|
||||
commit;
|
||||
|
||||
connection default;
|
||||
commit;
|
||||
|
||||
connection conn1;
|
||||
--echo # should see 1,2,3
|
||||
select * from foo;
|
||||
|
||||
|
||||
connection default;
|
||||
commit;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
54
mysql-test/suite/tokudb.mvcc/t/mvcc-18.test
Executable file
54
mysql-test/suite/tokudb.mvcc/t/mvcc-18.test
Executable file
|
@ -0,0 +1,54 @@
|
|||
# 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;
|
||||
set session tokudb_load_save_space=1;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int)engine=TokuDB;
|
||||
show create table foo;
|
||||
|
||||
connection conn1;
|
||||
set session tokudb_load_save_space=1;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
begin;
|
||||
insert into foo values (1),(2),(3);
|
||||
--echo # should return 1,2,3
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
--echo # should be empty
|
||||
select * from foo;
|
||||
--echo # verify that a bulk load was done, by trying to insert and fail due to ER_LOCK_WAIT_TIMEOUT
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
insert into foo values (10000);
|
||||
commit;
|
||||
|
||||
connection default;
|
||||
commit;
|
||||
|
||||
connection conn1;
|
||||
--echo # should see 1,2,3
|
||||
select * from foo;
|
||||
|
||||
|
||||
connection default;
|
||||
commit;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
42
mysql-test/suite/tokudb.mvcc/t/mvcc-19.test
Executable file
42
mysql-test/suite/tokudb.mvcc/t/mvcc-19.test
Executable file
|
@ -0,0 +1,42 @@
|
|||
# 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;
|
||||
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;
|
||||
--echo # should read all four values
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
set session tokudb_load_save_space=0;
|
||||
alter table foo add index (b);
|
||||
|
||||
connection default;
|
||||
--echo # should read all four values
|
||||
select * from foo;
|
||||
--echo # should fail
|
||||
--error ER_TABLE_DEF_CHANGED
|
||||
select sum(b) from foo;
|
||||
commit;
|
||||
--echo # should return 100
|
||||
select sum(b) from foo;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
39
mysql-test/suite/tokudb.mvcc/t/mvcc-2.test
Executable file
39
mysql-test/suite/tokudb.mvcc/t/mvcc-2.test
Executable file
|
@ -0,0 +1,39 @@
|
|||
# test simple MVCC, that a transaction does not read something committed after it
|
||||
|
||||
#--source include/have_tokudb.inc
|
||||
SET STORAGE_ENGINE = 'tokudb';
|
||||
set session transaction isolation level repeatable read;
|
||||
|
||||
--echo # Establish connection conn1 (user = root)
|
||||
connect (conn1,localhost,root,,);
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS foo;
|
||||
--enable_warnings
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int) engine=TokuDB;
|
||||
insert into foo values (1);
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
insert into foo values (1000000);
|
||||
|
||||
connection conn1;
|
||||
select * From foo;
|
||||
|
||||
connection default;
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
commit;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
42
mysql-test/suite/tokudb.mvcc/t/mvcc-20.test
Executable file
42
mysql-test/suite/tokudb.mvcc/t/mvcc-20.test
Executable file
|
@ -0,0 +1,42 @@
|
|||
# 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;
|
||||
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;
|
||||
--echo # should read all four values
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
set session tokudb_load_save_space=1;
|
||||
alter table foo add index (b);
|
||||
|
||||
connection default;
|
||||
--echo # should read all four values
|
||||
select * from foo;
|
||||
--echo # should fail
|
||||
--error ER_TABLE_DEF_CHANGED
|
||||
select sum(b) from foo;
|
||||
commit;
|
||||
--echo # should return 100
|
||||
select sum(b) from foo;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
95
mysql-test/suite/tokudb.mvcc/t/mvcc-21.test
Executable file
95
mysql-test/suite/tokudb.mvcc/t/mvcc-21.test
Executable file
|
@ -0,0 +1,95 @@
|
|||
# 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,,);
|
||||
connect (conn2,localhost,root,,);
|
||||
connect (conn3,localhost,root,,);
|
||||
connect (conn4,localhost,root,,);
|
||||
connect (conn5,localhost,root,,);
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS foo;
|
||||
--enable_warnings
|
||||
|
||||
connection default;
|
||||
create table foo (a int, b varchar (100), primary key (a)) engine=TokuDB;
|
||||
show create table foo;
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
replace into foo values (1, "a");
|
||||
|
||||
connection conn2;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
replace into foo values (1,"abGARBAGE"), (2, "abGARBAGE");
|
||||
replace into foo values (1,"ab"), (2, "ab");
|
||||
|
||||
connection conn3;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
replace into foo values (1,"abcGARBAGE"),(2,"abcGARBAGE"),(3, "abcGARBAGE");
|
||||
replace into foo values (1,"abc"),(2,"abc"),(3, "abc");
|
||||
|
||||
connection conn4;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
replace into foo values (1,"abcdGARBAGE"),(2,"abcdGARBAGE"),(3, "abcdGARBAGE"),(4, "abcdGARBAGE");
|
||||
replace into foo values (1,"abcd"),(2,"abcd"),(3, "abcd"),(4, "abcd");
|
||||
|
||||
connection conn5;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
connection conn2;
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
connection conn3;
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
connection conn4;
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
connection conn5;
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
|
||||
connection default;
|
||||
select * from foo;
|
||||
replace into foo values (1,"1"),(2,"2"),(3,"3"),(4,"4");
|
||||
select * from foo;
|
||||
disconnect conn1;
|
||||
disconnect conn2;
|
||||
disconnect conn3;
|
||||
disconnect conn4;
|
||||
disconnect conn5;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
96
mysql-test/suite/tokudb.mvcc/t/mvcc-22.test
Executable file
96
mysql-test/suite/tokudb.mvcc/t/mvcc-22.test
Executable file
|
@ -0,0 +1,96 @@
|
|||
# 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,,);
|
||||
connect (conn2,localhost,root,,);
|
||||
connect (conn3,localhost,root,,);
|
||||
connect (conn4,localhost,root,,);
|
||||
connect (conn5,localhost,root,,);
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS foo;
|
||||
--enable_warnings
|
||||
|
||||
connection default;
|
||||
create table foo (a int, b varchar (100), primary key (a)) engine=TokuDB;
|
||||
show create table foo;
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
replace into foo values (1,"aGARBAGE");
|
||||
replace into foo values (1, "a");
|
||||
|
||||
connection conn2;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
replace into foo values (1,"abGARBAGE");
|
||||
replace into foo values (1,"ab");
|
||||
|
||||
connection conn3;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
replace into foo values (1,"abcGARBAGE");
|
||||
replace into foo values (1,"abc");
|
||||
|
||||
connection conn4;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
replace into foo values (1,"abcdGARBAGE");
|
||||
replace into foo values (1,"abcd");
|
||||
|
||||
connection conn5;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
connection conn2;
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
connection conn3;
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
connection conn4;
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
connection conn5;
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
|
||||
connection default;
|
||||
select * from foo;
|
||||
replace into foo values (1,"1");
|
||||
select * from foo;
|
||||
disconnect conn1;
|
||||
disconnect conn2;
|
||||
disconnect conn3;
|
||||
disconnect conn4;
|
||||
disconnect conn5;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
92
mysql-test/suite/tokudb.mvcc/t/mvcc-23.test
Executable file
92
mysql-test/suite/tokudb.mvcc/t/mvcc-23.test
Executable file
|
@ -0,0 +1,92 @@
|
|||
# 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,,);
|
||||
connect (conn2,localhost,root,,);
|
||||
connect (conn3,localhost,root,,);
|
||||
connect (conn4,localhost,root,,);
|
||||
connect (conn5,localhost,root,,);
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS foo;
|
||||
--enable_warnings
|
||||
|
||||
connection default;
|
||||
create table foo (a int, b varchar (100), primary key (a)) engine=TokuDB;
|
||||
show create table foo;
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
replace into foo values (1, "aGARBAGE");
|
||||
replace into foo values (1, "a");
|
||||
|
||||
connection conn2;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
replace into foo values (1, "delete1Garbage");
|
||||
delete from foo;
|
||||
|
||||
connection conn3;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
replace into foo values (1,"abcGARBAGE");
|
||||
replace into foo values (1,"abc");
|
||||
|
||||
connection conn4;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
delete from foo;
|
||||
|
||||
connection conn5;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
connection conn2;
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
connection conn3;
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
connection conn4;
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
connection conn5;
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
disconnect conn2;
|
||||
disconnect conn3;
|
||||
disconnect conn4;
|
||||
disconnect conn5;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
54
mysql-test/suite/tokudb.mvcc/t/mvcc-24.test
Executable file
54
mysql-test/suite/tokudb.mvcc/t/mvcc-24.test
Executable file
|
@ -0,0 +1,54 @@
|
|||
# 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,,);
|
||||
connect (conn2,localhost,root,,);
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS foo;
|
||||
--enable_warnings
|
||||
|
||||
connection default;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int, b varchar (100), primary key (a))engine=TokuDB;
|
||||
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
--echo # should return nothing
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
insert into foo values (1, "G");
|
||||
replace into foo values (1, "Ga");
|
||||
replace into foo values (1, "Gar");
|
||||
replace into foo values (1, "Garb");
|
||||
replace into foo values (1, "Garba");
|
||||
replace into foo values (1, "a");
|
||||
|
||||
connection conn2;
|
||||
begin;
|
||||
--echo # Should read (1, "a")
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
--echo # Should be empty
|
||||
select * from foo;
|
||||
|
||||
connection conn2;
|
||||
commit;
|
||||
connection conn1;
|
||||
commit;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
disconnect conn2;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
69
mysql-test/suite/tokudb.mvcc/t/mvcc-25.test
Executable file
69
mysql-test/suite/tokudb.mvcc/t/mvcc-25.test
Executable file
|
@ -0,0 +1,69 @@
|
|||
# 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,,);
|
||||
connect (conn2,localhost,root,,);
|
||||
connect (conn3,localhost,root,,);
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS foo,bar;
|
||||
--enable_warnings
|
||||
|
||||
connection default;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int, b varchar (100), primary key (a))engine=TokuDB;
|
||||
create table bar like foo;
|
||||
show create table foo;
|
||||
show create table bar;
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
--echo # should be empty
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
begin;
|
||||
--echo # should be empty
|
||||
select * from bar;
|
||||
|
||||
connection conn2;
|
||||
begin;
|
||||
--echo # should be empty
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
insert into foo values (1,"g");
|
||||
commit;
|
||||
replace into foo values (1,"ga");
|
||||
replace into foo values (1,"gar");
|
||||
replace into foo values (1,"garb");
|
||||
replace into foo values (1,"aaaa");
|
||||
|
||||
connection conn3;
|
||||
--echo # should have one value
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
connection conn2;
|
||||
--echo # should be empty
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
connection conn1;
|
||||
--echo # should be empty
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
disconnect conn2;
|
||||
disconnect conn3;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo,bar;
|
23
mysql-test/suite/tokudb.mvcc/t/mvcc-26.test
Executable file
23
mysql-test/suite/tokudb.mvcc/t/mvcc-26.test
Executable file
|
@ -0,0 +1,23 @@
|
|||
# ticket 895 is a query optimization problem with the primary key
|
||||
SET STORAGE_ENGINE = 'tokudb';
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS foo;
|
||||
--enable_warnings
|
||||
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int);
|
||||
select * from foo;
|
||||
begin;
|
||||
insert into foo values (1),(2),(3);
|
||||
select * from foo;
|
||||
rollback;
|
||||
select * from foo;
|
||||
optimize table foo;
|
||||
select * from foo;
|
||||
insert into foo values (1),(2),(3);
|
||||
select * from foo;
|
||||
optimize table foo;
|
||||
select * from foo;
|
||||
|
||||
DROP TABLE foo;
|
52
mysql-test/suite/tokudb.mvcc/t/mvcc-27.test
Executable file
52
mysql-test/suite/tokudb.mvcc/t/mvcc-27.test
Executable file
|
@ -0,0 +1,52 @@
|
|||
# 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, b varchar(100), primary key (a))engine=TokudB;
|
||||
--echo # should return nothing
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
begin;
|
||||
set session transaction isolation level repeatable read;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
replace into foo values (1,"G");
|
||||
replace into foo values (1,"GA");
|
||||
replace into foo values (1,"GAR");
|
||||
replace into foo values (1,"GARB");
|
||||
replace into foo values (1,"GARBA");
|
||||
replace into foo values (1,"GARBAG");
|
||||
replace into foo values (1,"GARBAGE");
|
||||
replace into foo values (1,"a");
|
||||
--echo # should return one element,
|
||||
select * from foo;
|
||||
|
||||
optimize table foo;
|
||||
|
||||
connection conn1;
|
||||
--echo # should return nothing
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
connection default;
|
||||
--echo # should return one element,
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
46
mysql-test/suite/tokudb.mvcc/t/mvcc-28.test
Executable file
46
mysql-test/suite/tokudb.mvcc/t/mvcc-28.test
Executable file
|
@ -0,0 +1,46 @@
|
|||
# verify that serializable properly reads provisional delete and actual value
|
||||
|
||||
#--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;
|
||||
set session transaction isolation level serializable;
|
||||
create table foo (a int, b varchar(10), primary key (a))engine=TokuDB;
|
||||
insert into foo values (1,"a");
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
--echo # should read ONLY (1,"a")
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
delete from foo where a=1;
|
||||
insert into foo values (2,"bb");
|
||||
--echo # should read ONLY (2,"bb")
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
--echo # should read ONLY (1,"a")
|
||||
select * From foo;
|
||||
commit;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
insert into foo values ("101000","asdf");
|
||||
|
||||
connection default;
|
||||
commit;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
47
mysql-test/suite/tokudb.mvcc/t/mvcc-29.test
Executable file
47
mysql-test/suite/tokudb.mvcc/t/mvcc-29.test
Executable file
|
@ -0,0 +1,47 @@
|
|||
# simple keyrange64 test, ensure that it reads number of leafentries in the system
|
||||
|
||||
#--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 conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
|
||||
connection default;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int, b int, primary key (a))engine=TokUDB;
|
||||
insert into foo values (1,1),(2,2),(3,3),(4,4),(5,5),(10,10),(20,20),(30,30),(40,40),(50,50);
|
||||
|
||||
connection conn1;
|
||||
begin;
|
||||
select * from foo;
|
||||
--echo # number of rows should be 9
|
||||
explain select * from foo where a > 1;
|
||||
|
||||
connection default;
|
||||
delete from foo where a > 5;
|
||||
--echo # number of rows should be 9
|
||||
explain select * from foo where a > 1;
|
||||
--echo # should have just 4 values
|
||||
select * from foo where a > 1;
|
||||
|
||||
connection conn1;
|
||||
--echo # number of rows should be 9
|
||||
explain select * from foo where a > 1;
|
||||
--echo # 9 values
|
||||
select * From foo where a > 1;
|
||||
commit;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
51
mysql-test/suite/tokudb.mvcc/t/mvcc-3.test
Executable file
51
mysql-test/suite/tokudb.mvcc/t/mvcc-3.test
Executable file
|
@ -0,0 +1,51 @@
|
|||
# test simple mvcc, that a transaction does not read a transaction's element that was live when it began
|
||||
|
||||
set session transaction isolation level repeatable read;
|
||||
#--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 conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int, b int, primary key (a))engine=TokuDB;
|
||||
show create table foo;
|
||||
insert into foo values (1,1);
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
replace into foo values (1,100), (2,200);
|
||||
--echo #transaction that did the insert about to read
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
--echo #this should read just (1,1)
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
commit;
|
||||
--echo # this should read 2 values, (1,100) and (2,200)
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
--echo #this should read just (1,1)
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
47
mysql-test/suite/tokudb.mvcc/t/mvcc-30.test
Executable file
47
mysql-test/suite/tokudb.mvcc/t/mvcc-30.test
Executable file
|
@ -0,0 +1,47 @@
|
|||
# simple keyrange64 test, ensure that it reads number of leafentries in the system
|
||||
|
||||
#--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 conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
|
||||
connection default;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int, b int, primary key (a))engine=TokUDB;
|
||||
insert into foo values (1,1),(2,2),(3,3),(4,4),(5,5),(10,10),(20,20),(30,30),(40,40),(50,50);
|
||||
|
||||
connection conn1;
|
||||
begin;
|
||||
select * from foo;
|
||||
--echo # number of rows should be 9
|
||||
explain select * from foo where a < 50;
|
||||
|
||||
connection default;
|
||||
delete from foo where a < 10;
|
||||
--echo # number of rows should be 9
|
||||
explain select * from foo where a < 50;
|
||||
--echo # should have just 4 values
|
||||
select * from foo where a < 50;
|
||||
|
||||
connection conn1;
|
||||
--echo # number of rows should be 9
|
||||
explain select * from foo where a < 50;
|
||||
--echo # 9 values
|
||||
select * From foo where a < 50;
|
||||
commit;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
47
mysql-test/suite/tokudb.mvcc/t/mvcc-31.test
Executable file
47
mysql-test/suite/tokudb.mvcc/t/mvcc-31.test
Executable file
|
@ -0,0 +1,47 @@
|
|||
# simple keyrange64 test, ensure that it reads number of leafentries in the system
|
||||
|
||||
#--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 conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
|
||||
connection default;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int, b int, primary key (a))engine=TokUDB;
|
||||
insert into foo values (1,1),(2,2),(3,3),(4,4),(5,5),(10,10),(20,20),(30,30),(40,40),(50,50);
|
||||
|
||||
connection conn1;
|
||||
begin;
|
||||
select * from foo;
|
||||
--echo # number of rows should be 8
|
||||
explain select * from foo where a > 1 and a < 50;
|
||||
|
||||
connection default;
|
||||
delete from foo where a = 2 or a = 4 or a = 10 or a = 30 or a = 50;
|
||||
--echo # number of rows should be 8
|
||||
explain select * from foo where a > 1 and a < 50;
|
||||
--echo # should have just 4 values
|
||||
select * from foo where a > 1 and a < 50;
|
||||
|
||||
connection conn1;
|
||||
--echo # number of rows should be 8
|
||||
explain select * from foo where a > 1 and a < 50;
|
||||
--echo # 8 values
|
||||
select * from foo where a > 1 and a < 50;
|
||||
commit;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
22
mysql-test/suite/tokudb.mvcc/t/mvcc-32.test
Executable file
22
mysql-test/suite/tokudb.mvcc/t/mvcc-32.test
Executable file
|
@ -0,0 +1,22 @@
|
|||
# tests that deletes are cleaned by verifying that row estimate goes down
|
||||
SET STORAGE_ENGINE = 'tokudb';
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS foo;
|
||||
--enable_warnings
|
||||
|
||||
create table foo (a int, b int, primary key (a))engine=TokuDB;
|
||||
insert into foo values (1,10),(2,20),(3,30),(4,40),(5,50),(6,60),(7,70),(8,80),(9,90);
|
||||
insert into foo values (10,100),(20,200),(30,300),(40,400),(50,500),(60,600),(70,700),(80,800),(90,900);
|
||||
--echo # row estimate should be 6
|
||||
explain select count(*) from foo where a > 30;
|
||||
select count(*) from foo where a > 30;
|
||||
|
||||
delete from foo where a > 50;
|
||||
|
||||
--echo # row estimate should be 2
|
||||
explain select count(*) from foo where a > 30;
|
||||
select count(*) from foo where a > 30;
|
||||
|
||||
|
||||
DROP TABLE foo;
|
45
mysql-test/suite/tokudb.mvcc/t/mvcc-33.test
Executable file
45
mysql-test/suite/tokudb.mvcc/t/mvcc-33.test
Executable file
|
@ -0,0 +1,45 @@
|
|||
# verify a db_get sees data that transaction inserted, and that it does not read data that is too new
|
||||
|
||||
#--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;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int, b int, c int, primary key (a), key (b))engine=TokuDB;
|
||||
show create table foo;
|
||||
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;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,500)
|
||||
select * from foo where b=50;
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
replace into foo values (5,50,555);
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,500)
|
||||
select * from foo where b=50;
|
||||
replace into foo values (5,50,111111111);
|
||||
--echo # should get (5,50,111111111)
|
||||
select * from foo where b=50;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
58
mysql-test/suite/tokudb.mvcc/t/mvcc-34.test
Executable file
58
mysql-test/suite/tokudb.mvcc/t/mvcc-34.test
Executable file
|
@ -0,0 +1,58 @@
|
|||
# verify a db_get does not read a transaction's data because it is in live list
|
||||
|
||||
#--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;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int, b int, c int, primary key (a), key (b))engine=TokuDB;
|
||||
show create table foo;
|
||||
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;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,500)
|
||||
select * from foo where b=50;
|
||||
replace into foo values (5,50,1515);
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,500)
|
||||
select * from foo where b=50;
|
||||
|
||||
connection default;
|
||||
commit;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,1515)
|
||||
select * from foo where b=50;
|
||||
|
||||
connection conn1;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,500)
|
||||
select * from foo where b=50;
|
||||
commit;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,1515)
|
||||
select * from foo where b=50;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
58
mysql-test/suite/tokudb.mvcc/t/mvcc-35.test
Executable file
58
mysql-test/suite/tokudb.mvcc/t/mvcc-35.test
Executable file
|
@ -0,0 +1,58 @@
|
|||
# verify a db_get does not read a read committed transaction's data because it is in live list
|
||||
|
||||
#--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;
|
||||
set session transaction isolation level read committed;
|
||||
create table foo (a int, b int, c int, primary key (a), key (b))engine=TokuDB;
|
||||
show create table foo;
|
||||
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;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,500)
|
||||
select * from foo where b=50;
|
||||
replace into foo values (5,50,1515);
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level read committed;
|
||||
begin;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,500)
|
||||
select * from foo where b=50;
|
||||
|
||||
connection default;
|
||||
commit;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,1515)
|
||||
select * from foo where b=50;
|
||||
|
||||
connection conn1;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,1515)
|
||||
select * from foo where b=50;
|
||||
commit;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,1515)
|
||||
select * from foo where b=50;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
59
mysql-test/suite/tokudb.mvcc/t/mvcc-36.test
Executable file
59
mysql-test/suite/tokudb.mvcc/t/mvcc-36.test
Executable file
|
@ -0,0 +1,59 @@
|
|||
# verify a db_get does not read a read committed transaction's data because it is in live list
|
||||
|
||||
#--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;
|
||||
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;
|
||||
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;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,500)
|
||||
select * from foo where b=50;
|
||||
replace into foo values (5,50,1515);
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level serializable;
|
||||
begin;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # timeout
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
select * from foo where b=50;
|
||||
|
||||
connection default;
|
||||
commit;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,1515)
|
||||
select * from foo where b=50;
|
||||
|
||||
connection conn1;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,1515)
|
||||
select * from foo where b=50;
|
||||
commit;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,1515)
|
||||
select * from foo where b=50;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
58
mysql-test/suite/tokudb.mvcc/t/mvcc-37.test
Executable file
58
mysql-test/suite/tokudb.mvcc/t/mvcc-37.test
Executable file
|
@ -0,0 +1,58 @@
|
|||
# verify a db_get does not read a read committed transaction's data because it is in live list
|
||||
|
||||
#--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;
|
||||
set session transaction isolation level read uncommitted;
|
||||
create table foo (a int, b int, c int, primary key (a), key (b))engine=TokuDB;
|
||||
show create table foo;
|
||||
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;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,500)
|
||||
select * from foo where b=50;
|
||||
replace into foo values (5,50,1515);
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level read uncommitted;
|
||||
begin;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,1515)
|
||||
select * from foo where b=50;
|
||||
|
||||
connection default;
|
||||
commit;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,1515)
|
||||
select * from foo where b=50;
|
||||
|
||||
connection conn1;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,1515)
|
||||
select * from foo where b=50;
|
||||
commit;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should get (5,50,1515)
|
||||
select * from foo where b=50;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
41
mysql-test/suite/tokudb.mvcc/t/mvcc-38.test
Executable file
41
mysql-test/suite/tokudb.mvcc/t/mvcc-38.test
Executable file
|
@ -0,0 +1,41 @@
|
|||
# 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, foo_isam;
|
||||
--enable_warnings
|
||||
|
||||
connection default;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int, b int, c int, primary key (a), key (b))engine=TokUDB;
|
||||
show create table foo;
|
||||
create table foo_isam (a int, b int, c int) engine=MyISAM;
|
||||
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;
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=50;
|
||||
--echo # should grab a read lock on the main table on (5,50,500)
|
||||
insert into foo_isam select * from foo where b=50;
|
||||
--echo # should get (5,50,500)
|
||||
select * From foo_isam;
|
||||
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
--echo # should fail with lock timeout because of read lock grabbed earlier
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
replace into foo values (5, 1,1);
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo, foo_isam;
|
35
mysql-test/suite/tokudb.mvcc/t/mvcc-4.test
Executable file
35
mysql-test/suite/tokudb.mvcc/t/mvcc-4.test
Executable file
|
@ -0,0 +1,35 @@
|
|||
# test that we read data that was committed before we began
|
||||
|
||||
#--source include/have_tokudb.inc
|
||||
SET STORAGE_ENGINE = 'tokudb';
|
||||
set session transaction isolation level repeatable read;
|
||||
|
||||
--echo # Establish connection conn1 (user = root)
|
||||
connect (conn1,localhost,root,,);
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS foo;
|
||||
--enable_warnings
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int, b int, primary key (a))engine=TokuDB;
|
||||
insert into foo values (1,1);
|
||||
show create table foo;
|
||||
--echo #should read (1,1)
|
||||
select * from foo;
|
||||
begin;
|
||||
replace into foo values (1,100), (2,200);
|
||||
commit;
|
||||
|
||||
connection default;
|
||||
--echo #should read (1,100),(2,200)
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
62
mysql-test/suite/tokudb.mvcc/t/mvcc-5.test
Executable file
62
mysql-test/suite/tokudb.mvcc/t/mvcc-5.test
Executable file
|
@ -0,0 +1,62 @@
|
|||
# verify that repeatable read uses one snapshot, whereas read committed keeps taking new ones
|
||||
|
||||
#--source include/have_tokudb.inc
|
||||
SET STORAGE_ENGINE = 'tokudb';
|
||||
set session transaction isolation level repeatable read;
|
||||
|
||||
--echo # Establish connection conn1 (user = root)
|
||||
connect (conn1,localhost,root,,);
|
||||
connect (conn2,localhost,root,,);
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS foo;
|
||||
--enable_warnings
|
||||
|
||||
create table foo (a int, b int, primary key (a))engine=TokuDB;
|
||||
show create table foo;
|
||||
insert into foo values (1,1);
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
--echo # Should read just (1,1)
|
||||
select * from foo;
|
||||
|
||||
connection conn2;
|
||||
set session transaction isolation level read committed;
|
||||
begin;
|
||||
--echo # Should read just (1,1)
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
replace into foo values (1,10),(2,20);
|
||||
|
||||
connection conn1;
|
||||
--echo # Should read just (1,1)
|
||||
select * from foo;
|
||||
|
||||
connection conn2;
|
||||
--echo # Should read just (1,10), (2,20)
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
replace into foo values (1,100),(2,200),(3,300);
|
||||
|
||||
connection conn1;
|
||||
--echo # Should read just (1,1)
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
connection conn2;
|
||||
--echo # Should read just (1,100), (2,200),(3,300)
|
||||
select * from foo;
|
||||
commit;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
disconnect conn2;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
52
mysql-test/suite/tokudb.mvcc/t/mvcc-6.test
Executable file
52
mysql-test/suite/tokudb.mvcc/t/mvcc-6.test
Executable file
|
@ -0,0 +1,52 @@
|
|||
# make sure reads done during writes take read locks
|
||||
|
||||
#--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;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int, b int, primary key (a), key (b))engine=TokuDB;
|
||||
show create table foo;
|
||||
insert into foo values (100,100);
|
||||
begin;
|
||||
insert into foo values (1,100);
|
||||
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
--echo # should NOT see (1,100)
|
||||
select * from foo;
|
||||
--echo # should be empty
|
||||
select * from foo where a=1;
|
||||
--echo # should fail with a lock wait timeout
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
insert into foo values (1,1000);
|
||||
|
||||
connection default;
|
||||
commit;
|
||||
--echo # should return two values
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
--echo # should be empty
|
||||
select * from foo where a=1;
|
||||
--echo # should fail with a dup entry
|
||||
--error ER_DUP_ENTRY
|
||||
insert into foo values (1,1000);
|
||||
commit;
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
41
mysql-test/suite/tokudb.mvcc/t/mvcc-7.test
Executable file
41
mysql-test/suite/tokudb.mvcc/t/mvcc-7.test
Executable file
|
@ -0,0 +1,41 @@
|
|||
# make sure reads done during writes take read locks
|
||||
|
||||
#--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;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo (a int, b int, primary key (a))engine=TokuDB;
|
||||
show create table foo;
|
||||
insert into foo values (1,100);
|
||||
select * from foo;
|
||||
begin;
|
||||
insert into foo values (100,100);
|
||||
--echo # should see (1,100)
|
||||
select * from foo;
|
||||
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
--echo # should NOT see (1,100)
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
--echo # should see (1,100)
|
||||
select * from foo;
|
||||
rollback;
|
||||
--echo # should NOT see (1,100)
|
||||
select * from foo;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
37
mysql-test/suite/tokudb.mvcc/t/mvcc-8.test
Executable file
37
mysql-test/suite/tokudb.mvcc/t/mvcc-8.test
Executable file
|
@ -0,0 +1,37 @@
|
|||
# verify that serializable get of a repeatable read transaction grabs read lock
|
||||
|
||||
#--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, foo_isam;
|
||||
--enable_warnings
|
||||
|
||||
connection default;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table foo ( a int, b int, c int, primary key (a), key (b))engine=TokuDB;
|
||||
show create table foo;
|
||||
insert into foo values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500);
|
||||
create table foo_isam (a int, b int, c int);
|
||||
--echo # should use key b
|
||||
explain select * from foo where b=30;
|
||||
begin;
|
||||
insert into foo_isam select * from foo where b=30;
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
--echo # should get a lock error
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
replace into foo values (3,3,3);
|
||||
|
||||
connection default;
|
||||
commit;
|
||||
disconnect conn1;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo, foo_isam;
|
84
mysql-test/suite/tokudb.mvcc/t/mvcc-9.test
Executable file
84
mysql-test/suite/tokudb.mvcc/t/mvcc-9.test
Executable file
|
@ -0,0 +1,84 @@
|
|||
# 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,,);
|
||||
connect (conn2,localhost,root,,);
|
||||
connect (conn3,localhost,root,,);
|
||||
connect (conn4,localhost,root,,);
|
||||
connect (conn5,localhost,root,,);
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS foo;
|
||||
--enable_warnings
|
||||
|
||||
connection default;
|
||||
create table foo (a int, b varchar (100), primary key (a)) engine=TokuDB;
|
||||
show create table foo;
|
||||
|
||||
connection conn1;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
replace into foo values (1, "a");
|
||||
|
||||
connection conn2;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
replace into foo values (1,"ab"), (2, "ab");
|
||||
|
||||
connection conn3;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
replace into foo values (1,"abc"),(2,"abc"),(3, "abc");
|
||||
|
||||
connection conn4;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection default;
|
||||
replace into foo values (1,"abcd"),(2,"abcd"),(3, "abcd"),(4, "abcd");
|
||||
|
||||
connection conn5;
|
||||
set session transaction isolation level repeatable read;
|
||||
begin;
|
||||
select * from foo;
|
||||
|
||||
connection conn1;
|
||||
select * from foo;
|
||||
|
||||
connection conn2;
|
||||
select * from foo;
|
||||
|
||||
connection conn3;
|
||||
select * from foo;
|
||||
|
||||
connection conn4;
|
||||
select * from foo;
|
||||
|
||||
connection conn5;
|
||||
select * from foo;
|
||||
|
||||
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
disconnect conn2;
|
||||
disconnect conn3;
|
||||
disconnect conn4;
|
||||
disconnect conn5;
|
||||
|
||||
connection default;
|
||||
# Final cleanup.
|
||||
set session transaction isolation level serializable;
|
||||
DROP TABLE foo;
|
Loading…
Add table
Reference in a new issue