~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-security

« back to all changes in this revision

Viewing changes to mysql-test/t/innodb-semi-consistent.test

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 22:33:55 UTC
  • mto: (1.2.1) (37.1.1 lucid-security)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: package-import@ubuntu.com-20120222223355-ku1tb4r70osci6v2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
--disable_warnings
3
 
drop table if exists t1;
4
 
--enable_warnings
5
 
 
6
 
# basic tests of semi-consistent reads
7
 
 
8
 
connect (a,localhost,root,,);
9
 
connect (b,localhost,root,,);
10
 
connection a;
11
 
set binlog_format=mixed;
12
 
set session transaction isolation level repeatable read;
13
 
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
14
 
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
15
 
set autocommit=0;
16
 
# this should lock the entire table
17
 
select * from t1 where a=3 lock in share mode;
18
 
connection b;
19
 
set binlog_format=mixed;
20
 
set session transaction isolation level repeatable read;
21
 
set autocommit=0;
22
 
update t1 set a=10 where a=5;
23
 
connection a;
24
 
commit;
25
 
connection b;
26
 
# perform a semi-consisent read (and unlock non-matching rows)
27
 
set session transaction isolation level read committed;
28
 
update t1 set a=10 where a=5;
29
 
connection a;
30
 
select * from t1 where a=2 for update;
31
 
# this should lock the records (1),(2)
32
 
select * from t1 where a=2 limit 1 for update;
33
 
connection b;
34
 
# semi-consistent read will skip non-matching locked rows a=1, a=2
35
 
update t1 set a=11 where a=6;
36
 
update t1 set a=12 where a=2;
37
 
update t1 set a=13 where a=1;
38
 
connection a;
39
 
commit;
40
 
connection b;
41
 
update t1 set a=14 where a=1;
42
 
commit;
43
 
connection a;
44
 
select * from t1;
45
 
drop table t1;
46
 
 
47
 
connection default;
48
 
disconnect a;
49
 
disconnect b;
50
 
 
51
 
# Bug 39320
52
 
create table t1 (a int, b int) engine=myisam;
53
 
create table t2 (c int, d int, key (c)) engine=innodb;
54
 
insert into t1 values (1,1);
55
 
insert into t2 values (1,2);
56
 
connect (a,localhost,root,,);
57
 
connection a;
58
 
set session transaction isolation level read committed;
59
 
delete from t1 using t1 join t2 on t1.a = t2.c where t2.d in (1);
60
 
connection default;
61
 
disconnect a;
62
 
drop table t1, t2;