~mordred/blitzdb/out-of-tree

« back to all changes in this revision

Viewing changes to tests/r/deadlock_innodb.result

  • Committer: Monty Taylor
  • Date: 2010-01-04 01:23:00 UTC
  • Revision ID: mordred@inaugust.com-20100104012300-k9etllo2yyt1flap
Split blitzdb into its own tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Establish connection con1 (user=root)
2
 
# Establish connection con2 (user=root)
3
 
drop table if exists t1,t2;
4
 
# Switch to connection con1
5
 
create table t1 (id integer, x integer) engine = InnoDB;
6
 
insert into t1 values(0, 0);
7
 
set autocommit=0;
8
 
SELECT * from t1 where id = 0 FOR UPDATE;
9
 
id      x
10
 
0       0
11
 
# Switch to connection con2
12
 
set autocommit=0;
13
 
update t1 set x=2 where id = 0;
14
 
# Switch to connection con1
15
 
update t1 set x=1 where id = 0;
16
 
select * from t1;
17
 
id      x
18
 
0       1
19
 
commit;
20
 
# Switch to connection con2
21
 
commit;
22
 
# Switch to connection con1
23
 
select * from t1;
24
 
id      x
25
 
0       2
26
 
commit;
27
 
drop table t1;
28
 
# Switch to connection con1
29
 
create table t1 (id integer, x integer) engine = InnoDB;
30
 
create table t2 (b integer, a integer) engine = InnoDB;
31
 
insert into t1 values(0, 0), (300, 300);
32
 
insert into t2 values(0, 10), (1, 20), (2, 30);
33
 
commit;
34
 
set autocommit=0;
35
 
select * from t2;
36
 
b       a
37
 
0       10
38
 
1       20
39
 
2       30
40
 
select x from t1 where id=0 FOR UPDATE;
41
 
x
42
 
0
43
 
update t2 set a=100 where b=(SELECT x from t1 where id = b);
44
 
select * from t2;
45
 
b       a
46
 
0       100
47
 
1       20
48
 
2       30
49
 
select * from t1;
50
 
id      x
51
 
0       0
52
 
300     300
53
 
# Switch to connection con2
54
 
set autocommit=0;
55
 
update t1 set x=2 where id = 0;
56
 
# Switch to connection con1
57
 
update t1 set x=1 where id = 0;
58
 
select * from t1;
59
 
id      x
60
 
0       1
61
 
300     300
62
 
commit;
63
 
# Switch to connection con2
64
 
commit;
65
 
# Switch to connection con1
66
 
select * from t1;
67
 
id      x
68
 
0       2
69
 
300     300
70
 
commit;
71
 
drop table t1, t2;
72
 
create table t1 (id integer, x integer) engine = InnoDB;
73
 
create table t2 (b integer, a integer) engine = InnoDB;
74
 
insert into t1 values(0, 0), (300, 300);
75
 
insert into t2 values(0, 0), (1, 20), (2, 30);
76
 
commit;
77
 
# Switch to connection con1
78
 
select a,b from t2 UNION SELECT id, x from t1 FOR UPDATE;
79
 
a       b
80
 
0       0
81
 
20      1
82
 
30      2
83
 
300     300
84
 
select * from t2;
85
 
b       a
86
 
0       0
87
 
1       20
88
 
2       30
89
 
select * from t1;
90
 
id      x
91
 
0       0
92
 
300     300
93
 
# Switch to connection con2
94
 
update t2 set a=2 where b = 0;
95
 
select * from t2;
96
 
b       a
97
 
0       2
98
 
1       20
99
 
2       30
100
 
update t1 set x=2 where id = 0;
101
 
# Switch to connection con1
102
 
update t1 set x=1 where id = 0;
103
 
select * from t1;
104
 
id      x
105
 
0       1
106
 
300     300
107
 
commit;
108
 
# Switch to connection con2
109
 
commit;
110
 
# Switch to connection con1
111
 
select * from t1;
112
 
id      x
113
 
0       2
114
 
300     300
115
 
commit;
116
 
# Switch to connection default + disconnect con1 and con2
117
 
drop table t1, t2;
118
 
End of 4.1 tests
119
 
set storage_engine=innodb;
120
 
drop table if exists a;
121
 
drop table if exists A;
122
 
create table A (c int);
123
 
insert into A (c) values (0);
124
 
create table a as select * from A;
125
 
drop table A;
126
 
drop table if exists a;
127
 
set storage_engine=default;
128
 
End of 5.0 tests.