diff options
author | Michael Widenius <monty@mariadb.org> | 2014-03-11 17:49:09 +0200 |
---|---|---|
committer | Michael Widenius <monty@mariadb.org> | 2014-03-11 17:49:09 +0200 |
commit | 172784965981c7d06ddb50457f0178da25104b9e (patch) | |
tree | b0759d12a5abd3acf49ac11d4f601d46bc6c5e0a /sql/sql_audit.h | |
parent | 23af77d26e3ff336e415a5d8bf3f4c4a7bc84a18 (diff) | |
parent | 800a278fd09c353a02f02c9c32074d3807861967 (diff) | |
download | mariadb-git-172784965981c7d06ddb50457f0178da25104b9e.tar.gz |
Merge with 5.5
Diffstat (limited to 'sql/sql_audit.h')
-rw-r--r-- | sql/sql_audit.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sql/sql_audit.h b/sql/sql_audit.h index 8172610607a..86e911c686d 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->warning_info->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); } } |