mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/dlenev/src/mysql-4.1-bg12423 sql/mysqld.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_parse.cc: Auto merged mysql-test/r/grant2.result: Manual merge. mysql-test/t/grant2.test: Manual merge.
This commit is contained in:
@ -122,3 +122,12 @@ flush privileges;
|
||||
drop database mysqltest_1;
|
||||
set password = password("changed");
|
||||
ERROR 42000: Access denied for user ''@'localhost' to database 'mysql'
|
||||
lock table mysql.user write;
|
||||
flush privileges;
|
||||
grant all on *.* to 'mysqltest_1'@'localhost';
|
||||
unlock tables;
|
||||
lock table mysql.user write;
|
||||
set password for 'mysqltest_1'@'localhost' = password('');
|
||||
revoke all on *.* from 'mysqltest_1'@'localhost';
|
||||
unlock tables;
|
||||
drop user 'mysqltest_1'@'localhost';
|
||||
|
@ -163,4 +163,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
|
||||
|
Reference in New Issue
Block a user