| 1 |
--source include/galera_cluster.inc |
| 2 |
|
| 3 |
if (!$SERVER_AUDIT_SO) { |
| 4 |
skip No SERVER_AUDIT plugin; |
| 5 |
} |
| 6 |
|
| 7 |
# enable audit loggin in node 2 |
| 8 |
--connection node_2 |
| 9 |
SET GLOBAL server_audit_logging=ON; |
| 10 |
|
| 11 |
# replicate CREATE and INSERT, these should be seen in the audit log |
| 12 |
--connection node_1 |
| 13 |
CREATE TABLE t1(a INT); |
| 14 |
INSERT INTO t1 VALUES (1); |
| 15 |
|
| 16 |
--connection node_2 |
| 17 |
# make sure that the INSERT has been applied |
| 18 |
--let $wait_condition = SELECT COUNT(*) = 1 FROM test.t1; |
| 19 |
--source include/wait_condition.inc |
| 20 |
|
| 21 |
--echo # Now checking the audit log |
| 22 |
let $MYSQLD_DATADIR= `SELECT @@datadir`; |
| 23 |
--replace_regex /[0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\,[^,]*\,/TIME,HOSTNAME,/ /\,[1-9][0-9]*\,/,1,/ /\,[1-9][0-9]*/,ID/ |
| 24 |
cat_file $MYSQLD_DATADIR/server_audit.log; |
| 25 |
|
| 26 |
--echo # resetting the test state |
| 27 |
SET GLOBAL server_audit_logging=DEFAULT; |
| 28 |
|
| 29 |
--connection node_1 |
| 30 |
DROP TABLE t1; |
| 31 |
|
| 32 |
#UNINSTALL PLUGIN server_audit; |
| 33 |
|
| 34 |
remove_file $MYSQLD_DATADIR/server_audit.log; |