diff --git a/mysql-test/r/max_nonsuper_connections.result b/mysql-test/r/max_nonsuper_connections.result index 081a02f0f221..862a52265024 100644 --- a/mysql-test/r/max_nonsuper_connections.result +++ b/mysql-test/r/max_nonsuper_connections.result @@ -51,6 +51,27 @@ disconnect con4; disconnect con3; disconnect con2; disconnect con1; +Verifying nonsuper_connections is decremented when db is denied +ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'bogus_db' +ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'bogus_db' +ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'bogus_db' +ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'bogus_db' +ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'bogus_db' +ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'bogus_db' +ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'bogus_db' +ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'bogus_db' +ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'bogus_db' +ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'bogus_db' +ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'bogus_db' +ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'bogus_db' +ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'bogus_db' +ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'bogus_db' +ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'bogus_db' +ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'bogus_db' +ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'bogus_db' +ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'bogus_db' +ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'bogus_db' +ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'bogus_db' connection default; connect con$i, localhost, test_user,,test; connect con$i, localhost, test_user,,test; diff --git a/mysql-test/t/max_nonsuper_connections.test b/mysql-test/t/max_nonsuper_connections.test index 083722886305..680387e80e9e 100644 --- a/mysql-test/t/max_nonsuper_connections.test +++ b/mysql-test/t/max_nonsuper_connections.test @@ -99,6 +99,17 @@ while ($i) dec $i; } +# Verify counter leak is fixed when permission to a database is denied +--echo Verifying nonsuper_connections is decremented when db is denied +--disable_query_log +--let $i = 20 +--while ($i) { + --error ER_DBACCESS_DENIED_ERROR + --connect (con_denied_$i, localhost, test_user,,bogus_db) + --dec $i +--} +--enable_query_log + # able to refill up max_nonsuper_connections connection default; let $i = 10;