Commit f77895eb authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-15649 Speedup search in acl_users and acl_dbs array,

sorting them by usernames first, and then by get_sort() value.


Search functions now use binary search to find the the first entry with
given name. Then, linear search is done, until the first match.
parent bb9b4182
...@@ -10,15 +10,15 @@ Warning 1364 Field 'authentication_string' doesn't have a default value ...@@ -10,15 +10,15 @@ Warning 1364 Field 'authentication_string' doesn't have a default value
flush privileges; flush privileges;
connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET); connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET);
connect fail,localhost,u1; connect fail,localhost,u1;
ERROR HY000: Server is running in --secure-auth mode, but 'u1'@'localhost' has a password in the old format; please change the password to the new format ERROR 28000: Access denied for user 'u1'@'localhost' (using password: NO)
connect(localhost,u2,,test,MASTER_PORT,MASTER_SOCKET); connect(localhost,u2,,test,MASTER_PORT,MASTER_SOCKET);
connect fail,localhost,u2; connect fail,localhost,u2;
ERROR 28000: Access denied for user 'u2'@'localhost' (using password: NO) ERROR HY000: Server is running in --secure-auth mode, but 'u2'@'localhost' has a password in the old format; please change the password to the new format
connect(localhost,u2,password,test,MASTER_PORT,MASTER_SOCKET); connect(localhost,u2,password,test,MASTER_PORT,MASTER_SOCKET);
connect fail,localhost,u2,password; connect fail,localhost,u2,password;
ERROR 28000: Access denied for user 'u2'@'localhost' (using password: YES) ERROR HY000: Server is running in --secure-auth mode, but 'u2'@'localhost' has a password in the old format; please change the password to the new format
ERROR HY000: Server is running in --secure-auth mode, but 'u1'@'localhost' has a password in the old format; please change the password to the new format ERROR 28000: Access denied for user 'u1'@'localhost' (using password: NO)
ERROR 28000: Access denied for user 'u2'@'localhost' (using password: NO) ERROR HY000: Server is running in --secure-auth mode, but 'u2'@'localhost' has a password in the old format; please change the password to the new format
ERROR 28000: Access denied for user 'u2'@'localhost' (using password: YES) ERROR HY000: Server is running in --secure-auth mode, but 'u2'@'localhost' has a password in the old format; please change the password to the new format
delete from mysql.user where plugin = 'mysql_old_password'; delete from mysql.user where plugin = 'mysql_old_password';
flush privileges; flush privileges;
...@@ -11,24 +11,24 @@ insert ignore mysql.user (user,plugin) values ('foo','mysql_old_password'),('bar ...@@ -11,24 +11,24 @@ insert ignore mysql.user (user,plugin) values ('foo','mysql_old_password'),('bar
flush privileges; flush privileges;
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error ER_SERVER_IS_IN_SECURE_AUTH_MODE --error ER_ACCESS_DENIED_ERROR
connect (fail,localhost,u1); connect (fail,localhost,u1);
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error ER_ACCESS_DENIED_ERROR --error ER_SERVER_IS_IN_SECURE_AUTH_MODE
connect (fail,localhost,u2); connect (fail,localhost,u2);
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error ER_ACCESS_DENIED_ERROR --error ER_SERVER_IS_IN_SECURE_AUTH_MODE
connect (fail,localhost,u2,password); connect (fail,localhost,u2,password);
--error ER_SERVER_IS_IN_SECURE_AUTH_MODE --error ER_ACCESS_DENIED_ERROR
change_user u1; change_user u1;
--error ER_ACCESS_DENIED_ERROR --error ER_SERVER_IS_IN_SECURE_AUTH_MODE
change_user u2; change_user u2;
--error ER_ACCESS_DENIED_ERROR --error ER_SERVER_IS_IN_SECURE_AUTH_MODE
change_user u2,password; change_user u2,password;
delete from mysql.user where plugin = 'mysql_old_password'; delete from mysql.user where plugin = 'mysql_old_password';
......
...@@ -118,7 +118,7 @@ Con4 is alive ...@@ -118,7 +118,7 @@ Con4 is alive
Con4 is alive Con4 is alive
select current_user(); select current_user();
current_user() current_user()
root@192.0.2.4 root@santa.claus.ipv4.example.com
disconnect con4; disconnect con4;
connection default; connection default;
"Dumping performance_schema.host_cache" "Dumping performance_schema.host_cache"
...@@ -155,7 +155,7 @@ Con5 is alive ...@@ -155,7 +155,7 @@ Con5 is alive
Con5 is alive Con5 is alive
select current_user(); select current_user();
current_user() current_user()
root@192.0.2.4 root@santa.claus.ipv4.example.com
disconnect con5; disconnect con5;
connection default; connection default;
"Dumping performance_schema.host_cache" "Dumping performance_schema.host_cache"
......
...@@ -118,7 +118,7 @@ Con4 is alive ...@@ -118,7 +118,7 @@ Con4 is alive
Con4 is alive Con4 is alive
select current_user(); select current_user();
current_user() current_user()
root@2001:db8::6:6 root@santa.claus.ipv6.example.com
disconnect con4; disconnect con4;
connection default; connection default;
"Dumping performance_schema.host_cache" "Dumping performance_schema.host_cache"
...@@ -155,7 +155,7 @@ Con5 is alive ...@@ -155,7 +155,7 @@ Con5 is alive
Con5 is alive Con5 is alive
select current_user(); select current_user();
current_user() current_user()
root@2001:db8::6:6 root@santa.claus.ipv6.example.com
disconnect con5; disconnect con5;
connection default; connection default;
"Dumping performance_schema.host_cache" "Dumping performance_schema.host_cache"
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment