[Commits] Rev 4005: MDEV-4846 SQL_ERROR_LOG plugin doesn't log errors produced with SIGNAL. in file:///home/hf/wmar/mdev-4846/

holyfoot at askmonty.org holyfoot at askmonty.org
Sun Dec 15 11:44:27 EET 2013


At file:///home/hf/wmar/mdev-4846/

------------------------------------------------------------
revno: 4005
revision-id: holyfoot at askmonty.org-20131215083023-uymhwldevnxa7dll
parent: sergii at pisem.net-20131213120038-hjea4r5zp7sjuq8l
committer: Alexey Botchkov <holyfoot at askmonty.org>
branch nick: mdev-4846
timestamp: Sun 2013-12-15 12:30:23 +0400
message:
  MDEV-4846 SQL_ERROR_LOG plugin doesn't log errors produced with SIGNAL.
          Added code to the SIGNAL and RESIGNAL implementation
          to notify plugins about the errors raised.
-------------- next part --------------
=== modified file 'sql/sql_signal.cc'
--- a/sql/sql_signal.cc	2013-01-15 18:13:32 +0000
+++ b/sql/sql_signal.cc	2013-12-15 08:30:23 +0000
@@ -17,6 +17,7 @@
 #include "sp_head.h"
 #include "sp_pcontext.h"
 #include "sp_rcontext.h"
+#include "sql_audit.h"
 #include "sql_signal.h"
 
 /*
@@ -431,6 +432,9 @@ bool Signal_common::raise_condition(THD 
   DBUG_ASSERT((cond->m_level == MYSQL_ERROR::WARN_LEVEL_WARN) ||
               (cond->m_level == MYSQL_ERROR::WARN_LEVEL_ERROR));
 
+  if (cond->m_level == MYSQL_ERROR::WARN_LEVEL_ERROR)
+    mysql_audit_general(thd, MYSQL_AUDIT_GENERAL_ERROR,
+                        cond->m_sql_errno, cond->get_message_text());
   MYSQL_ERROR *raised= NULL;
   raised= thd->raise_condition(cond->get_sql_errno(),
                                cond->get_sqlstate(),
@@ -488,6 +492,9 @@ bool Resignal_statement::execute(THD *th
 
   if (! thd->spcont || ! (signaled= thd->spcont->raised_condition()))
   {
+    mysql_audit_general(thd, MYSQL_AUDIT_GENERAL_ERROR,
+                        ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER,
+                        ER(ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER));
     thd->raise_error(ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER);
     DBUG_RETURN(result);
   }



More information about the commits mailing list