diff options
author | Sergei Golubchik <serg@mariadb.org> | 2021-01-09 17:56:33 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2021-01-11 21:54:47 +0100 |
commit | 22b171d3044675481c03b83888cffa018a502c4e (patch) | |
tree | c48b9d3902f4e669bb77c3be34b65d5c4861965d /mysql-test | |
parent | fc0d9a470ce9ae2285f687e9b13f08b76527051b (diff) | |
download | mariadb-git-22b171d3044675481c03b83888cffa018a502c4e.tar.gz |
MDEV-17852 Altered connection limits for user have no effect
update mqh in struct user_conn after taking it from the cache
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/user_limits.result | 27 | ||||
-rw-r--r-- | mysql-test/t/user_limits.test | 26 |
2 files changed, 53 insertions, 0 deletions
diff --git a/mysql-test/r/user_limits.result b/mysql-test/r/user_limits.result index bbf73d7c617..8658cc1497d 100644 --- a/mysql-test/r/user_limits.result +++ b/mysql-test/r/user_limits.result @@ -186,3 +186,30 @@ connection default; drop user mysqltest_1@localhost; drop table t1; set global max_user_connections= @my_max_user_connections; +# +# End of 10.1 tests +# +# +# MDEV-17852 Altered connection limits for user have no effect +# +create user foo@'%' with max_user_connections 1; +connect con1,localhost,foo; +select current_user(); +current_user() +foo@% +connect(localhost,foo,,test,MYSQL_PORT,MYSQL_SOCK); +connect con2,localhost,foo; +ERROR 42000: User 'foo' has exceeded the 'max_user_connections' resource (current value: 1) +connection default; +alter user foo with max_user_connections 2; +connect con3,localhost,foo; +select current_user(); +current_user() +foo@% +disconnect con3; +disconnect con1; +connection default; +drop user foo@'%'; +# +# End of 10.2 tests +# diff --git a/mysql-test/t/user_limits.test b/mysql-test/t/user_limits.test index ebb4fd4fb88..36524febd8d 100644 --- a/mysql-test/t/user_limits.test +++ b/mysql-test/t/user_limits.test @@ -216,3 +216,29 @@ drop table t1; --source include/wait_until_count_sessions.inc set global max_user_connections= @my_max_user_connections; + +--echo # +--echo # End of 10.1 tests +--echo # + +--echo # +--echo # MDEV-17852 Altered connection limits for user have no effect +--echo # +create user foo@'%' with max_user_connections 1; +--connect con1,localhost,foo +select current_user(); +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +--error ER_USER_LIMIT_REACHED +--connect con2,localhost,foo +--connection default +alter user foo with max_user_connections 2; +--connect con3,localhost,foo +select current_user(); +--disconnect con3 +--disconnect con1 +--connection default +drop user foo@'%'; + +--echo # +--echo # End of 10.2 tests +--echo # |