diff options
Diffstat (limited to 'sql/sql_audit.h')
-rw-r--r-- | sql/sql_audit.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sql/sql_audit.h b/sql/sql_audit.h index 7cb40181bd7..cbc4c7a7232 100644 --- a/sql/sql_audit.h +++ b/sql/sql_audit.h @@ -99,32 +99,29 @@ void mysql_audit_general(THD *thd, uint event_subtype, { time_t time= my_time(0); uint msglen= msg ? strlen(msg) : 0; - const char *query, *user; - uint querylen, userlen; + const char *user; + uint userlen; char user_buff[MAX_USER_HOST_SIZE]; - CHARSET_INFO *clientcs; + CSET_STRING query; ha_rows rows; if (thd) { - query= thd->query(); - querylen= thd->query_length(); + query= thd->query_string; user= user_buff; userlen= make_user_name(thd, user_buff); - clientcs= thd->variables.character_set_client; rows= thd->warning_info->current_row_for_warning(); } else { - query= user= 0; - querylen= userlen= 0; - clientcs= global_system_variables.character_set_client; + user= 0; + userlen= 0; rows= 0; } mysql_audit_notify(thd, MYSQL_AUDIT_GENERAL_CLASS, event_subtype, error_code, time, user, userlen, msg, msglen, - query, querylen, clientcs, rows); + query.str(), query.length(), query.charset(), rows); } #endif } |