diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2016-04-09 17:03:48 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2016-04-09 17:03:48 +0200 |
commit | cd776fedba3e2902bc25ee206d6e6266e7eb9411 (patch) | |
tree | 95bf82d0e0522c6af708cd28639c82e004b5a264 /mysql-test/include/deadlock.inc | |
parent | f884d233e6a5f68bab846a7bdbd041fc4415ad77 (diff) | |
parent | d516a2ae0cbd09d3b5b1667ec62b421330ab9902 (diff) | |
download | mariadb-git-10.2-connector-c-integ.tar.gz |
Merge branch '10.2' into 10.2-connector-c-integ10.2-connector-c-integ
Diffstat (limited to 'mysql-test/include/deadlock.inc')
-rw-r--r-- | mysql-test/include/deadlock.inc | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/mysql-test/include/deadlock.inc b/mysql-test/include/deadlock.inc index 84d23b80811..2fa61f48624 100644 --- a/mysql-test/include/deadlock.inc +++ b/mysql-test/include/deadlock.inc @@ -10,9 +10,7 @@ # main code went into include/deadlock.inc # ---echo # Establish connection con1 (user=root) connect (con1,localhost,root,,); ---echo # Establish connection con2 (user=root) connect (con2,localhost,root,,); --disable_warnings @@ -23,14 +21,12 @@ drop table if exists t1,t2; # Testing of FOR UPDATE # ---echo # Switch to connection con1 connection con1; eval create table t1 (id integer, x integer) engine = $engine_type; insert into t1 values(0, 0); set autocommit=0; SELECT * from t1 where id = 0 FOR UPDATE; ---echo # Switch to connection con2 connection con2; set autocommit=0; @@ -39,18 +35,15 @@ set autocommit=0; update t1 set x=2 where id = 0; --sleep 2 ---echo # Switch to connection con1 connection con1; update t1 set x=1 where id = 0; select * from t1; commit; ---echo # Switch to connection con2 connection con2; reap; commit; ---echo # Switch to connection con1 connection con1; select * from t1; commit; @@ -60,7 +53,6 @@ drop table t1; # Testing of FOR UPDATE # ---echo # Switch to connection con1 connection con1; eval create table t1 (id integer, x integer) engine = $engine_type; eval create table t2 (b integer, a integer) engine = $engine_type; @@ -73,7 +65,6 @@ update t2 set a=100 where b=(SELECT x from t1 where id = b FOR UPDATE); select * from t2; select * from t1; ---echo # Switch to connection con2 connection con2; set autocommit=0; @@ -82,18 +73,15 @@ set autocommit=0; update t1 set x=2 where id = 0; --sleep 2 ---echo # Switch to connection con1 connection con1; update t1 set x=1 where id = 0; select * from t1; commit; ---echo # Switch to connection con2 connection con2; reap; commit; ---echo # Switch to connection con1 connection con1; select * from t1; commit; @@ -105,13 +93,11 @@ insert into t1 values(0, 0), (300, 300); insert into t2 values(0, 0), (1, 20), (2, 30); commit; ---echo # Switch to connection con1 connection con1; select a,b from t2 UNION SELECT id, x from t1 FOR UPDATE; select * from t2; select * from t1; ---echo # Switch to connection con2 connection con2; # The following query should hang because con1 is locking the record @@ -121,24 +107,20 @@ select * from t2; update t1 set x=2 where id = 0; --sleep 2 ---echo # Switch to connection con1 connection con1; update t1 set x=1 where id = 0; select * from t1; commit; ---echo # Switch to connection con2 connection con2; reap; commit; ---echo # Switch to connection con1 connection con1; select * from t1; commit; # Cleanup ---echo # Switch to connection default + disconnect con1 and con2 connection default; disconnect con1; disconnect con2; |