Skip to content

Commit d528f3f

Browse files
committed
Modify MTR test for compatibility with 9.1
mysql/mysql-server@c62af60 modified error messages to specify the reason for an access denied error, specifically introducing ER_ACCESS_DENIED_NO_PROXY_GRANT. The Audit Plugin is still compatible with MySQL 9.1, but the test must be updated to expect the new error code. cr: https://code.amazon.com/reviews/CR-162436984
1 parent 4d3c287 commit d528f3f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

mysql-test/suite/server_audit/r/server_audit.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ server_audit_excl_users
6161
Generate audit log by connecting using non-existing user
6262
=======================================================================
6363
connect(localhost,no_such_user,,mysql,MASTER_PORT,MASTER_SOCKET);
64-
ERROR 28000: Access denied for user 'no_such_user'@'localhost' (using password: NO)
64+
Got one of the listed errors
6565

6666
=======================================================================
6767
Generate audit log with different parameter values and queries
@@ -259,7 +259,7 @@ set global server_audit_incl_users='root, plug_dest';
259259
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
260260
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
261261
connect(localhost,plug,plug_dest,test,MYSQL_PORT,MYSQL_SOCK);
262-
ERROR 28000: Access denied for user 'plug'@'localhost' (using password: YES)
262+
Got one of the listed errors
263263
GRANT PROXY ON plug_dest TO plug;
264264
select USER(),CURRENT_USER();
265265
USER() CURRENT_USER()

mysql-test/suite/server_audit/t/server_audit.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ source include/wait_for_line_count_in_file.inc;
6767
--echo Generate audit log by connecting using non-existing user
6868
--echo =======================================================================
6969
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
70-
--error ER_ACCESS_DENIED_ERROR
70+
--error ER_ACCESS_DENIED_ERROR, ER_ACCESS_DENIED_NO_PROXY_GRANT
7171
connect (con1,localhost,no_such_user,,mysql);
7272
let SEARCH_COUNT= 8;
7373
source include/wait_for_line_count_in_file.inc;
@@ -225,7 +225,7 @@ CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
225225
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
226226
--sleep 2
227227
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
228-
--error ER_ACCESS_DENIED_ERROR
228+
--error ER_ACCESS_DENIED_ERROR, ER_ACCESS_DENIED_NO_PROXY_GRANT
229229
connect(plug_con,localhost,plug,plug_dest);
230230
--sleep 2
231231
GRANT PROXY ON plug_dest TO plug;
@@ -273,7 +273,7 @@ uninstall plugin test_plugin_server;
273273
--echo =======================================================================
274274
--echo Dump the audit logs, replace the timestamp and the hostname with constant values
275275
--echo =======================================================================
276-
--replace_regex /[0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\,[^,]*\,([^,]*)\,([^,]*)\,[0-9][0-9]*\,[0-9][0-9]*\,/TIME,HOSTNAME,\1,\2,CONNECTION_ID,QUERY_ID,/
276+
--replace_regex /[0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\,[^,]*\,([^,]*)\,([^,]*)\,[0-9][0-9]*\,[0-9][0-9]*\,/TIME,HOSTNAME,\1,\2,CONNECTION_ID,QUERY_ID,/ /6126/1045/ # Unify error codes across MySQL versions
277277
--exec cat $MYSQLD_DATADIR/server_audit.log;
278278

279279
--echo

0 commit comments

Comments
 (0)