summaryrefslogtreecommitdiff
path: root/mysql-test/t/grant2.test
diff options
context:
space:
mode:
authorunknown <dlenev@mysql.com>2005-09-01 23:25:29 +0400
committerunknown <dlenev@mysql.com>2005-09-01 23:25:29 +0400
commit7783dbbcdccc8e45be88cd4d213c022a9fd023ac (patch)
treea5830cd512f96c9dfcac6af5cf627770f7fd7a72 /mysql-test/t/grant2.test
parentf5db9c9a5be0f2f7f78229e2b6054aae3d940c1c (diff)
parent84ddd543c7c10b8022e3b22d1913faa3704d59a8 (diff)
downloadmariadb-git-7783dbbcdccc8e45be88cd4d213c022a9fd023ac.tar.gz
Merge mysql.com:/home/dlenev/src/mysql-4.1-bg12423
into mysql.com:/home/dlenev/src/mysql-5.0-merges mysql-test/lib/mtr_report.pl: Auto merged mysql-test/lib/mtr_timer.pl: Auto merged sql/mysqld.cc: Auto merged sql/sql_acl.h: Auto merged sql/examples/ha_archive.cc: Auto merged mysql-test/lib/mtr_process.pl: Manual merge. mysql-test/mysql-test-run.pl: Manual merge. mysql-test/r/grant2.result: Manual merge. mysql-test/t/grant2.test: Manual merge. sql/sql_acl.cc: Manual merge. sql/sql_parse.cc: Manual merge.
Diffstat (limited to 'mysql-test/t/grant2.test')
-rw-r--r--mysql-test/t/grant2.test43
1 files changed, 43 insertions, 0 deletions
diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test
index ee9cd1924c6..2fa82ce5dce 100644
--- a/mysql-test/t/grant2.test
+++ b/mysql-test/t/grant2.test
@@ -351,4 +351,47 @@ set password = password("changed");
disconnect n5;
connection default;
+
+# Bug #12423 "Deadlock when doing FLUSH PRIVILEGES and GRANT in
+# multi-threaded environment". We should be able to execute FLUSH
+# PRIVILEGES and SET PASSWORD simultaneously with other account
+# management commands (such as GRANT and REVOKE) without causing
+# deadlocks. To achieve this we should ensure that all account
+# management commands take table and internal locks in the same order.
+connect (con2root,localhost,root,,);
+connect (con3root,localhost,root,,);
+# Check that we can execute FLUSH PRIVILEGES and GRANT simultaneously
+# This will check that locks are taken in proper order during both
+# user/db-level and table/column-level privileges reloading.
+connection default;
+lock table mysql.user write;
+connection con2root;
+send flush privileges;
+connection con3root;
+send grant all on *.* to 'mysqltest_1'@'localhost';
+connection default;
+unlock tables;
+connection con2root;
+reap;
+connection con3root;
+reap;
+# Check for simultaneous SET PASSWORD and REVOKE.
+connection default;
+lock table mysql.user write;
+connection con2root;
+send set password for 'mysqltest_1'@'localhost' = password('');
+connection con3root;
+send revoke all on *.* from 'mysqltest_1'@'localhost';
+connection default;
+unlock tables;
+connection con2root;
+reap;
+connection con3root;
+reap;
+connection default;
+# Clean-up
+drop user 'mysqltest_1'@'localhost';
+disconnect con2root;
+disconnect con3root;
+
# End of 4.1 tests