summaryrefslogtreecommitdiff
path: root/sql/sql_audit.cc
diff options
context:
space:
mode:
authorEugene Kosov <claprix@yandex.ru>2019-06-23 19:07:20 +0300
committerEugene Kosov <claprix@yandex.ru>2019-06-23 20:33:13 +0300
commitddeeb42e0b1adc2158fa0baec70d84a0ae3e5828 (patch)
tree148912bb6b066faa1b3e56e2887a57cbe11b875c /sql/sql_audit.cc
parent75833ef9c51e3a2cc57fea048e55ed5670df7b0d (diff)
parentcf40393471b10ca68cc1d2804c22ab9203900978 (diff)
downloadmariadb-git-ddeeb42e0b1adc2158fa0baec70d84a0ae3e5828.tar.gz
Merge 10.1 into 10.2
Diffstat (limited to 'sql/sql_audit.cc')
-rw-r--r--sql/sql_audit.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/sql/sql_audit.cc b/sql/sql_audit.cc
index 73871988d03..aed0457e1ff 100644
--- a/sql/sql_audit.cc
+++ b/sql/sql_audit.cc
@@ -118,12 +118,27 @@ void mysql_audit_acquire_plugins(THD *thd, ulong *event_class_mask)
{
plugin_foreach(thd, acquire_plugins, MYSQL_AUDIT_PLUGIN, event_class_mask);
add_audit_mask(thd->audit_class_mask, event_class_mask);
+ thd->audit_plugin_version= global_plugin_version;
}
DBUG_VOID_RETURN;
}
/**
+ Check if there were changes in the state of plugins
+ so we need to do the mysql_audit_release asap.
+
+ @param[in] thd
+
+*/
+
+my_bool mysql_audit_release_required(THD *thd)
+{
+ return thd && (thd->audit_plugin_version != global_plugin_version);
+}
+
+
+/**
Release any resources associated with the current thd.
@param[in] thd
@@ -158,6 +173,7 @@ void mysql_audit_release(THD *thd)
/* Reset the state of thread values */
reset_dynamic(&thd->audit_class_plugins);
bzero(thd->audit_class_mask, sizeof(thd->audit_class_mask));
+ thd->audit_plugin_version= -1;
}