Skip to content

Commit a5d9924

Browse files
committed
Bug#23541550 AUDIT API PROVIDE CONNECTION_TYPE FOR MYSQL_AUDIT_CONNECTION_CONNECT EVENT ONLY
Problem: ======== Connection type field is available for the connect event only of the connection class. Due to lack of filtering mechanism, all 3 events were always available in the audit log file, so anyone could track connection_type by checking connect event only. By that time audit log filtering mechanism was introduced and one can create a filter that will log disconnect or chage user events. In this case, connection_type information is not available. Additionally, a filter that filters connection_type of the disconnect or change user events could not be created. Fix: Connection type field is available in connect/disconnect/change_user events of the connection class. Reviewed-by: ============ Arun Kuruvila <[email protected]> Kristofer Pettersson <[email protected]>
1 parent 8809635 commit a5d9924

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

sql/sql_audit.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,7 @@ int mysql_audit_notify(THD *thd, mysql_event_connection_subclass_t subclass,
395395
event.ip.length= thd->security_context()->ip().length;
396396
event.database.str= thd->db().str;
397397
event.database.length= thd->db().length;
398-
399-
/* Keep this for backward compatibility. */
400-
event.connection_type= subclass == MYSQL_AUDIT_CONNECTION_CONNECT ?
401-
thd->get_vio_type() : NO_VIO_TYPE;
398+
event.connection_type= thd->get_vio_type();
402399

403400
if (subclass == MYSQL_AUDIT_CONNECTION_DISCONNECT)
404401
{

0 commit comments

Comments
 (0)