mariadb/mysql-test/suite/roles/drop_current_user-5176.result
Dmitry Shulga ae5b1acc55 MDEV-35617: DROP USER should leave no active session for that user
On handling the DROP USER statement it is counted a number of sessions
established on behalf every user being dropped. In case the DROP USER
statement is executed in sql_mode = oracle the error
  ER_CANNOT_USER
if there are active connections for any of the users listed at
the DROP USER statement. For sql_mode != oracle the warning
  ER_ACTIVE_CONNECTIONS_FOR_USER_TO_DROP
if there are active connections.

Every user being dropped is marked with flag that disallow establishing
a new connections on behalf this user.
2025-06-12 18:43:59 +02:00

13 lines
495 B
Text

create user foo@localhost;
grant create user on *.* to foo@localhost;
connect foo,localhost,foo,,;
drop user foo@localhost;
Warnings:
Note 4240 Dropped users 'foo'@'localhost' have active connections. Use KILL CONNECTION if they should not be used anymore.
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
show grants;
ERROR 42000: There is no such grant defined for user 'foo' on host 'localhost'
select current_user();
current_user()
foo@localhost