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

« back to all changes in this revision

Viewing changes to mysql-test/r/bug39022.result

  • 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
#
 
2
# Bug #39022: Mysql randomly crashing in lock_sec_rec_cons_read_sees
 
3
#
 
4
CREATE TABLE t1(a TINYINT NOT NULL,b TINYINT,PRIMARY KEY(b)) ENGINE=innodb;
 
5
CREATE TABLE t2(d TINYINT NOT NULL,UNIQUE KEY(d)) ENGINE=innodb;
 
6
INSERT INTO t1 VALUES (13,0),(8,1),(9,2),(6,3),
 
7
(11,5),(11,6),(7,7),(7,8),(4,9),(6,10),(3,11),(11,12),
 
8
(12,13),(7,14);
 
9
INSERT INTO t2 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),
 
10
(11),(12),(13),(14);
 
11
# in thread1
 
12
START TRANSACTION;
 
13
# in thread2
 
14
REPLACE INTO t2 VALUES (-17);
 
15
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d);
 
16
d
 
17
# in thread1
 
18
REPLACE INTO t1(a,b) VALUES (67,20);
 
19
# in thread2
 
20
COMMIT;
 
21
START TRANSACTION;
 
22
REPLACE INTO t1(a,b) VALUES (65,-50);
 
23
REPLACE INTO t2 VALUES (-91);
 
24
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d);
 
25
# in thread1
 
26
# should not crash
 
27
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d);
 
28
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
 
29
# in thread2
 
30
d
 
31
# in thread1;
 
32
DROP TABLE t1,t2;