summaryrefslogtreecommitdiff
path: root/sql/sql_audit.cc
diff options
context:
space:
mode:
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 e8a00abf30b..ed175ae4865 100644
--- a/sql/sql_audit.cc
+++ b/sql/sql_audit.cc
@@ -119,12 +119,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
@@ -159,6 +174,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;
}