summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2014-01-23 22:21:02 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2014-01-23 22:21:02 +0400
commit8f3e1bfc92f725813a6c82f9be2a601c9701d712 (patch)
tree5900015b4cde3c447663c9255c2116efd39f2f4e /sql/mysqld.cc
parenteb88c905e68ee5d3ac0b5decc083de9e06c4eb0b (diff)
downloadmariadb-git-8f3e1bfc92f725813a6c82f9be2a601c9701d712.tar.gz
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().
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 73995980ffc..b41cb8126f1 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -3165,7 +3165,6 @@ void my_message_sql(uint error, const char *str, myf MyFlags)
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 char *str, myf MyFlags)
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;);