| 1 |
# |
| 2 |
# Bug #34207811 : Audit plugin does not log multiqueries correctly. |
| 3 |
# |
| 4 |
INSTALL PLUGIN null_audit SONAME 'adt_null.so'; |
| 5 |
CREATE USER multiqueries_test_user34207811 IDENTIFIED BY 'secret_pswd'; |
| 6 |
GRANT CREATE USER, SELECT, SESSION_VARIABLES_ADMIN ON *.* TO multiqueries_test_user34207811; |
| 7 |
set @con1_tid = (select thread_id from performance_schema.threads |
| 8 |
where processlist_user = 'multiqueries_test_user34207811'); |
| 9 |
SET DEBUG="+d, print_query"| |
| 10 |
select 1; select 2; CREATE USER u1 IDENTIFIED BY 'p1'; select 3; ALTER USER 'u1' IDENTIFIED BY 'new_pswd' PASSWORD EXPIRE; select 4;| |
| 11 |
1 |
| 12 |
1 |
| 13 |
2 |
| 14 |
2 |
| 15 |
3 |
| 16 |
3 |
| 17 |
4 |
| 18 |
4 |
| 19 |
SET DEBUG="-d, print_query"| |
| 20 |
# Check the error log if multiqueries are not logged. |
| 21 |
Occurrences of 'select 1; select 2; CREATE USER u1 IDENTIFIED BY 'p1'; select 3; ALTER USER 'u1' IDENTIFIED BY 'new_pswd' PASSWORD EXPIRE; select 4' in the input file: 0 |
| 22 |
SELECT SQL_TEXT from performance_schema.events_statements_history_long where (thread_id = @con1_tid); |
| 23 |
SQL_TEXT |
| 24 |
set @con1_tid = (select thread_id from performance_schema.threads |
| 25 |
where processlist_user = 'multiqueries_test_user34207811') |
| 26 |
SET DEBUG="+d, print_query" |
| 27 |
select 1 |
| 28 |
select 2 |
| 29 |
CREATE USER 'u1'@'%' IDENTIFIED BY <secret> |
| 30 |
select 3 |
| 31 |
ALTER USER 'u1'@'%' IDENTIFIED BY <secret> PASSWORD EXPIRE |
| 32 |
select 4 |
| 33 |
SET DEBUG="-d, print_query" |
| 34 |
UNINSTALL PLUGIN null_audit; |
| 35 |
Warnings: |
| 36 |
Warning 1620 Plugin is busy and will be uninstalled on shutdown |
| 37 |
DROP USER u1; |
| 38 |
DROP USER multiqueries_test_user34207811; |