diff options
author | Sergei Golubchik <serg@mariadb.org> | 2022-05-08 15:02:19 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2022-05-08 23:03:08 +0200 |
commit | a70a1cf3f4ed10c9d9194b2b8df6b6f08551a937 (patch) | |
tree | 517124ec5059f48bff1e02b934355e8162183efc /plugin | |
parent | 40b8f3ec1a76fc23eb6bf9c5a8fef1debcbf5843 (diff) | |
parent | 79660e59ee8fcd23f928c72dc77682b875bd58ce (diff) | |
download | mariadb-git-a70a1cf3f4ed10c9d9194b2b8df6b6f08551a937.tar.gz |
Merge branch '10.3' into 10.4
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/server_audit/server_audit.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c index b53ecad55fb..86f38edf724 100644 --- a/plugin/server_audit/server_audit.c +++ b/plugin/server_audit/server_audit.c @@ -16,7 +16,7 @@ #define PLUGIN_VERSION 0x104 -#define PLUGIN_STR_VERSION "1.4.13" +#define PLUGIN_STR_VERSION "1.4.14" #define _my_thread_var loc_thread_var @@ -946,7 +946,19 @@ static unsigned long long query_counter= 1; static struct connection_info *get_loc_info(MYSQL_THD thd) { + /* + This is the original code and supposed to be returned + bach to this as the MENT-1438 is finally understood/resolved. return (struct connection_info *) THDVAR(thd, loc_info); + */ + struct connection_info *ci= (struct connection_info *) THDVAR(thd, loc_info); + if ((size_t) ci->user_length > sizeof(ci->user)) + { + ci->user_length= 0; + ci->host_length= 0; + ci->ip_length= 0; + } + return ci; } @@ -1374,6 +1386,16 @@ static size_t log_header(char *message, size_t message_len, host= userip; } + /* + That was added to find the possible cause of the MENT-1438. + Supposed to be removed after that. + */ + if (username_len > 1024) + { + username= "unknown_user"; + username_len= (unsigned int) strlen(username); + } + if (output_type == OUTPUT_SYSLOG) return my_snprintf(message, message_len, "%.*s,%.*s,%.*s,%d,%lld,%s", |