summaryrefslogtreecommitdiff
path: root/sql/sql_audit.h
diff options
context:
space:
mode:
authorMichael Widenius <monty@mariadb.org>2014-03-13 16:43:11 +0200
committerMichael Widenius <monty@mariadb.org>2014-03-13 16:43:11 +0200
commite63c03db8d620765b7a1bc769150a04a230b9353 (patch)
tree889476c5e3cf759c2abde780f91e1c61c3064492 /sql/sql_audit.h
parent70c08df4dc6899991c29c4db3253d8e4efc4ee77 (diff)
parent172784965981c7d06ddb50457f0178da25104b9e (diff)
downloadmariadb-git-e63c03db8d620765b7a1bc769150a04a230b9353.tar.gz
Merge with 10.0-base
Automatic merge, except for server_audit.cc that had to be modified slightly Changes to xtradb and innobase where ignored was these made no sence for 10.0
Diffstat (limited to 'sql/sql_audit.h')
-rw-r--r--sql/sql_audit.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/sql/sql_audit.h b/sql/sql_audit.h
index 85e7abb23e9..68106f099cc 100644
--- a/sql/sql_audit.h
+++ b/sql/sql_audit.h
@@ -96,11 +96,13 @@ void mysql_audit_general_log(THD *thd, time_t time,
{
CHARSET_INFO *clientcs= thd ? thd->variables.character_set_client
: global_system_variables.character_set_client;
+ const char *db= thd ? thd->db : "";
+ size_t db_length= thd ? thd->db_length : 0;
mysql_audit_notify(thd, MYSQL_AUDIT_GENERAL_CLASS, MYSQL_AUDIT_GENERAL_LOG,
0, time, user, userlen, cmd, cmdlen,
query, querylen, clientcs, (ha_rows) 0,
- thd->db, thd->db_length);
+ db, db_length);
}
}
@@ -129,6 +131,8 @@ void mysql_audit_general(THD *thd, uint event_subtype,
char user_buff[MAX_USER_HOST_SIZE];
CSET_STRING query;
ha_rows rows;
+ const char *db;
+ size_t db_length;
if (thd)
{
@@ -136,18 +140,22 @@ void mysql_audit_general(THD *thd, uint event_subtype,
user= user_buff;
userlen= make_user_name(thd, user_buff);
rows= thd->get_stmt_da()->current_row_for_warning();
+ db= thd->db;
+ db_length= thd->db_length;
}
else
{
user= 0;
userlen= 0;
rows= 0;
+ db= "";
+ db_length= 0;
}
mysql_audit_notify(thd, MYSQL_AUDIT_GENERAL_CLASS, event_subtype,
error_code, time, user, userlen, msg, msglen,
query.str(), query.length(), query.charset(), rows,
- thd->db, thd->db_length);
+ db, db_length);
}
}