mariadb/mysql-test/suite/tokudb.nested_txn/t/autocommit.test
Rich Prohaska 90456a129d #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
2012-03-16 15:41:12 +00:00

90 lines
No EOL
1.6 KiB
Text
Executable file

#--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;