| 1 |
INSTALL PLUGIN null_audit SONAME 'adt_null.so'; |
| 2 |
############# |
| 3 |
## PREPARE ## |
| 4 |
############# |
| 5 |
# Abort first MYSQL_AUDIT_GENERAL_LOG event |
| 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;;ABORT_RET'; |
| 10 |
PREPARE stmt FROM 'SELECT 1'; |
| 11 |
ERROR HY000: Aborted by Audit API ('MYSQL_AUDIT_GENERAL_LOG';1). |
| 12 |
SELECT @@null_audit_event_order_check; |
| 13 |
@@null_audit_event_order_check |
| 14 |
EVENT-ORDER-ABORT |
| 15 |
EXECUTE stmt; |
| 16 |
ERROR HY000: Unknown prepared statement handler (stmt) given to EXECUTE |
| 17 |
# Abort second MYSQL_AUDIT_GENERAL_LOG event |
| 18 |
SET @@null_audit_event_order_check = 'MYSQL_AUDIT_COMMAND_START;command_id="3";;' |
| 19 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 20 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 21 |
'MYSQL_AUDIT_GENERAL_LOG;;;' |
| 22 |
'MYSQL_AUDIT_QUERY_START;sql_command_id="99";;' |
| 23 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 24 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 25 |
'MYSQL_AUDIT_GENERAL_LOG;;ABORT_RET'; |
| 26 |
PREPARE stmt FROM 'SELECT 1'; |
| 27 |
ERROR HY000: Aborted by Audit API ('MYSQL_AUDIT_GENERAL_LOG';1). |
| 28 |
SELECT @@null_audit_event_order_check; |
| 29 |
@@null_audit_event_order_check |
| 30 |
EVENT-ORDER-ABORT |
| 31 |
EXECUTE stmt; |
| 32 |
ERROR HY000: Unknown prepared statement handler (stmt) given to EXECUTE |
| 33 |
####################################### |
| 34 |
## ABORT GENERAL LOG WITH MY_MESSAGE ## |
| 35 |
####################################### |
| 36 |
# Abort first MYSQL_AUDIT_GENERAL_LOG event |
| 37 |
SET @@null_audit_abort_message = "Abort with my_message."; |
| 38 |
SET @@null_audit_event_order_check = 'MYSQL_AUDIT_COMMAND_START;command_id="3";;' |
| 39 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 40 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 41 |
'MYSQL_AUDIT_GENERAL_LOG;;ABORT_RET'; |
| 42 |
PREPARE stmt FROM 'SELECT 1'; |
| 43 |
ERROR HY000: Abort with my_message. |
| 44 |
SELECT @@null_audit_event_order_check; |
| 45 |
@@null_audit_event_order_check |
| 46 |
EVENT-ORDER-ABORT |
| 47 |
EXECUTE stmt; |
| 48 |
ERROR HY000: Unknown prepared statement handler (stmt) given to EXECUTE |
| 49 |
# Abort second MYSQL_AUDIT_GENERAL_LOG event |
| 50 |
SET @@null_audit_abort_message = "Abort with my_message."; |
| 51 |
SET @@null_audit_event_order_check = 'MYSQL_AUDIT_COMMAND_START;command_id="3";;' |
| 52 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 53 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 54 |
'MYSQL_AUDIT_GENERAL_LOG;;;' |
| 55 |
'MYSQL_AUDIT_QUERY_START;sql_command_id="99";;' |
| 56 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 57 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 58 |
'MYSQL_AUDIT_GENERAL_LOG;;ABORT_RET'; |
| 59 |
PREPARE stmt FROM 'SELECT 1'; |
| 60 |
ERROR HY000: Abort with my_message. |
| 61 |
SELECT @@null_audit_event_order_check; |
| 62 |
@@null_audit_event_order_check |
| 63 |
EVENT-ORDER-ABORT |
| 64 |
EXECUTE stmt; |
| 65 |
ERROR HY000: Unknown prepared statement handler (stmt) given to EXECUTE |
| 66 |
############# |
| 67 |
## EXECUTE ## |
| 68 |
############# |
| 69 |
PREPARE stmt FROM 'SELECT 2'; |
| 70 |
# Abort first MYSQL_AUDIT_GENERAL_LOG event |
| 71 |
SET @@null_audit_event_order_check = 'MYSQL_AUDIT_COMMAND_START;command_id="3";;' |
| 72 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 73 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 74 |
'MYSQL_AUDIT_GENERAL_LOG;;ABORT_RET'; |
| 75 |
EXECUTE stmt; |
| 76 |
ERROR HY000: Aborted by Audit API ('MYSQL_AUDIT_GENERAL_LOG';1). |
| 77 |
SELECT @@null_audit_event_order_check; |
| 78 |
@@null_audit_event_order_check |
| 79 |
EVENT-ORDER-ABORT |
| 80 |
EXECUTE stmt; |
| 81 |
2 |
| 82 |
2 |
| 83 |
####################################### |
| 84 |
## ABORT GENERAL LOG WITH MY_MESSAGE ## |
| 85 |
####################################### |
| 86 |
# Abort first MYSQL_AUDIT_GENERAL_LOG event |
| 87 |
SET @@null_audit_abort_message = "Abort with my_message."; |
| 88 |
SET @@null_audit_event_order_check = 'MYSQL_AUDIT_COMMAND_START;command_id="3";;' |
| 89 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 90 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 91 |
'MYSQL_AUDIT_GENERAL_LOG;;ABORT_RET'; |
| 92 |
EXECUTE stmt; |
| 93 |
ERROR HY000: Abort with my_message. |
| 94 |
SELECT @@null_audit_event_order_check; |
| 95 |
@@null_audit_event_order_check |
| 96 |
EVENT-ORDER-ABORT |
| 97 |
EXECUTE stmt; |
| 98 |
2 |
| 99 |
2 |
| 100 |
UNINSTALL PLUGIN null_audit; |
| 101 |
Warnings: |
| 102 |
Warning 1620 Plugin is busy and will be uninstalled on shutdown |