summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r--sql/sql_prepare.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index b1a5a3e7199..a6fb17eaa74 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -3445,6 +3445,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;
}