diff options
author | unknown <ingo@mysql.com> | 2006-07-04 12:34:23 +0200 |
---|---|---|
committer | unknown <ingo@mysql.com> | 2006-07-04 12:34:23 +0200 |
commit | bb576ed21765f309a5ba8f0cc1abb7a406ea1430 (patch) | |
tree | 0fac09842ea28c3c433223262a6a49884ecece82 | |
parent | 597ee0392c6457f22ac450609557cd117fe1f235 (diff) | |
download | mariadb-git-bb576ed21765f309a5ba8f0cc1abb7a406ea1430.tar.gz |
After merge fix
-rw-r--r-- | mysql-test/r/lock_multi.result | 16 | ||||
-rw-r--r-- | mysql-test/t/lock_multi.test | 98 |
2 files changed, 34 insertions, 80 deletions
diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result index d7ba9174408..8ff02d898a3 100644 --- a/mysql-test/r/lock_multi.result +++ b/mysql-test/r/lock_multi.result @@ -95,19 +95,3 @@ lock tables t1 write; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; // unlock tables; drop table t1; -use mysql; -LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE; -FLUSH TABLES; -use mysql; - SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1; -OPTIMIZE TABLES columns_priv, db, host, user; -Table Op Msg_type Msg_text -mysql.columns_priv optimize status OK -mysql.db optimize status OK -mysql.host optimize status OK -mysql.user optimize status OK -UNLOCK TABLES; -Select_priv -N -use test; -use test; diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test index 37b8fbda376..9c9e68f931f 100644 --- a/mysql-test/t/lock_multi.test +++ b/mysql-test/t/lock_multi.test @@ -156,70 +156,6 @@ connection locker; use test; # connection default; - -# -# Bug#19815 - CREATE/RENAME/DROP DATABASE can deadlock on a global read lock -# -connect (con1,localhost,root,,); -connect (con2,localhost,root,,); -# -connection con1; -CREATE DATABASE mysqltest_1; -FLUSH TABLES WITH READ LOCK; -# -# With bug in place: acquire LOCK_mysql_create_table and -# wait in wait_if_global_read_lock(). -connection con2; -send DROP DATABASE mysqltest_1; ---sleep 1 -# -# With bug in place: try to acquire LOCK_mysql_create_table... -# When fixed: Reject dropping db because of the read lock. -connection con1; ---error ER_CANT_UPDATE_WITH_READLOCK -DROP DATABASE mysqltest_1; -UNLOCK TABLES; -# -connection con2; -reap; -# -connection default; -disconnect con1; -disconnect con2; -# This must have been dropped by connection 2 already, -# which waited until the global read lock was released. ---error ER_DB_DROP_EXISTS -DROP DATABASE mysqltest_1; - -# -# Bug#16986 - Deadlock condition with MyISAM tables -# -connection locker; -use mysql; -LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE; -FLUSH TABLES; ---sleep 1 -# -connection reader; -use mysql; -#NOTE: This must be a multi-table select, otherwise the deadlock will not occur -send SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1; ---sleep 1 -# -connection locker; -# Make test case independent from earlier grants. ---replace_result "Table is already up to date" "OK" -OPTIMIZE TABLES columns_priv, db, host, user; -UNLOCK TABLES; -# -connection reader; -reap; -use test; -# -connection locker; -use test; -# -connection default; # # Test if CREATE TABLE with LOCK TABLE deadlocks. # @@ -271,6 +207,40 @@ connection default; DROP TABLE t1; # +# Bug#19815 - CREATE/RENAME/DROP DATABASE can deadlock on a global read lock +# +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); +# +connection con1; +CREATE DATABASE mysqltest_1; +FLUSH TABLES WITH READ LOCK; +# +# With bug in place: acquire LOCK_mysql_create_table and +# wait in wait_if_global_read_lock(). +connection con2; +send DROP DATABASE mysqltest_1; +--sleep 1 +# +# With bug in place: try to acquire LOCK_mysql_create_table... +# When fixed: Reject dropping db because of the read lock. +connection con1; +--error ER_CANT_UPDATE_WITH_READLOCK +DROP DATABASE mysqltest_1; +UNLOCK TABLES; +# +connection con2; +reap; +# +connection default; +disconnect con1; +disconnect con2; +# This must have been dropped by connection 2 already, +# which waited until the global read lock was released. +--error ER_DB_DROP_EXISTS +DROP DATABASE mysqltest_1; + +# # Bug #17264: MySQL Server freeze # connection locker; |