diff options
author | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-01-26 05:39:48 +0100 |
---|---|---|
committer | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-01-26 05:39:48 +0100 |
commit | 9129685e5103bbe23b1f66dc89b0f994c52600b9 (patch) | |
tree | 12bd4cc946e8564dee1b5fb2030283eec5878f24 /sql/log.cc | |
parent | 809e20f2d7875d22374e9209902c38d0b93e3cec (diff) | |
parent | f8a5a1284b4e37ce2b5ab9ef8dfba8522366bd11 (diff) | |
download | mariadb-git-9129685e5103bbe23b1f66dc89b0f994c52600b9.tar.gz |
merge, add plugin/audit_null/CMakeLists.txt
Diffstat (limited to 'sql/log.cc')
-rw-r--r-- | sql/log.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sql/log.cc b/sql/log.cc index fdc763df0de..40437bdc721 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -28,6 +28,7 @@ #include "sql_repl.h" #include "rpl_filter.h" #include "rpl_rli.h" +#include "sql_audit.h" #include <my_dir.h> #include <stdarg.h> @@ -42,7 +43,6 @@ /* max size of the log message */ #define MAX_LOG_BUFFER_SIZE 1024 -#define MAX_USER_HOST_SIZE 512 #define MAX_TIME_SIZE 32 #define MY_OFF_T_UNDEF (~(my_off_t)0UL) @@ -1157,7 +1157,6 @@ bool LOGGER::general_log_write(THD *thd, enum enum_server_command command, bool error= FALSE; Log_event_handler **current_handler= general_log_handler_list; char user_host_buff[MAX_USER_HOST_SIZE + 1]; - Security_context *sctx= thd->security_ctx; uint user_host_len= 0; time_t current_time; @@ -1169,14 +1168,16 @@ bool LOGGER::general_log_write(THD *thd, enum enum_server_command command, unlock(); return 0; } - user_host_len= strxnmov(user_host_buff, MAX_USER_HOST_SIZE, - sctx->priv_user ? sctx->priv_user : "", "[", - sctx->user ? sctx->user : "", "] @ ", - sctx->host ? sctx->host : "", " [", - sctx->ip ? sctx->ip : "", "]", NullS) - - user_host_buff; + user_host_len= make_user_name(thd, user_host_buff); current_time= my_time(0); + + mysql_audit_general_log(thd, current_time, + user_host_buff, user_host_len, + command_name[(uint) command].str, + command_name[(uint) command].length, + query, query_length); + while (*current_handler) error|= (*current_handler++)-> log_general(thd, current_time, user_host_buff, |