diff options
author | unknown <ingo@mysql.com> | 2006-05-29 15:30:13 +0200 |
---|---|---|
committer | unknown <ingo@mysql.com> | 2006-05-29 15:30:13 +0200 |
commit | e6ca5f195360dd4e89888d6f607f1e179da075a0 (patch) | |
tree | d6f4f8c5a1de1f84d3a8fd9931823411ae0de5f6 /mysql-test/t/lock_multi.test | |
parent | fe7716dad927beb48709cfebbe3355c8495750c1 (diff) | |
parent | 4f8407b6315736ab52b49e1e248e7585614c3f20 (diff) | |
download | mariadb-git-e6ca5f195360dd4e89888d6f607f1e179da075a0.tar.gz |
Merge mysql.com:/home/mydev/mysql-5.0-bug19815
into mysql.com:/home/mydev/mysql-5.1-bug19815
mysql-test/r/lock_multi.result:
Auto merged
mysql-test/t/lock_multi.test:
Auto merged
sql/sql_db.cc:
SCCS merged
Diffstat (limited to 'mysql-test/t/lock_multi.test')
-rw-r--r-- | mysql-test/t/lock_multi.test | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test index 3d07ec98d69..b963c217faa 100644 --- a/mysql-test/t/lock_multi.test +++ b/mysql-test/t/lock_multi.test @@ -126,3 +126,38 @@ show columns from t1; connection locker; unlock tables; 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; + |