Skip to content

Commit 0031f4a

Browse files
committed
MDEV-35663 Sporadic connection failures during FLUSH PRIVILEGES
during FLUSH PRIVILEGES, allow_all_hosts temporarily goes out of sync with acl_check_hosts and acl_wild_hosts. As it's tested in acl_check_host() without a mutex, let's re-test it under a mutex to make sure the value is correct. Note that it's just an optimization and it's ok to see outdated allow_all_hosts value here.
1 parent 9f9072c commit 0031f4a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sql/sql_acl.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3948,7 +3948,8 @@ bool acl_check_host(const char *host, const char *ip)
39483948
return 0;
39493949
mysql_mutex_lock(&acl_cache->lock);
39503950

3951-
if ((host && my_hash_search(&acl_check_hosts,(uchar*) host,strlen(host))) ||
3951+
if (allow_all_hosts ||
3952+
(host && my_hash_search(&acl_check_hosts,(uchar*) host,strlen(host))) ||
39523953
(ip && my_hash_search(&acl_check_hosts,(uchar*) ip, strlen(ip))))
39533954
{
39543955
mysql_mutex_unlock(&acl_cache->lock);

0 commit comments

Comments
 (0)