diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2019-05-19 17:00:31 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2019-05-21 17:55:09 +0400 |
commit | a61baa7a2573719116d07812f274957590c4cb6b (patch) | |
tree | 318edd871acf13cdd5abbb279a8066bc280a88af /sql/sql_acl.cc | |
parent | 0bee021b78af8d45b2510a79244b9925032c4765 (diff) | |
download | mariadb-git-a61baa7a2573719116d07812f274957590c4cb6b.tar.gz |
Maintain connection_count atomically
Removed LOCK_connection_count.
Removed duplicate denied_connections and connection_errors_max_connection
increment from create_new_thread(). Another increment done by
CONNECT::close_with_error().
Simplified away CONNECT::thread_count_incremented. Now close_with_error()
is always called with connection_count incremented.
Part of MDEV-19515 - Improve connect speed
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 27f2a985931..2841e11d46c 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -13947,11 +13947,7 @@ bool acl_authenticate(THD *thd, uint com_change_user_pkt_len) if (command == COM_CONNECT && !(thd->main_security_ctx.master_access & SUPER_ACL)) { - mysql_mutex_lock(&LOCK_connection_count); - bool count_ok= (*thd->scheduler->connection_count <= - *thd->scheduler->max_connections); - mysql_mutex_unlock(&LOCK_connection_count); - if (!count_ok) + if (*thd->scheduler->connection_count > *thd->scheduler->max_connections) { // too many connections my_error(ER_CON_COUNT_ERROR, MYF(0)); DBUG_RETURN(1); |