summaryrefslogtreecommitdiff
path: root/sql/sql_audit.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-12-27 13:05:06 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-12-27 15:14:48 +0200
commit5ab70e7f68ba9659dbdd8c71759cfe99ee90ebf2 (patch)
treecde569f712505f981e7a43f01e82c600e282c88c /sql/sql_audit.h
parentee9a19fb054085fcea006a25ec957e0d5cb01ce8 (diff)
parent16bce0f6fe6bcad0091dc45a97a8ac7b33fe9d44 (diff)
downloadmariadb-git-5ab70e7f68ba9659dbdd8c71759cfe99ee90ebf2.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'sql/sql_audit.h')
-rw-r--r--sql/sql_audit.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/sql/sql_audit.h b/sql/sql_audit.h
index 59cced13b0a..97317203e34 100644
--- a/sql/sql_audit.h
+++ b/sql/sql_audit.h
@@ -284,7 +284,9 @@ void mysql_audit_notify_connection_change_user(THD *thd)
}
static inline
-void mysql_audit_external_lock(THD *thd, TABLE_SHARE *share, int lock)
+void mysql_audit_external_lock_ex(THD *thd, my_thread_id thread_id,
+ const char *user, const char *host, const char *ip, query_id_t query_id,
+ TABLE_SHARE *share, int lock)
{
if (lock != F_UNLCK && mysql_audit_table_enabled())
{
@@ -293,25 +295,33 @@ void mysql_audit_external_lock(THD *thd, TABLE_SHARE *share, int lock)
event.event_subclass= MYSQL_AUDIT_TABLE_LOCK;
event.read_only= lock == F_RDLCK;
- event.thread_id= (unsigned long)thd->thread_id;
- event.user= sctx->user;
+ event.thread_id= (unsigned long)thread_id;
+ event.user= user;
event.priv_user= sctx->priv_user;
event.priv_host= sctx->priv_host;
event.external_user= sctx->external_user;
event.proxy_user= sctx->proxy_user;
- event.host= sctx->host;
- event.ip= sctx->ip;
+ event.host= host;
+ event.ip= ip;
event.database= share->db;
event.table= share->table_name;
event.new_database= null_clex_str;
event.new_table= null_clex_str;
- event.query_id= thd->query_id;
+ event.query_id= query_id;
mysql_audit_notify(thd, MYSQL_AUDIT_TABLE_CLASS, &event);
}
}
static inline
+void mysql_audit_external_lock(THD *thd, TABLE_SHARE *share, int lock)
+{
+ mysql_audit_external_lock_ex(thd, thd->thread_id, thd->security_ctx->user,
+ thd->security_ctx->host, thd->security_ctx->ip, thd->query_id,
+ share, lock);
+}
+
+static inline
void mysql_audit_create_table(TABLE *table)
{
if (mysql_audit_table_enabled())