@@ -79,8 +79,8 @@ void mysql_audit_general_log(THD *thd, const char *cmd, uint cmdlen,
79
79
longlong affectrows = 0 ;
80
80
int error_code = 0 ;
81
81
char user_buff [MAX_USER_HOST_SIZE + 1 ];
82
- uint userlen , databaselen , certlen , queryattrlen ;
83
- const char * user , * database , * cert , * queryattr ;
82
+ uint userlen , databaselen , queryattrlen ;
83
+ const char * user , * database , * queryattr ;
84
84
time_t time = (time_t ) thd -> start_time .tv_sec ;
85
85
86
86
if (thd )
@@ -113,8 +113,6 @@ void mysql_audit_general_log(THD *thd, const char *cmd, uint cmdlen,
113
113
sql_command .length = sql_statement_names [thd -> lex -> sql_command ].length ;
114
114
database = thd -> db ;
115
115
databaselen = thd -> db_length ;
116
- cert = 0 ;
117
- certlen = 0 ;
118
116
queryattr = thd -> query_attrs ();
119
117
queryattrlen = thd -> query_attrs_length ();
120
118
}
@@ -128,8 +126,6 @@ void mysql_audit_general_log(THD *thd, const char *cmd, uint cmdlen,
128
126
sql_command = empty ;
129
127
database = 0 ;
130
128
databaselen = 0 ;
131
- cert = 0 ;
132
- certlen = 0 ;
133
129
queryattr = 0 ;
134
130
queryattrlen = 0 ;
135
131
}
@@ -140,7 +136,7 @@ void mysql_audit_general_log(THD *thd, const char *cmd, uint cmdlen,
140
136
error_code , time , user , userlen , cmd , cmdlen , query .str ,
141
137
query .length , clientcs , resultrows , affectrows ,
142
138
sql_command , host , external_user , ip , database ,
143
- databaselen , cert , certlen , queryattr , queryattrlen );
139
+ databaselen , queryattr , queryattrlen );
144
140
}
145
141
#endif
146
142
}
@@ -167,8 +163,8 @@ void mysql_audit_general(THD *thd, uint event_subtype,
167
163
{
168
164
time_t time = my_time (0 );
169
165
uint msglen = msg ? strlen (msg ) : 0 ;
170
- uint userlen , databaselen , certlen , queryattrlen ;
171
- const char * user , * database , * cert , * queryattr ;
166
+ uint userlen , databaselen , queryattrlen ;
167
+ const char * user , * database , * queryattr ;
172
168
char user_buff [MAX_USER_HOST_SIZE ];
173
169
CSET_STRING query ;
174
170
MYSQL_LEX_STRING ip , host , external_user , sql_command ;
@@ -213,8 +209,6 @@ void mysql_audit_general(THD *thd, uint event_subtype,
213
209
sql_command .length = sql_statement_names [thd -> lex -> sql_command ].length ;
214
210
database = thd -> db ;
215
211
databaselen = thd -> db_length ;
216
- cert = 0 ;
217
- certlen = 0 ;
218
212
queryattr = thd -> query_attrs ();
219
213
queryattrlen = thd -> query_attrs_length ();
220
214
}
@@ -230,8 +224,6 @@ void mysql_audit_general(THD *thd, uint event_subtype,
230
224
affectrows = 0 ;
231
225
database = 0 ;
232
226
databaselen = 0 ;
233
- cert = 0 ;
234
- certlen = 0 ;
235
227
queryattr = 0 ;
236
228
queryattrlen = 0 ;
237
229
}
@@ -241,7 +233,7 @@ void mysql_audit_general(THD *thd, uint event_subtype,
241
233
query .str (), query .length (), query .charset (),
242
234
resultrows , affectrows , sql_command , host ,
243
235
external_user , ip , database , databaselen ,
244
- cert , certlen , queryattr , queryattrlen );
236
+ queryattr , queryattrlen );
245
237
}
246
238
#endif
247
239
}
@@ -259,7 +251,10 @@ void mysql_audit_general(THD *thd, uint event_subtype,
259
251
(thd)->security_ctx->get_host()->length(),\
260
252
(thd)->security_ctx->get_ip()->ptr(),\
261
253
(thd)->security_ctx->get_ip()->length(),\
262
- (thd)->db, (thd)->db ? strlen((thd)->db) : 0)
254
+ (thd)->db, (thd)->db ? strlen((thd)->db) : 0,\
255
+ (thd)->connection_certificate(),\
256
+ (thd)->connection_certificate_length());
257
+
263
258
264
259
#define MYSQL_AUDIT_NOTIFY_CONNECTION_DISCONNECT (thd , errcode )\
265
260
mysql_audit_notify(\
@@ -275,7 +270,9 @@ void mysql_audit_general(THD *thd, uint event_subtype,
275
270
(thd)->security_ctx->get_host()->length(),\
276
271
(thd)->security_ctx->get_ip()->ptr(),\
277
272
(thd)->security_ctx->get_ip()->length(),\
278
- (thd)->db, (thd)->db ? strlen((thd)->db) : 0)
273
+ (thd)->db, (thd)->db ? strlen((thd)->db) : 0,\
274
+ (thd)->connection_certificate(),\
275
+ (thd)->connection_certificate_length());
279
276
280
277
#define MYSQL_AUDIT_NOTIFY_CONNECTION_CHANGE_USER (thd ) mysql_audit_notify(\
281
278
(thd), MYSQL_AUDIT_CONNECTION_CLASS, MYSQL_AUDIT_CONNECTION_CHANGE_USER,\
@@ -290,6 +287,8 @@ void mysql_audit_general(THD *thd, uint event_subtype,
290
287
(thd)->security_ctx->get_host()->length(),\
291
288
(thd)->security_ctx->get_ip()->ptr(),\
292
289
(thd)->security_ctx->get_ip()->length(),\
293
- (thd)->db, (thd)->db ? strlen((thd)->db) : 0)
290
+ (thd)->db, (thd)->db ? strlen((thd)->db) : 0,\
291
+ (thd)->connection_certificate(),\
292
+ (thd)->connection_certificate_length());
294
293
295
294
#endif /* SQL_AUDIT_INCLUDED */
0 commit comments