summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-05-29 11:32:46 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-05-29 11:32:46 +0300
commit90a91936852368774559a3ef2660e63e1e6f50e3 (patch)
tree97004f253bea0db37606928b592ae3bc70fa6672 /plugin
parentfcb68ffe3dfb1c841852bd62a9aac9708888f4e9 (diff)
parent6eefeb6fea05ff17d010d173ef244a1d92078d71 (diff)
downloadmariadb-git-90a91936852368774559a3ef2660e63e1e6f50e3.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'plugin')
-rw-r--r--plugin/server_audit/server_audit.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c
index ee6fb8353e3..a2299812c05 100644
--- a/plugin/server_audit/server_audit.c
+++ b/plugin/server_audit/server_audit.c
@@ -15,7 +15,7 @@
#define PLUGIN_VERSION 0x104
-#define PLUGIN_STR_VERSION "1.4.5"
+#define PLUGIN_STR_VERSION "1.4.6"
#define _my_thread_var loc_thread_var
@@ -2024,10 +2024,14 @@ void auditing(MYSQL_THD thd, unsigned int event_class, const void *ev)
update_connection_info(cn, event_class, ev, &after_action);
if (!logging)
+ {
+ if (cn)
+ cn->log_always= 0;
goto exit_func;
+ }
if (event_class == MYSQL_AUDIT_GENERAL_CLASS && FILTER(EVENT_QUERY) &&
- cn && do_log_user(cn->user))
+ cn && (cn->log_always || do_log_user(cn->user)))
{
const struct mysql_event_general *event =
(const struct mysql_event_general *) ev;
@@ -2040,6 +2044,7 @@ void auditing(MYSQL_THD thd, unsigned int event_class, const void *ev)
{
log_statement(cn, event, "QUERY");
cn->query_length= 0; /* So the log_current_query() won't log this again. */
+ cn->log_always= 0;
}
}
else if (event_class == MYSQL_AUDIT_TABLE_CLASS && FILTER(EVENT_TABLE) && cn)
@@ -2110,8 +2115,6 @@ exit_func:
break;
}
}
- if (cn)
- cn->log_always= 0;
flogger_mutex_unlock(&lock_operations);
}
@@ -2556,8 +2559,7 @@ static void log_current_query(MYSQL_THD thd)
if (!thd)
return;
cn= get_loc_info(thd);
- if (!ci_needs_setup(cn) && cn->query_length &&
- FILTER(EVENT_QUERY) && do_log_user(cn->user))
+ if (!ci_needs_setup(cn) && cn->query_length)
{
cn->log_always= 1;
log_statement_ex(cn, cn->query_time, thd_get_thread_id(thd),
@@ -2817,6 +2819,7 @@ static void update_logging(MYSQL_THD thd,
{
CLIENT_ERROR(1, "Logging was disabled.", MYF(ME_JUST_WARNING));
}
+ mark_always_logged(thd);
}
else
{