summaryrefslogtreecommitdiff
path: root/sql/sql_connect.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2015-06-08 12:09:13 +0500
committerAlexey Botchkov <holyfoot@askmonty.org>2015-06-08 12:09:13 +0500
commit69ed429aff13f656c9a62b76d07c78157f17033b (patch)
treeca92b0db36f59b53ea9f12294339ef1945ccdfa3 /sql/sql_connect.cc
parent1ae05db49c433b6cd3d0172fa1f4421632b6f2ac (diff)
downloadmariadb-git-69ed429aff13f656c9a62b76d07c78157f17033b.tar.gz
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.
Diffstat (limited to 'sql/sql_connect.cc')
-rw-r--r--sql/sql_connect.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index 041d2a545df..16b53da1ebd 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -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;