~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-- source include/not_embedded.inc
 
2
-- source include/have_innodb.inc
 
3
-- source suite/innodb/include/have_innodb_plugin.inc
 
4
 
 
5
--disable_warnings
 
6
drop table if exists t1;
 
7
--enable_warnings
 
8
 
 
9
# REPLACE INTO ... SELECT and INSERT INTO ... SELECT should do
 
10
# a consistent read of the source table.
 
11
 
 
12
connect (a,localhost,root,,);
 
13
connect (b,localhost,root,,);
 
14
connection a;
 
15
set session transaction isolation level read committed;
 
16
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
 
17
create table t2 like t1;
 
18
insert into t2 values (1),(2),(3),(4),(5),(6),(7);
 
19
set autocommit=0;
 
20
 
 
21
# REPLACE INTO ... SELECT case
 
22
begin;
 
23
# this should not result in any locks on t2.
 
24
replace into t1 select * from t2;
 
25
 
 
26
connection b;
 
27
set session transaction isolation level read committed;
 
28
set autocommit=0;
 
29
# should not cuase a lock wait.
 
30
delete from t2 where a=5;
 
31
commit;
 
32
delete from t2;
 
33
commit;
 
34
connection a;
 
35
commit;
 
36
 
 
37
# INSERT INTO ... SELECT case
 
38
begin;
 
39
# this should not result in any locks on t2.
 
40
insert into t1 select * from t2;
 
41
 
 
42
connection b;
 
43
set session transaction isolation level read committed;
 
44
set autocommit=0;
 
45
# should not cuase a lock wait.
 
46
delete from t2 where a=5;
 
47
commit;
 
48
delete from t2;
 
49
commit;
 
50
connection a;
 
51
commit;
 
52
 
 
53
select * from t1;
 
54
drop table t1;
 
55
drop table t2;
 
56
 
 
57
connection default;
 
58
disconnect a;
 
59
disconnect b;