| 1 |
--echo # |
| 2 |
--echo # Bug #34207811 : Audit plugin does not log multiqueries correctly. |
| 3 |
--echo # |
| 4 |
--source include/have_debug.inc |
| 5 |
--source include/have_null_audit_plugin.inc |
| 6 |
--source include/no_protocol.inc |
| 7 |
|
| 8 |
--replace_regex /\.dll/.so/ |
| 9 |
eval INSTALL PLUGIN null_audit SONAME '$AUDIT_NULL'; |
| 10 |
|
| 11 |
CREATE USER multiqueries_test_user34207811 IDENTIFIED BY 'secret_pswd'; |
| 12 |
GRANT CREATE USER, SELECT, SESSION_VARIABLES_ADMIN ON *.* TO multiqueries_test_user34207811; |
| 13 |
|
| 14 |
--connect(con1,localhost,multiqueries_test_user34207811,secret_pswd) |
| 15 |
|
| 16 |
set @con1_tid = (select thread_id from performance_schema.threads |
| 17 |
where processlist_user = 'multiqueries_test_user34207811'); |
| 18 |
|
| 19 |
delimiter |; |
| 20 |
SET DEBUG="+d, print_query"| |
| 21 |
select 1; select 2; CREATE USER u1 IDENTIFIED BY 'p1'; select 3; ALTER USER 'u1' IDENTIFIED BY 'new_pswd' PASSWORD EXPIRE; select 4;| |
| 22 |
SET DEBUG="-d, print_query"| |
| 23 |
delimiter ;| |
| 24 |
|
| 25 |
--echo # Check the error log if multiqueries are not logged. |
| 26 |
--let $grep_file=$MYSQLTEST_VARDIR/log/mysqld.1.err |
| 27 |
--let $grep_output=print_count |
| 28 |
--let $grep_pattern=select 1; select 2; CREATE USER u1 IDENTIFIED BY 'p1'; select 3; ALTER USER 'u1' IDENTIFIED BY 'new_pswd' PASSWORD EXPIRE; select 4 |
| 29 |
--source include/grep_pattern.inc |
| 30 |
|
| 31 |
# Verify the fix for the bug: |
| 32 |
# Bug #34569180 : P_S.events_statements_history tables store wrongdata when executing multiqueries |
| 33 |
SELECT SQL_TEXT from performance_schema.events_statements_history_long where (thread_id = @con1_tid); |
| 34 |
|
| 35 |
# Clean up |
| 36 |
connection default; |
| 37 |
--disconnect con1 |
| 38 |
UNINSTALL PLUGIN null_audit; |
| 39 |
DROP USER u1; |
| 40 |
DROP USER multiqueries_test_user34207811; |