Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.6, 10.11, 11.4, 11.8, 10.5(EOL)
-
None
Description
If an account has a resource limit (in the example below it is MAX_QUERIES_PER_HOUR, I didn't check other values), and the account has used a part or all of this limit, dropping and re-creating the account anew doesn't reset the accumulated value, instead for the newly created account the counting continues from the value where it ended for the old one.
So, in the example below, the account has MAX_QUERIES_PER_HOUR=2, it runs 3 queries, and the third fails as expected; then the account is re-created, now with MAX_QUERIES_PER_HOUR=4. The expectation is that it will be able to run 4 queries before reaching the limit, but it can only run one, which together with the previous 3 makes it total of 4, and then it hits ER_USER_LIMIT_REACHED.
create user u@localhost with max_queries_per_hour 2; |
--connect (con1,localhost,u,,)
|
select 1; |
select 2; |
--error ER_USER_LIMIT_REACHED
|
select 3; |
--disconnect con1
|
--connection default
|
drop user u@localhost; |
create user u@localhost with max_queries_per_hour 4; |
--connect (con1,localhost,u,,)
|
select 11; |
select 12; |
select 13; |
select 14; |
--disconnect con1
|
--connection default
|
drop user u@localhost; |
main 22efc2c784e1b7199fb5804e6330168277ea7dce |
mysqltest: At line 13: query 'select 12' failed: ER_USER_LIMIT_REACHED (1226): User 'u' has exceeded the 'max_queries_per_hour' resource (current value: 4) |
Attachments
Issue Links
- is blocked by
-
MDEV-35617 DROP USER should leave no active session for that user
-
- Closed
-