Commit 626f9cb9 authored by Rich Prohaska's avatar Rich Prohaska

#4621 move tokudb.nested_txn mysql tests to common mysql test dir refs[t:4621]

git-svn-id: file:///svn/mysql/tests/mysql-test@40912 c7de825b-a66e-492c-adef-691d508d4ae1
parent e4e0d6e0
SET STORAGE_ENGINE='TokuDB';
DROP TABLE IF EXISTS t1, t2;
SET @@autocommit=0;
CREATE TABLE t1 (a int);
insert into t1 values(1);
delete from t1 where a=1;
rollback;
select * from t1;
a
DROP table t1;
create table t1 (a int, b int, primary key (a));
insert into t1 values (1,10);
select * From t1;
a b
1 10
rollback;
select * From t1;
a b
insert into t1 values (1,10);
select * From t1;
a b
1 10
update t1 set b=b+5;
select * From t1;
a b
1 15
update t1 set b=b+5 where a=1;
select * from t1;
a b
1 20
rollback;
select * from t1;
a b
insert into t1 values (1,10),(2,20);
select * From t1;
a b
1 10
2 20
delete from t1 where a > 1;
select * from t1;
a b
1 10
rollback;
select * from t1;
a b
insert into t1 values (1,10),(2,20),(3,30);
select * from t1;
a b
1 10
2 20
3 30
commit;
select * From t1;
a b
1 10
2 20
3 30
insert into t1 values (4,40),(5,50),(6,60);
select * from t1;
a b
1 10
2 20
3 30
4 40
5 50
6 60
commit;
select * from t1;
a b
1 10
2 20
3 30
4 40
5 50
6 60
insert into t1 values (7,70);
insert into t1 values (8,80), (9,90), (1,10), (10,100);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
insert into t1 values (11,110);
rollback;
select * From t1;
a b
1 10
2 20
3 30
4 40
5 50
6 60
insert into t1 values (7,70);
insert into t1 values (8,80), (9,90), (1,10), (10,100);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
insert into t1 values (11,110);
commit;
select * From t1;
a b
1 10
2 20
3 30
4 40
5 50
6 60
7 70
11 110
delete from t1;
alter table t1 add index (b);
insert ignore into t1 values (1,10),(2,20),(3,30),(1,10),(4,40);
select * From t1;
a b
1 10
2 20
3 30
4 40
commit;
insert ignore into t1 values (5,50),(3,30),(6,60),(7,70);
select * From t1;
a b
1 10
2 20
3 30
4 40
5 50
6 60
7 70
rollback;
select * from t1;
a b
1 10
2 20
3 30
4 40
insert ignore into t1 values (5,50),(3,30),(6,60),(7,70);
select * From t1;
a b
1 10
2 20
3 30
4 40
5 50
6 60
7 70
commit;
select * From t1;
a b
1 10
2 20
3 30
4 40
5 50
6 60
7 70
SET @@autocommit=1;
drop table t1;
SET STORAGE_ENGINE='TokuDB';
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (a int);
begin;
insert into t1 values(1);
delete from t1 where a=1;
rollback;
select * from t1;
a
DROP table t1;
create table t1 (a int, b int, primary key (a));
begin;
insert into t1 values (1,10);
select * From t1;
a b
1 10
rollback;
select * From t1;
a b
begin;
insert into t1 values (1,10);
select * From t1;
a b
1 10
update t1 set b=b+5;
select * From t1;
a b
1 15
update t1 set b=b+5 where a=1;
select * from t1;
a b
1 20
rollback;
select * from t1;
a b
begin;
insert into t1 values (1,10),(2,20);
select * From t1;
a b
1 10
2 20
delete from t1 where a > 1;
select * from t1;
a b
1 10
rollback;
select * from t1;
a b
insert into t1 values (1,10),(2,20),(3,30);
select * from t1;
a b
1 10
2 20
3 30
rollback;
select * From t1;
a b
1 10
2 20
3 30
begin;
insert into t1 values (4,40),(5,50),(6,60);
select * from t1;
a b
1 10
2 20
3 30
4 40
5 50
6 60
commit;
select * from t1;
a b
1 10
2 20
3 30
4 40
5 50
6 60
begin;
insert into t1 values (7,70);
insert into t1 values (8,80), (9,90), (1,10), (10,100);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
insert into t1 values (11,110);
rollback;
select * From t1;
a b
1 10
2 20
3 30
4 40
5 50
6 60
begin;
insert into t1 values (7,70);
insert into t1 values (8,80), (9,90), (1,10), (10,100);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
insert into t1 values (11,110);
commit;
select * From t1;
a b
1 10
2 20
3 30
4 40
5 50
6 60
7 70
11 110
delete from t1;
alter table t1 add index (b);
insert ignore into t1 values (1,10),(2,20),(3,30),(1,10),(4,40);
select * From t1;
a b
1 10
2 20
3 30
4 40
begin;
insert ignore into t1 values (5,50),(3,30),(6,60),(7,70);
select * From t1;
a b
1 10
2 20
3 30
4 40
5 50
6 60
7 70
rollback;
select * from t1;
a b
1 10
2 20
3 30
4 40
begin;
insert ignore into t1 values (5,50),(3,30),(6,60),(7,70);
select * From t1;
a b
1 10
2 20
3 30
4 40
5 50
6 60
7 70
commit;
select * From t1;
a b
1 10
2 20
3 30
4 40
5 50
6 60
7 70
drop table t1;
SET STORAGE_ENGINE='TokuDB';
DROP TABLE IF EXISTS t1, t2;
create table t1 (a int, b int, primary key (a));
begin;
insert into t1 values (1,10), (2,20);
create table t2 (a int);
rollback;
select * from t1;
a b
1 10
2 20
delete from t1;
begin;
insert into t1 values (1,10),(2,20);
select * from t1;
a b
1 10
2 20
alter table t1 add index (b);
rollback;
select * From t1;
a b
1 10
2 20
begin;
insert into t1 values (3,30);
lock tables t1 write;
rollback;
select * from t1;
a b
1 10
2 20
3 30
unlock tables;
lock tables t1 write;
insert into t1 values (4,40);
select * From t1;
a b
1 10
2 20
3 30
4 40
rollback;
select * from t1;
a b
1 10
2 20
3 30
4 40
insert into t2 values (1);
ERROR HY000: Table 't2' was not locked with LOCK TABLES
commit;
insert into t2 values (1);
ERROR HY000: Table 't2' was not locked with LOCK TABLES
unlock tables;
insert into t2 values (1);
select * from t1;
a b
1 10
2 20
3 30
4 40
select * from t2;
a
1
lock tables t1 write;
insert into t1 values (5,50);
begin;
insert into t2 values (2);
select * from t1;
a b
1 10
2 20
3 30
4 40
5 50
select * from t2;
a
1
2
rollback;
select * from t1;
a b
1 10
2 20
3 30
4 40
5 50
select * from t2;
a
1
drop table t1,t2;
#--source include/have_tokudb.inc
SET STORAGE_ENGINE='TokuDB';
--disable_warnings
DROP TABLE IF EXISTS t1, t2;
--enable_warnings
SET @@autocommit=0;
CREATE TABLE t1 (a int);
insert into t1 values(1);
delete from t1 where a=1;
rollback;
select * from t1;
DROP table t1;
create table t1 (a int, b int, primary key (a));
#
# do some rollback tests, all nesting levels are 2
#
insert into t1 values (1,10);
select * From t1;
rollback;
select * From t1;
insert into t1 values (1,10);
select * From t1;
update t1 set b=b+5;
select * From t1;
update t1 set b=b+5 where a=1;
select * from t1;
rollback;
select * from t1;
insert into t1 values (1,10),(2,20);
select * From t1;
delete from t1 where a > 1;
select * from t1;
rollback;
select * from t1;
insert into t1 values (1,10),(2,20),(3,30);
select * from t1;
commit;
select * From t1;
#
# do some commit tests
#
insert into t1 values (4,40),(5,50),(6,60);
select * from t1;
commit;
select * from t1;
insert into t1 values (7,70);
--error ER_DUP_ENTRY
insert into t1 values (8,80), (9,90), (1,10), (10,100);
insert into t1 values (11,110);
rollback;
select * From t1;
insert into t1 values (7,70);
--error ER_DUP_ENTRY
insert into t1 values (8,80), (9,90), (1,10), (10,100);
insert into t1 values (11,110);
commit;
select * From t1;
delete from t1;
alter table t1 add index (b);
insert ignore into t1 values (1,10),(2,20),(3,30),(1,10),(4,40);
select * From t1;
commit;
insert ignore into t1 values (5,50),(3,30),(6,60),(7,70);
select * From t1;
rollback;
select * from t1;
insert ignore into t1 values (5,50),(3,30),(6,60),(7,70);
select * From t1;
commit;
select * From t1;
SET @@autocommit=1;
drop table t1;
\ No newline at end of file
#--source include/have_tokudb.inc
SET STORAGE_ENGINE='TokuDB';
--disable_warnings
DROP TABLE IF EXISTS t1, t2;
--enable_warnings
CREATE TABLE t1 (a int);
begin;
insert into t1 values(1);
delete from t1 where a=1;
rollback;
select * from t1;
DROP table t1;
create table t1 (a int, b int, primary key (a));
#
# do some rollback tests, all nesting levels are 2
#
begin;
insert into t1 values (1,10);
select * From t1;
rollback;
select * From t1;
begin;
insert into t1 values (1,10);
select * From t1;
update t1 set b=b+5;
select * From t1;
update t1 set b=b+5 where a=1;
select * from t1;
rollback;
select * from t1;
begin;
insert into t1 values (1,10),(2,20);
select * From t1;
delete from t1 where a > 1;
select * from t1;
rollback;
select * from t1;
insert into t1 values (1,10),(2,20),(3,30);
select * from t1;
rollback;
select * From t1;
#
# do some commit tests
#
begin;
insert into t1 values (4,40),(5,50),(6,60);
select * from t1;
commit;
select * from t1;
begin;
insert into t1 values (7,70);
--error ER_DUP_ENTRY
insert into t1 values (8,80), (9,90), (1,10), (10,100);
insert into t1 values (11,110);
rollback;
select * From t1;
begin;
insert into t1 values (7,70);
--error ER_DUP_ENTRY
insert into t1 values (8,80), (9,90), (1,10), (10,100);
insert into t1 values (11,110);
commit;
select * From t1;
delete from t1;
alter table t1 add index (b);
insert ignore into t1 values (1,10),(2,20),(3,30),(1,10),(4,40);
select * From t1;
begin;
insert ignore into t1 values (5,50),(3,30),(6,60),(7,70);
select * From t1;
rollback;
select * from t1;
begin;
insert ignore into t1 values (5,50),(3,30),(6,60),(7,70);
select * From t1;
commit;
select * From t1;
drop table t1;
\ No newline at end of file
#--source include/have_tokudb.inc
SET STORAGE_ENGINE='TokuDB';
--disable_warnings
DROP TABLE IF EXISTS t1, t2;
--enable_warnings
create table t1 (a int, b int, primary key (a));
begin;
insert into t1 values (1,10), (2,20);
create table t2 (a int);
rollback;
select * from t1;
delete from t1;
begin;
insert into t1 values (1,10),(2,20);
select * from t1;
alter table t1 add index (b);
rollback;
select * From t1;
begin;
insert into t1 values (3,30);
lock tables t1 write;
rollback;
select * from t1;
unlock tables;
lock tables t1 write;
insert into t1 values (4,40);
select * From t1;
rollback;
select * from t1;
--error ER_TABLE_NOT_LOCKED
insert into t2 values (1);
commit;
--error ER_TABLE_NOT_LOCKED
insert into t2 values (1);
unlock tables;
insert into t2 values (1);
select * from t1;
select * from t2;
lock tables t1 write;
insert into t1 values (5,50);
begin;
insert into t2 values (2);
select * from t1;
select * from t2;
rollback;
select * from t1;
select * from t2;
drop table t1,t2;
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment