summaryrefslogtreecommitdiff
path: root/mysql-test/t/lock_multi.test
diff options
context:
space:
mode:
authorunknown <antony@ltantony.rdg.cyberkinetica.homeunix.net>2004-10-03 00:20:47 +0100
committerunknown <antony@ltantony.rdg.cyberkinetica.homeunix.net>2004-10-03 00:20:47 +0100
commita49f5cae9ad6f4de7f5c2d9f8bbdbca270376af6 (patch)
tree2b6e8c65a6d12454985b9e836b6d1a7c203750bd /mysql-test/t/lock_multi.test
parent799505216ff2fb29a48d7a609f8b392c8c6bb87c (diff)
downloadmariadb-git-a49f5cae9ad6f4de7f5c2d9f8bbdbca270376af6.tar.gz
Bug#4118: multi-table UPDATE takes WRITE lock on read table
Ensures that WRITE lock is not obtained on all tables referenced. mysql-test/r/lock_multi.result: Bug#4118 New test for multi-update locking mysql-test/r/multi_update.result: Bug#4118 Fix test mysql-test/t/lock_multi.test: Bug#4118 New test for multi-update locking mysql-test/t/multi_update.test: Bug#4118 Fix test sql/sql_parse.cc: Bug#4118 Split multi-update to its own case statement in sql_parse.cc sql/sql_update.cc: Bug#4118 Overview of locking checking: 1. Open and acquire READ lock 2. Check to see which tables need WRITE lock 3. Unlock tables and relock sql/sql_yacc.yy: Bug#4118 Split multi-update to its own case statement in sql_parse.cc
Diffstat (limited to 'mysql-test/t/lock_multi.test')
-rw-r--r--mysql-test/t/lock_multi.test24
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test
index 0295fca29e7..e20f8163751 100644
--- a/mysql-test/t/lock_multi.test
+++ b/mysql-test/t/lock_multi.test
@@ -51,6 +51,30 @@ reap;
drop table t1;
#
+# Test problem when using locks with multi-updates
+# It should not block when multi-update is reading on a read-locked table
+#
+
+connection locker;
+create table t1 (a int, b int);
+create table t2 (c int, d int);
+insert into t1 values(1,1);
+insert into t1 values(2,2);
+insert into t2 values(1,2);
+lock table t1 read;
+connection writer;
+--sleep 2
+send update t1,t2 set c=a where b=d;
+connection reader;
+--sleep 2
+select c from t2;
+connection writer;
+reap;
+connection locker;
+drop table t1;
+drop table t2;
+
+#
# Test problem when using locks on many tables and droping a table that
# is to-be-locked by another thread
#