summaryrefslogtreecommitdiff
path: root/sql/sql_audit.h
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-09-21 10:14:42 +0200
committerSergei Golubchik <sergii@pisem.net>2013-09-21 10:14:42 +0200
commit9af177042ed0e297b8f26f2c2f8ae00b3a814a90 (patch)
tree0d8d2fab7ebeb02f3c25c00ac1543754b625bde8 /sql/sql_audit.h
parenta6add4ff43a905cee1bfd00b2ec2d276018866ce (diff)
parent2fe0836eed16ce5809c34064893681f12c77da9f (diff)
downloadmariadb-git-9af177042ed0e297b8f26f2c2f8ae00b3a814a90.tar.gz
10.0-base merge.
Partitioning/InnoDB changes are *not* merged (they'll come from 5.6) TokuDB does not compile (not updated to 10.0 SE API)
Diffstat (limited to 'sql/sql_audit.h')
-rw-r--r--sql/sql_audit.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/sql/sql_audit.h b/sql/sql_audit.h
index 1c7d6a1c224..bf8d837580a 100644
--- a/sql/sql_audit.h
+++ b/sql/sql_audit.h
@@ -99,7 +99,8 @@ void mysql_audit_general_log(THD *thd, time_t time,
mysql_audit_notify(thd, MYSQL_AUDIT_GENERAL_CLASS, MYSQL_AUDIT_GENERAL_LOG,
0, time, user, userlen, cmd, cmdlen,
- query, querylen, clientcs, 0);
+ query, querylen, clientcs, (ha_rows) 0,
+ thd->db, thd->db_length);
}
}
@@ -145,7 +146,8 @@ void mysql_audit_general(THD *thd, uint event_subtype,
mysql_audit_notify(thd, MYSQL_AUDIT_GENERAL_CLASS, event_subtype,
error_code, time, user, userlen, msg, msglen,
- query.str(), query.length(), query.charset(), rows);
+ query.str(), query.length(), query.charset(), rows,
+ thd->db, thd->db_length);
}
}
@@ -176,10 +178,18 @@ void mysql_audit_notify_connection_disconnect(THD *thd, int errcode)
{
if (mysql_audit_connection_enabled())
{
+ const Security_context *sctx= thd->security_ctx;
mysql_audit_notify(thd, MYSQL_AUDIT_CONNECTION_CLASS,
MYSQL_AUDIT_CONNECTION_DISCONNECT,
errcode, thd->thread_id,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ sctx->user, sctx->user ? strlen(sctx->user) : 0,
+ sctx->priv_user, strlen(sctx->priv_user),
+ sctx->external_user,
+ sctx->external_user ? strlen(sctx->external_user) : 0,
+ sctx->proxy_user, strlen(sctx->proxy_user),
+ sctx->host, sctx->host ? strlen(sctx->host) : 0,
+ sctx->ip, sctx->ip ? strlen(sctx->ip) : 0,
+ thd->db, thd->db ? strlen(thd->db) : 0);
}
}