Skip to content

Commit f77895e

Browse files
committed
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.
1 parent bb9b418 commit f77895e

File tree

5 files changed

+239
-112
lines changed

5 files changed

+239
-112
lines changed

mysql-test/main/failed_auth_3909.result

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ Warning 1364 Field 'authentication_string' doesn't have a default value
1010
flush privileges;
1111
connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET);
1212
connect fail,localhost,u1;
13-
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
13+
ERROR 28000: Access denied for user 'u1'@'localhost' (using password: NO)
1414
connect(localhost,u2,,test,MASTER_PORT,MASTER_SOCKET);
1515
connect fail,localhost,u2;
16-
ERROR 28000: Access denied for user 'u2'@'localhost' (using password: NO)
16+
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
1717
connect(localhost,u2,password,test,MASTER_PORT,MASTER_SOCKET);
1818
connect fail,localhost,u2,password;
19-
ERROR 28000: Access denied for user 'u2'@'localhost' (using password: YES)
20-
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
21-
ERROR 28000: Access denied for user 'u2'@'localhost' (using password: NO)
22-
ERROR 28000: Access denied for user 'u2'@'localhost' (using password: YES)
19+
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
20+
ERROR 28000: Access denied for user 'u1'@'localhost' (using password: NO)
21+
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
22+
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
2323
delete from mysql.user where plugin = 'mysql_old_password';
2424
flush privileges;

mysql-test/main/failed_auth_3909.test

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,24 @@ insert ignore mysql.user (user,plugin) values ('foo','mysql_old_password'),('bar
1111
flush privileges;
1212

1313
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
14-
--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
14+
--error ER_ACCESS_DENIED_ERROR
1515
connect (fail,localhost,u1);
1616

1717
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
18-
--error ER_ACCESS_DENIED_ERROR
18+
--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
1919
connect (fail,localhost,u2);
2020

2121
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
22-
--error ER_ACCESS_DENIED_ERROR
22+
--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
2323
connect (fail,localhost,u2,password);
2424

25-
--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
25+
--error ER_ACCESS_DENIED_ERROR
2626
change_user u1;
2727

28-
--error ER_ACCESS_DENIED_ERROR
28+
--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
2929
change_user u2;
3030

31-
--error ER_ACCESS_DENIED_ERROR
31+
--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
3232
change_user u2,password;
3333

3434
delete from mysql.user where plugin = 'mysql_old_password';

mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Con4 is alive
118118
Con4 is alive
119119
select current_user();
120120
current_user()
121-
root@192.0.2.4
121+
root@santa.claus.ipv4.example.com
122122
disconnect con4;
123123
connection default;
124124
"Dumping performance_schema.host_cache"
@@ -155,7 +155,7 @@ Con5 is alive
155155
Con5 is alive
156156
select current_user();
157157
current_user()
158-
root@192.0.2.4
158+
root@santa.claus.ipv4.example.com
159159
disconnect con5;
160160
connection default;
161161
"Dumping performance_schema.host_cache"

mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Con4 is alive
118118
Con4 is alive
119119
select current_user();
120120
current_user()
121-
root@2001:db8::6:6
121+
root@santa.claus.ipv6.example.com
122122
disconnect con4;
123123
connection default;
124124
"Dumping performance_schema.host_cache"
@@ -155,7 +155,7 @@ Con5 is alive
155155
Con5 is alive
156156
select current_user();
157157
current_user()
158-
root@2001:db8::6:6
158+
root@santa.claus.ipv6.example.com
159159
disconnect con5;
160160
connection default;
161161
"Dumping performance_schema.host_cache"

0 commit comments

Comments
 (0)