[Commits] Rev 4005: MDEV-5419 no audit events for warnings converted to errors in the strict mode. in file:///home/hf/wmar/mdev-5419/

holyfoot at askmonty.org holyfoot at askmonty.org
Sun Dec 15 14:48:08 EET 2013


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

------------------------------------------------------------
revno: 4005
revision-id: holyfoot at askmonty.org-20131215112825-1a5p7fa6mwdoin26
parent: sergii at pisem.net-20131213120038-hjea4r5zp7sjuq8l
committer: Alexey Botchkov <holyfoot at askmonty.org>
branch nick: mdev-5419
timestamp: Sun 2013-12-15 15:28:25 +0400
message:
  MDEV-5419 no audit events for warnings converted to errors in the strict mode.
          Plugins get error notifications only when my_message_sql() is called.
          But errors are launched with THD::raise_condition() calls in other
          places. These are push_warning(), implementations of SIGNAL and
          RESIGNAL commands.
          So it makes sence to notify plugins there in THD::raise_condition().
-------------- next part --------------
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2013-11-25 17:38:01 +0000
+++ b/sql/mysqld.cc	2013-12-15 11:28:25 +0000
@@ -3165,7 +3165,6 @@ void my_message_sql(uint error, const ch
   DBUG_ASSERT(str != NULL);
   DBUG_ASSERT(error != 0);
 
-  mysql_audit_general(thd, MYSQL_AUDIT_GENERAL_ERROR, error, str);
   if (MyFlags & ME_JUST_INFO)
   {
     level= MYSQL_ERROR::WARN_LEVEL_NOTE;
@@ -3188,6 +3187,8 @@ void my_message_sql(uint error, const ch
       thd->is_fatal_error= 1;
     (void) thd->raise_condition(error, NULL, level, str);
   }
+  else
+    mysql_audit_general(0, MYSQL_AUDIT_GENERAL_ERROR, error, str);
 
   /* When simulating OOM, skip writing to error log to avoid mtr errors */
   DBUG_EXECUTE_IF("simulate_out_of_memory", DBUG_VOID_RETURN;);

=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc	2013-11-19 12:16:25 +0000
+++ b/sql/sql_class.cc	2013-12-15 11:28:25 +0000
@@ -1145,6 +1145,7 @@ MYSQL_ERROR* THD::raise_condition(uint s
     got_warning= 1;
     break;
   case MYSQL_ERROR::WARN_LEVEL_ERROR:
+    mysql_audit_general(this, MYSQL_AUDIT_GENERAL_ERROR, sql_errno, msg);
     break;
   default:
     DBUG_ASSERT(FALSE);



More information about the commits mailing list