Skip to content

Commit 38828f2

Browse files
committed
MDEV-37501 plugins.server_audit Fails in 12.1+
DISCONNECT audit record is added at some point after the actual disconnect. To have it at the deterministic place in the log, we have to wait for it to be added before continuing.
1 parent 29003f8 commit 38828f2

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

mysql-test/suite/plugins/r/server_audit.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ set global server_audit_logging= off;
249249
set global server_audit_incl_users='root';
250250
set global server_audit_logging= on;
251251
disconnect cn1;
252+
Line count in file: 140
252253
drop user user1@localhost;
253254
set global server_audit_events='';
254255
set global server_audit_incl_users='root, plug_dest, ssl_user1';
@@ -264,6 +265,7 @@ USER() CURRENT_USER()
264265
plug@localhost plug_dest@%
265266
connection default;
266267
disconnect plug_con;
268+
Line count in file: 174
267269
DROP USER plug;
268270
DROP USER plug_dest;
269271
CREATE USER ssl_user1@localhost require SSL;
@@ -273,6 +275,7 @@ select variable_value > '' as 'have_ssl' from information_schema.session_status
273275
have_ssl
274276
1
275277
disconnect conssl1;
278+
Line count in file: 205
276279
connection default;
277280
DROP USER ssl_user1@localhost;
278281
set global server_audit_query_log_limit= 15;

mysql-test/suite/plugins/t/server_audit.test

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ set global server_audit_logging= off;
189189
set global server_audit_incl_users='root';
190190
set global server_audit_logging= on;
191191
disconnect cn1;
192+
let SEARCH_COUNT= 140;
193+
source include/wait_for_line_count_in_file.inc;
192194

193195
drop user user1@localhost;
194196

@@ -208,6 +210,8 @@ connect(plug_con,localhost,plug,plug_dest,"*NO-ONE*");
208210
select USER(),CURRENT_USER();
209211
connection default;
210212
disconnect plug_con;
213+
let SEARCH_COUNT= 174;
214+
source include/wait_for_line_count_in_file.inc;
211215
DROP USER plug;
212216
DROP USER plug_dest;
213217

@@ -217,6 +221,8 @@ connect (conssl1,localhost,ssl_user1,,sa_db,,,SSL);
217221
--let $ssl_version = query_get_value(SHOW STATUS LIKE 'Ssl_version', Value, 1)
218222
select variable_value > '' as 'have_ssl' from information_schema.session_status where variable_name='ssl_cipher';
219223
disconnect conssl1;
224+
let SEARCH_COUNT= 205;
225+
source include/wait_for_line_count_in_file.inc;
220226
connection default;
221227
DROP USER ssl_user1@localhost;
222228

0 commit comments

Comments
 (0)