1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Fix for Bug#33507: Event scheduler creates more threads

than max_connections -- which results in user lockout.

The problem was that the variable thread_count that contains
the number of active threads was interpreted as a number of
active connections.

The fix is to introduce a new counter for active connections.
This commit is contained in:
anozdrin/alik@quad.
2008-03-12 17:44:40 +03:00
parent e57679c204
commit 18125abf93
5 changed files with 231 additions and 14 deletions

View File

@ -402,10 +402,11 @@ check_user(THD *thd, enum enum_server_command command,
if (check_count)
{
VOID(pthread_mutex_lock(&LOCK_thread_count));
bool count_ok= thread_count <= max_connections + delayed_insert_threads
|| (thd->main_security_ctx.master_access & SUPER_ACL);
VOID(pthread_mutex_unlock(&LOCK_thread_count));
pthread_mutex_lock(&LOCK_connection_count);
bool count_ok= connection_count <= max_connections ||
(thd->main_security_ctx.master_access & SUPER_ACL);
VOID(pthread_mutex_unlock(&LOCK_connection_count));
if (!count_ok)
{ // too many connections
my_error(ER_CON_COUNT_ERROR, MYF(0));
@ -930,7 +931,7 @@ bool setup_connection_thread_globals(THD *thd)
*/
bool login_connection(THD *thd)
static bool login_connection(THD *thd)
{
NET *net= &thd->net;
int error;
@ -968,7 +969,7 @@ bool login_connection(THD *thd)
This mainly updates status variables
*/
void end_connection(THD *thd)
static void end_connection(THD *thd)
{
NET *net= &thd->net;
plugin_thdvar_cleanup(thd);