mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-7500 thread_handling option in my.cnf is not passing "connect events" to audit plugin.
The MYSQL_AUDIT_NOTIFY_CONNECTION_CONNECT() call moved to the login_connection() function. So that it'll be invoked in any thread handling mode.
This commit is contained in:
@ -1017,7 +1017,7 @@ bool setup_connection_thread_globals(THD *thd)
|
||||
bool login_connection(THD *thd)
|
||||
{
|
||||
NET *net= &thd->net;
|
||||
int error;
|
||||
int error= 0;
|
||||
DBUG_ENTER("login_connection");
|
||||
DBUG_PRINT("info", ("login_connection called by thread %lu",
|
||||
thd->thread_id));
|
||||
@ -1036,7 +1036,8 @@ bool login_connection(THD *thd)
|
||||
my_sleep(1000); /* must wait after eof() */
|
||||
#endif
|
||||
statistic_increment(aborted_connects,&LOCK_status);
|
||||
DBUG_RETURN(1);
|
||||
error=1;
|
||||
goto exit;
|
||||
}
|
||||
/* Connect completed, set read/write timeouts back to default */
|
||||
my_net_set_read_timeout(net, thd->variables.net_read_timeout);
|
||||
@ -1046,10 +1047,13 @@ bool login_connection(THD *thd)
|
||||
if (increment_connection_count(thd, TRUE))
|
||||
{
|
||||
my_error(ER_OUTOFMEMORY, MYF(0), 2*sizeof(USER_STATS));
|
||||
DBUG_RETURN(1);
|
||||
error= 1;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
DBUG_RETURN(0);
|
||||
exit:
|
||||
MYSQL_AUDIT_NOTIFY_CONNECTION_CONNECT(thd);
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
|
||||
@ -1187,7 +1191,6 @@ bool thd_prepare_connection(THD *thd)
|
||||
bool rc;
|
||||
lex_start(thd);
|
||||
rc= login_connection(thd);
|
||||
MYSQL_AUDIT_NOTIFY_CONNECTION_CONNECT(thd);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
|
Reference in New Issue
Block a user