From 79cdd8773c365d80e6ed528668dfb03eda7406b3 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 24 Nov 2002 21:39:22 +0200 Subject: Updated results after merge from 3.23 --- mysql-test/t/innodb-deadlock.test | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 mysql-test/t/innodb-deadlock.test (limited to 'mysql-test/t') diff --git a/mysql-test/t/innodb-deadlock.test b/mysql-test/t/innodb-deadlock.test new file mode 100644 index 00000000000..bc2839bfb3a --- /dev/null +++ b/mysql-test/t/innodb-deadlock.test @@ -0,0 +1,38 @@ +-- source include/have_innodb.inc + +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); +drop table if exists t1; + +# +# Testing of FOR UPDATE +# + +connection con1; +create table t1 (id integer, x integer) type=INNODB; +insert into t1 values(0, 0); +set autocommit=0; +SELECT * from t1 where id = 0 FOR UPDATE; + +connection con2; +set autocommit=0; + +# The following query should hang because con1 is locking the page +--send +update t1 set x=2 where id = 0; +--sleep 2; + +connection con1; +update t1 set x=1 where id = 0; +select * from t1; +commit; + +connection con2; +reap; +commit; + +connection con1; +select * from t1; +commit; + +drop table t1; -- cgit v1.2.1