MENT-1019.

Audit-plugin related fixes.
This commit is contained in:
Alexey Botchkov 2021-08-11 23:00:37 +04:00
commit 38b79d7295
3 changed files with 9 additions and 4 deletions

View file

@ -155,7 +155,7 @@ void mysql_audit_general(THD *thd, uint event_subtype,
DBUG_ENTER("mysql_audit_general");
if (mysql_audit_general_enabled())
{
char user_buff[MAX_USER_HOST_SIZE];
char user_buff[MAX_USER_HOST_SIZE+1];
mysql_event_general event;
event.event_subclass= event_subtype;

View file

@ -3442,6 +3442,11 @@ static void mysql_stmt_execute_common(THD *thd,
stmt_id == LAST_STMT_ID, read_types))
{
my_error(ER_MALFORMED_PACKET, MYF(0));
/*
Let's set the thd->query_string so the audit plugin
can report the executed query that failed.
*/
thd->set_query_inner(stmt->query_string);
DBUG_VOID_RETURN;
}