~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-security

« back to all changes in this revision

Viewing changes to mysql-test/suite/innodb/r/innodb_bug42419.result

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 22:33:55 UTC
  • mto: (1.2.1) (37.1.1 lucid-security)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: package-import@ubuntu.com-20120222223355-ku1tb4r70osci6v2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b INT) ENGINE = InnoDB;
 
2
INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
 
3
COMMIT;
 
4
SET AUTOCOMMIT = 0;
 
5
CREATE TEMPORARY TABLE t1_tmp ( b INT );
 
6
INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 3;
 
7
INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 2;
 
8
SET AUTOCOMMIT = 0;
 
9
CREATE TEMPORARY TABLE t2_tmp ( a int, new_a int );
 
10
INSERT INTO t2_tmp VALUES (1,51),(2,52),(3,53);
 
11
UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 1;
 
12
UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 2;
 
13
INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 1;
 
14
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
 
15
Reap the server message for connection user2 UPDATE t1 ...
 
16
UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 3;
 
17
DROP TABLE t1;