Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport two commits for MDEV-28177 and MDEV-28429 #3

Open
wants to merge 2 commits into
base: mysql-8.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion plugin/server_audit/server_audit.cc
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

#define PLUGIN_VERSION 0x104
#define PLUGIN_STR_VERSION "1.4.11"
#define PLUGIN_STR_VERSION "1.4.14"

#define _my_thread_var loc_thread_var

@@ -849,7 +849,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;
}


@@ -1221,6 +1233,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 snprintf(message, message_len,
"%.*s,%.*s,%.*s,%d,%lld,%s",
@@ -1962,6 +1984,9 @@ int get_db_mysql57(MYSQL_THD thd, char **name, size_t *len)
#ifdef __x86_64__
db_off= 608;
db_len_off= 616;
#elif __aarch64__
db_off= 632;
db_len_off= 640;
#else
db_off= 0;
db_len_off= 0;
@@ -1972,6 +1997,9 @@ int get_db_mysql57(MYSQL_THD thd, char **name, size_t *len)
#ifdef __x86_64__
db_off= 536;
db_len_off= 544;
#elif __aarch64__
db_off= 552;
db_len_off= 560;
#else
db_off= 0;
db_len_off= 0;