diff options
author | Sergey Vojtovich <sergey.vojtovich@oracle.com> | 2011-06-03 11:27:11 +0400 |
---|---|---|
committer | Sergey Vojtovich <sergey.vojtovich@oracle.com> | 2011-06-03 11:27:11 +0400 |
commit | 95963dd20a06d034844b216b2260bfc15be3a75f (patch) | |
tree | 97873a52ebb2bbad7163dd1f540943a267995794 /plugin | |
parent | 9e2b7fa7d5f0cbe4920be5567314b6de1af660a4 (diff) | |
download | mariadb-git-95963dd20a06d034844b216b2260bfc15be3a75f.tar.gz |
BUG#12611785 - AUDIT INTERFACE STRICT-ALIASING WARNINGS
The types mysql_event_general/mysql_event_connection are
being cast to the incompatible type mysql_event. The way
mysql_event and the other types are designed are prone to
strict aliasing violations and can break things depending
on how compilers optimizes this code.
This patch fixes audit interface, so it confirms to strict-
aliasing rules. It introduces incompatible changes to audit
interface:
- mysql_event type has been removed;
- event_class has been removed from mysql_event_generic and
mysql_event_connection types;
- st_mysql_audit::event_notify() second argument is event_class;
- st_mysql_audit::event_notify() third argument is event of type
(const void *).
"Writing Audit Plugins" section of manual should be updated:
http://dev.mysql.com/doc/refman/5.5/en/writing-audit-plugins.html
include/mysql/plugin_audit.h:
event_class has been moved out of mysql_event types.
include/mysql/plugin_audit.h.pp:
event_class has been moved out of mysql_event types.
plugin/audit_null/audit_null.c:
event_class has been moved out of mysql_event types.
sql/sql_audit.cc:
event_class has been moved out of mysql_event types.
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/audit_null/audit_null.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugin/audit_null/audit_null.c b/plugin/audit_null/audit_null.c index 4d231d3e39b..161bd1cea70 100644 --- a/plugin/audit_null/audit_null.c +++ b/plugin/audit_null/audit_null.c @@ -81,11 +81,12 @@ static int audit_null_plugin_deinit(void *arg __attribute__((unused))) */ static void audit_null_notify(MYSQL_THD thd __attribute__((unused)), - const struct mysql_event *event) + unsigned int event_class, + const void *event) { /* prone to races, oh well */ number_of_calls++; - if (event->event_class == MYSQL_AUDIT_GENERAL_CLASS) + if (event_class == MYSQL_AUDIT_GENERAL_CLASS) { const struct mysql_event_general *event_general= (const struct mysql_event_general *) event; |