summaryrefslogtreecommitdiff
path: root/sql/sql_audit.h
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2013-09-09 16:56:35 +0500
committerAlexey Botchkov <holyfoot@askmonty.org>2013-09-09 16:56:35 +0500
commit92265da9d77bc750eb234cfac9d6239675078983 (patch)
treef6ca280d04ecfdbeaf2a773f654d002231f2002f /sql/sql_audit.h
parent1e24cdc85be16d08bb079979ab5131e311542b80 (diff)
downloadmariadb-git-92265da9d77bc750eb234cfac9d6239675078983.tar.gz
MDEV-4472 Audit-plugin. Server-related part of the task.
file_logger became the service. Data like query_id now are sent to the audit plugin. Fix for MDEV-4770 ported from 10.0. Fix added for the read_maria_plugin_info(). Log rotation can be disabled with 'set rotations=0'.
Diffstat (limited to 'sql/sql_audit.h')
-rw-r--r--sql/sql_audit.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/sql_audit.h b/sql/sql_audit.h
index 75b338a16c8..2e932a53d07 100644
--- a/sql/sql_audit.h
+++ b/sql/sql_audit.h
@@ -93,7 +93,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);
}
}
@@ -139,7 +140,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);
}
}
@@ -162,7 +164,11 @@ void mysql_audit_general(THD *thd, uint event_subtype,
#define MYSQL_AUDIT_NOTIFY_CONNECTION_DISCONNECT(thd, errcode)\
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)
+ (errcode), (thd)->thread_id, (thd)->security_ctx->user,\
+ (thd)->security_ctx->user ? strlen((thd)->security_ctx->user) : 0,\
+ 0, 0, 0, 0, 0, 0, (thd)->security_ctx->host,\
+ (thd)->security_ctx->host ? strlen((thd)->security_ctx->host) : 0,\
+ 0, 0, 0, 0)
#define MYSQL_AUDIT_NOTIFY_CONNECTION_CHANGE_USER(thd) mysql_audit_notify(\
(thd), MYSQL_AUDIT_CONNECTION_CLASS, MYSQL_AUDIT_CONNECTION_CHANGE_USER,\