diff options
author | unknown <ingo@mysql.com> | 2006-05-29 15:26:23 +0200 |
---|---|---|
committer | unknown <ingo@mysql.com> | 2006-05-29 15:26:23 +0200 |
commit | 4f8407b6315736ab52b49e1e248e7585614c3f20 (patch) | |
tree | 59a370c72ba71b6114afc928164b485e2d1dd78c /mysql-test/r/lock_multi.result | |
parent | 0086d5abd9d59dc984d402e07a6df6f9c447f098 (diff) | |
download | mariadb-git-4f8407b6315736ab52b49e1e248e7585614c3f20.tar.gz |
Bug#19815 - CREATE/RENAME/DROP DATABASE can deadlock on a global read lock
The order of acquiring LOCK_mysql_create_db
and wait_if_global_read_lock() was wrong. It could happen
that a thread held LOCK_mysql_create_db while waiting for
the global read lock to be released. The thread with the
global read lock could try to administrate a database too.
It would first try to lock LOCK_mysql_create_db and hang...
The check if the current thread has the global read lock
is done in wait_if_global_read_lock(), which could not be
reached because of the hang in LOCK_mysql_create_db.
Now I exchanged the order of acquiring LOCK_mysql_create_db
and wait_if_global_read_lock(). This makes
wait_if_global_read_lock() fail with an error message for
the thread with the global read lock. No deadlock happens.
mysql-test/r/lock_multi.result:
Bug#19815 - CREATE/RENAME/DROP DATABASE can deadlock on a global read lock
The test result
mysql-test/t/lock_multi.test:
Bug#19815 - CREATE/RENAME/DROP DATABASE can deadlock on a global read lock
The test case
sql/sql_db.cc:
Bug#19815 - CREATE/RENAME/DROP DATABASE can deadlock on a global read lock
Exchanged the order of acquiring LOCK_mysql_create_db
and wait_if_global_read_lock().
Diffstat (limited to 'mysql-test/r/lock_multi.result')
-rw-r--r-- | mysql-test/r/lock_multi.result | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result index 73e3a9d32e3..9c5652657a5 100644 --- a/mysql-test/r/lock_multi.result +++ b/mysql-test/r/lock_multi.result @@ -43,3 +43,11 @@ Field Type Null Key Default Extra a int(11) YES NULL unlock tables; drop table t1; +CREATE DATABASE mysqltest_1; +FLUSH TABLES WITH READ LOCK; + DROP DATABASE mysqltest_1; +DROP DATABASE mysqltest_1; +ERROR HY000: Can't execute the query because you have a conflicting read lock +UNLOCK TABLES; +DROP DATABASE mysqltest_1; +ERROR HY000: Can't drop database 'mysqltest_1'; database doesn't exist |