1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-21599 - plugins.server_audit fails sporadically in buildbot

Fixed a couple of race conditions in the test case to ensure stable order
of events. Also removed all sleeps. Test execution time is down from 18s
to 0.15s.

On disconnect audit event is triggered after control is returned to
mysqltest client. Which means mysqltest may issue more commands
concurrently before disconnect is actually logged.

Similar problem happens with regular query execution: an event is
triggered after control is returner to the client. Which may end
up with unstable order of events in different connections.

Delayed insert rows are enqueued separately and can either be combined
into single event or go as separate events. Reduced number of inserted
rows to 1 to stabilize result.

Also backported 2b3f6ab from 10.5.
This commit is contained in:
Sergey Vojtovich
2020-04-10 15:55:16 +04:00
parent d565895bbd
commit 06219c2ad4
3 changed files with 47 additions and 19 deletions

View File

@ -32,7 +32,6 @@ show variables like 'server_audit_excl_users';
Variable_name Value
server_audit_excl_users
connect con1,localhost,root,,mysql;
connection default;
disconnect con1;
connect(localhost,no_such_user,,mysql,MASTER_PORT,MASTER_SOCKET);
connect con1,localhost,no_such_user,,mysql;
@ -99,7 +98,6 @@ set global server_audit_mode=1;
set global server_audit_events='';
create database sa_db;
connect con1,localhost,root,,test;
connection con1;
create table t1 (id2 int);
insert into t1 values (1), (2);
select * from t1;
@ -112,8 +110,8 @@ create table sa_t1(id int);
insert into sa_t1 values (1), (2);
drop table sa_t1;
drop database sa_db;
connection default;
disconnect con1;
connection default;
create database sa_db;
use sa_db;
CREATE USER u1 IDENTIFIED BY 'pwd-123';
@ -219,7 +217,7 @@ grant all on sa_db.* to user1@localhost;
connect cn1,localhost,user1,,sa_db;
connection cn1;
create table t1(id int) engine=myisam;
insert delayed into t1 values (1), (2);
insert delayed into t1 values (1);
connection default;
# Waiting until INSERT DELAYED thread does the insert.
drop table t1;