~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-- source include/have_innodb.inc
 
2
 
 
3
--disable_warnings
 
4
drop table if exists t1;
 
5
--enable_warnings
 
6
 
 
7
SET @orig_lock_wait_timeout= @@innodb_lock_wait_timeout; 
 
8
SET GLOBAL innodb_lock_wait_timeout=2;
 
9
 
 
10
# basic tests of semi-consistent reads
 
11
connect (a,localhost,root,,);
 
12
connect (b,localhost,root,,);
 
13
connection a;
 
14
set session transaction isolation level read committed;
 
15
create table t1(a int not null) engine=innodb;
 
16
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
 
17
set autocommit=0;
 
18
# we have locks_unsafe_for_binlog on by default. this should work.
 
19
select * from t1 where a=3 lock in share mode;
 
20
connection b;
 
21
set session transaction isolation level read committed;
 
22
set autocommit=0;
 
23
update t1 set a=10 where a=5;
 
24
connection a;
 
25
commit;
 
26
connection b;
 
27
update t1 set a=10 where a=5;
 
28
connection a;
 
29
-- error ER_LOCK_WAIT_TIMEOUT
 
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
update t1 set a=11 where a=6;
 
35
-- error ER_LOCK_WAIT_TIMEOUT
 
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
connection default;
 
47
disconnect a;
 
48
disconnect b;
 
49
 
 
50
 
 
51
SET GLOBAL innodb_lock_wait_timeout=@orig_lock_wait_timeout ;
 
52