~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/tests/t/innodb-semi-consistent.test

  • Committer: Brian Aker
  • Date: 2010-12-18 18:24:57 UTC
  • mfrom: (1999.6.3 trunk)
  • Revision ID: brian@tangent.org-20101218182457-yi1wd0so2hml1k1w
Merge in Lee's copyright header fix

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
drop table if exists t1;
5
5
--enable_warnings
6
6
 
 
7
SET @orig_lock_wait_timeout= @@innodb_lock_wait_timeout; 
 
8
SET GLOBAL innodb_lock_wait_timeout=2;
 
9
 
7
10
# basic tests of semi-consistent reads
8
 
 
9
11
connect (a,localhost,root,,);
10
12
connect (b,localhost,root,,);
11
13
connection a;
12
14
set session transaction isolation level read committed;
13
 
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
 
15
create table t1(a int not null) engine=innodb;
14
16
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
15
17
set autocommit=0;
16
 
# this should lock the entire table
 
18
# we have locks_unsafe_for_binlog on by default. this should work.
17
19
select * from t1 where a=3 lock in share mode;
18
20
connection b;
19
21
set session transaction isolation level read committed;
20
22
set autocommit=0;
21
23
update t1 set a=10 where a=5;
22
24
connection a;
23
25
commit;
33
34
update t1 set a=11 where a=6;
34
35
-- error ER_LOCK_WAIT_TIMEOUT
35
36
update t1 set a=12 where a=2;
36
37
update t1 set a=13 where a=1;
37
38
connection a;
38
39
commit;
43
43
connection a;
44
44
select * from t1;
45
45
drop table t1;
46
 
 
47
46
connection default;
48
47
disconnect a;
49
48
disconnect b;
 
49
 
 
50
 
 
51
SET GLOBAL innodb_lock_wait_timeout=@orig_lock_wait_timeout ;
 
52