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

« back to all changes in this revision

Viewing changes to mysql-test/r/innodb_bug42419.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
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;