summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test/tokudb/t/nested_txn_implicit_commit.test
blob: cd1ce5a0f870b6be4372d0167cb97ee482ea63e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#--source include/have_tokudb.inc
SET DEFAULT_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;