| 1 |
call mtr.add_suppression("Event 'MYSQL_AUDIT_GENERAL_ERROR' cannot be aborted."); |
| 2 |
INSTALL PLUGIN null_audit SONAME 'adt_null.so'; |
| 3 |
############# |
| 4 |
## PREPARE ## |
| 5 |
############# |
| 6 |
SET @@null_audit_event_order_check = 'MYSQL_AUDIT_COMMAND_START;command_id="3";;' |
| 7 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 8 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 9 |
'MYSQL_AUDIT_GENERAL_LOG;;;' |
| 10 |
'MYSQL_AUDIT_QUERY_START;sql_command_id="99";;' |
| 11 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 12 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 13 |
'MYSQL_AUDIT_GENERAL_ERROR;;ABORT_RET'; |
| 14 |
PREPARE stmt FROM 'SELECT * FROM mysql.non_existing_table'; |
| 15 |
ERROR 42S02: Table 'mysql.non_existing_table' doesn't exist |
| 16 |
SELECT @@null_audit_event_order_check; |
| 17 |
@@null_audit_event_order_check |
| 18 |
EVENT-ORDER-ABORT |
| 19 |
############# |
| 20 |
## EXECUTE ## |
| 21 |
############# |
| 22 |
CREATE TABLE test.test_table(a INT); |
| 23 |
PREPARE stmt FROM 'SELECT * FROM test.test_table'; |
| 24 |
DROP TABLE test.test_table; |
| 25 |
SET @@null_audit_event_order_check = 'MYSQL_AUDIT_COMMAND_START;command_id="3";;' |
| 26 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 27 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 28 |
'MYSQL_AUDIT_GENERAL_LOG;;;' |
| 29 |
'MYSQL_AUDIT_QUERY_START;sql_command_id="100";;' |
| 30 |
'MYSQL_AUDIT_GENERAL_LOG;;;' |
| 31 |
'MYSQL_AUDIT_QUERY_START;sql_command_id="0";;' |
| 32 |
'MYSQL_AUDIT_GENERAL_ERROR;;ABORT_RET'; |
| 33 |
EXECUTE stmt; |
| 34 |
ERROR 42S02: Table 'test.test_table' doesn't exist |
| 35 |
SELECT @@null_audit_event_order_check; |
| 36 |
@@null_audit_event_order_check |
| 37 |
EVENT-ORDER-ABORT |
| 38 |
DROP PREPARE stmt; |
| 39 |
####################################### |
| 40 |
## ABORT GENERAL LOG WITH MY_MESSAGE ## |
| 41 |
####################################### |
| 42 |
SET @@null_audit_abort_message = "Abort with my_message."; |
| 43 |
SET @@null_audit_event_order_check = 'MYSQL_AUDIT_COMMAND_START;command_id="3";;' |
| 44 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 45 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 46 |
'MYSQL_AUDIT_GENERAL_LOG;;;' |
| 47 |
'MYSQL_AUDIT_QUERY_START;sql_command_id="99";;' |
| 48 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 49 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 50 |
'MYSQL_AUDIT_GENERAL_ERROR;;ABORT_RET'; |
| 51 |
PREPARE stmt FROM 'SELECT * FROM mysql.non_existing_table'; |
| 52 |
ERROR 42S02: Table 'mysql.non_existing_table' doesn't exist |
| 53 |
SELECT @@null_audit_event_order_check; |
| 54 |
@@null_audit_event_order_check |
| 55 |
EVENT-ORDER-ABORT |
| 56 |
CREATE TABLE test.test_table(a INT); |
| 57 |
PREPARE stmt FROM 'SELECT * FROM test.test_table'; |
| 58 |
DROP TABLE test.test_table; |
| 59 |
SET @@null_audit_abort_message = "Abort with my_message."; |
| 60 |
SET @@null_audit_event_order_check = 'MYSQL_AUDIT_COMMAND_START;command_id="3";;' |
| 61 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 62 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 63 |
'MYSQL_AUDIT_GENERAL_LOG;;;' |
| 64 |
'MYSQL_AUDIT_QUERY_START;sql_command_id="100";;' |
| 65 |
'MYSQL_AUDIT_GENERAL_LOG;;;' |
| 66 |
'MYSQL_AUDIT_QUERY_START;sql_command_id="0";;' |
| 67 |
'MYSQL_AUDIT_GENERAL_ERROR;;ABORT_RET'; |
| 68 |
EXECUTE stmt; |
| 69 |
ERROR 42S02: Table 'test.test_table' doesn't exist |
| 70 |
SELECT @@null_audit_event_order_check; |
| 71 |
@@null_audit_event_order_check |
| 72 |
EVENT-ORDER-ABORT |
| 73 |
DROP PREPARE stmt; |
| 74 |
UNINSTALL PLUGIN null_audit; |
| 75 |
Warnings: |
| 76 |
Warning 1620 Plugin is busy and will be uninstalled on shutdown |