summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <sergey.vojtovich@oracle.com>2010-12-14 17:34:23 +0300
committerSergey Vojtovich <sergey.vojtovich@oracle.com>2010-12-14 17:34:23 +0300
commit9b6ba6a99aa353efd2da8dc8493aa932cc7523c2 (patch)
treea01ebb52ef2a45d385cf45850e61c8b584256240 /sql/sql_parse.cc
parentf09e9efe8521bc31495c93f9106d792746ed353b (diff)
downloadmariadb-git-9b6ba6a99aa353efd2da8dc8493aa932cc7523c2.tar.gz
WL#5571 - Audit interface: MYSQL_AUDIT_GENERAL_STATUS event
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 3d5f99c8953..cdeaeee18c1 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -937,6 +937,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
#endif
case COM_CHANGE_USER:
{
+ bool rc;
status_var_increment(thd->status_var.com_other);
thd->change_user();
@@ -956,7 +957,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
CHARSET_INFO *save_character_set_results=
thd->variables.character_set_results;
- if (acl_authenticate(thd, 0, packet_length))
+ rc= acl_authenticate(thd, 0, packet_length);
+ MYSQL_AUDIT_NOTIFY_CONNECTION_CHANGE_USER(thd);
+ if (rc)
{
my_free(thd->security_ctx->user);
*thd->security_ctx= save_security_ctx;
@@ -1395,6 +1398,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
if (!thd->is_error() && !thd->killed_errno())
mysql_audit_general(thd, MYSQL_AUDIT_GENERAL_RESULT, 0, 0);
+ mysql_audit_general(thd, MYSQL_AUDIT_GENERAL_STATUS,
+ thd->stmt_da->is_error() ? thd->stmt_da->sql_errno() : 0,
+ command_name[command].str);
+
log_slow_statement(thd);
thd_proc_info(thd, "cleaning up");