| 1 |
--source include/have_null_audit_plugin.inc |
| 2 |
--source include/no_protocol.inc |
| 3 |
|
| 4 |
--replace_regex /\.dll/.so/ |
| 5 |
eval INSTALL PLUGIN null_audit SONAME '$AUDIT_NULL'; |
| 6 |
|
| 7 |
--echo ############# |
| 8 |
--echo ## PREPARE ## |
| 9 |
--echo ############# |
| 10 |
|
| 11 |
--echo # Abort first MYSQL_AUDIT_GENERAL_LOG event |
| 12 |
SET @@null_audit_event_order_check = 'MYSQL_AUDIT_COMMAND_START;command_id="3";;' |
| 13 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 14 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 15 |
'MYSQL_AUDIT_GENERAL_LOG;;ABORT_RET'; |
| 16 |
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT |
| 17 |
--error ER_AUDIT_API_ABORT |
| 18 |
PREPARE stmt FROM 'SELECT 1'; |
| 19 |
SELECT @@null_audit_event_order_check; |
| 20 |
--error ER_UNKNOWN_STMT_HANDLER |
| 21 |
EXECUTE stmt; |
| 22 |
|
| 23 |
--echo # Abort second MYSQL_AUDIT_GENERAL_LOG event |
| 24 |
SET @@null_audit_event_order_check = 'MYSQL_AUDIT_COMMAND_START;command_id="3";;' |
| 25 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 26 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 27 |
'MYSQL_AUDIT_GENERAL_LOG;;;' |
| 28 |
'MYSQL_AUDIT_QUERY_START;sql_command_id="99";;' |
| 29 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 30 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 31 |
'MYSQL_AUDIT_GENERAL_LOG;;ABORT_RET'; |
| 32 |
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT |
| 33 |
--error ER_AUDIT_API_ABORT |
| 34 |
PREPARE stmt FROM 'SELECT 1'; |
| 35 |
SELECT @@null_audit_event_order_check; |
| 36 |
--error ER_UNKNOWN_STMT_HANDLER |
| 37 |
EXECUTE stmt; |
| 38 |
|
| 39 |
--echo ####################################### |
| 40 |
--echo ## ABORT GENERAL LOG WITH MY_MESSAGE ## |
| 41 |
--echo ####################################### |
| 42 |
|
| 43 |
--echo # Abort first MYSQL_AUDIT_GENERAL_LOG event |
| 44 |
SET @@null_audit_abort_message = "Abort with my_message."; |
| 45 |
SET @@null_audit_event_order_check = 'MYSQL_AUDIT_COMMAND_START;command_id="3";;' |
| 46 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 47 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 48 |
'MYSQL_AUDIT_GENERAL_LOG;;ABORT_RET'; |
| 49 |
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT |
| 50 |
--error ER_AUDIT_API_ABORT |
| 51 |
PREPARE stmt FROM 'SELECT 1'; |
| 52 |
SELECT @@null_audit_event_order_check; |
| 53 |
--error ER_UNKNOWN_STMT_HANDLER |
| 54 |
EXECUTE stmt; |
| 55 |
|
| 56 |
--echo # Abort second MYSQL_AUDIT_GENERAL_LOG event |
| 57 |
SET @@null_audit_abort_message = "Abort with my_message."; |
| 58 |
SET @@null_audit_event_order_check = 'MYSQL_AUDIT_COMMAND_START;command_id="3";;' |
| 59 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 60 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 61 |
'MYSQL_AUDIT_GENERAL_LOG;;;' |
| 62 |
'MYSQL_AUDIT_QUERY_START;sql_command_id="99";;' |
| 63 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 64 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 65 |
'MYSQL_AUDIT_GENERAL_LOG;;ABORT_RET'; |
| 66 |
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT |
| 67 |
--error ER_AUDIT_API_ABORT |
| 68 |
PREPARE stmt FROM 'SELECT 1'; |
| 69 |
SELECT @@null_audit_event_order_check; |
| 70 |
--error ER_UNKNOWN_STMT_HANDLER |
| 71 |
EXECUTE stmt; |
| 72 |
|
| 73 |
--echo ############# |
| 74 |
--echo ## EXECUTE ## |
| 75 |
--echo ############# |
| 76 |
|
| 77 |
PREPARE stmt FROM 'SELECT 2'; |
| 78 |
|
| 79 |
--echo # Abort first MYSQL_AUDIT_GENERAL_LOG event |
| 80 |
SET @@null_audit_event_order_check = 'MYSQL_AUDIT_COMMAND_START;command_id="3";;' |
| 81 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 82 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 83 |
'MYSQL_AUDIT_GENERAL_LOG;;ABORT_RET'; |
| 84 |
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT |
| 85 |
--error ER_AUDIT_API_ABORT |
| 86 |
EXECUTE stmt; |
| 87 |
SELECT @@null_audit_event_order_check; |
| 88 |
EXECUTE stmt; |
| 89 |
|
| 90 |
# BUG - Aborting 2nd MYSQL_AUDIT_GENERAL_LOG event fails |
| 91 |
#--echo # Abort second MYSQL_AUDIT_GENERAL_LOG event |
| 92 |
#SET @@null_audit_event_order_check = 'MYSQL_AUDIT_COMMAND_START;command_id="3";;' |
| 93 |
# 'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 94 |
# 'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 95 |
# 'MYSQL_AUDIT_GENERAL_LOG;;;' |
| 96 |
# 'MYSQL_AUDIT_QUERY_START;sql_command_id="100";;' |
| 97 |
# 'MYSQL_AUDIT_GENERAL_LOG;;ABORT_RET'; |
| 98 |
#--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT |
| 99 |
#--error ER_AUDIT_API_ABORT |
| 100 |
#EXECUTE stmt; |
| 101 |
#SELECT @@null_audit_event_order_check; |
| 102 |
#EXECUTE stmt; |
| 103 |
|
| 104 |
--echo ####################################### |
| 105 |
--echo ## ABORT GENERAL LOG WITH MY_MESSAGE ## |
| 106 |
--echo ####################################### |
| 107 |
|
| 108 |
--echo # Abort first MYSQL_AUDIT_GENERAL_LOG event |
| 109 |
SET @@null_audit_abort_message = "Abort with my_message."; |
| 110 |
SET @@null_audit_event_order_check = 'MYSQL_AUDIT_COMMAND_START;command_id="3";;' |
| 111 |
'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 112 |
'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 113 |
'MYSQL_AUDIT_GENERAL_LOG;;ABORT_RET'; |
| 114 |
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT |
| 115 |
--error ER_AUDIT_API_ABORT |
| 116 |
EXECUTE stmt; |
| 117 |
SELECT @@null_audit_event_order_check; |
| 118 |
EXECUTE stmt; |
| 119 |
|
| 120 |
# BUG - Aborting 2nd MYSQL_AUDIT_GENERAL_LOG event fails |
| 121 |
#--echo # Abort second MYSQL_AUDIT_GENERAL_LOG event |
| 122 |
#SET @@null_audit_abort_message = "Abort with my_message."; |
| 123 |
#SET @@null_audit_event_order_check = 'MYSQL_AUDIT_COMMAND_START;command_id="3";;' |
| 124 |
# 'MYSQL_AUDIT_PARSE_PREPARSE;;;' |
| 125 |
# 'MYSQL_AUDIT_PARSE_POSTPARSE;;;' |
| 126 |
# 'MYSQL_AUDIT_GENERAL_LOG;;;' |
| 127 |
# 'MYSQL_AUDIT_QUERY_START;sql_command_id="100";;' |
| 128 |
# 'MYSQL_AUDIT_GENERAL_LOG;;ABORT_RET'; |
| 129 |
#--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT |
| 130 |
#--error ER_AUDIT_API_ABORT |
| 131 |
#EXECUTE stmt; |
| 132 |
#SELECT @@null_audit_event_order_check; |
| 133 |
#EXECUTE stmt; |
| 134 |
|
| 135 |
UNINSTALL PLUGIN null_audit; |