1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00
Files
mariadb/mysql-test/suite/roles/create_and_drop_current.result
Dmitry Shulga ce7ab467db MDEV-35617: DROP USER should leave no active session for that user
DROP USER looks for sessions by the do-be-dropped user and if found:
* fails with ER_CANNOT_USER in Oracle mode
* continues with ER_ACTIVE_CONNECTIONS_FOR_USER_TO_DROP warning otherwise

Every user being dropped is marked with flag that disallow establishing
a new connections on behalf this user.
2025-07-16 09:14:33 +07:00

39 lines
1.8 KiB
Plaintext

create user foo@localhost;
grant create user on *.* to foo@localhost;
change_user foo,,;
create user current_user;
ERROR HY000: Operation CREATE USER failed for CURRENT_USER
create user current_role;
ERROR HY000: Operation CREATE USER failed for CURRENT_ROLE
create role current_user;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'current_user' at line 1
create role current_role;
ERROR HY000: Operation CREATE ROLE failed for CURRENT_ROLE
drop user current_user;
Warnings:
Note 4227 Dropped users 'foo'@'localhost' have active connections. Use KILL CONNECTION if they should not be used anymore.
drop user current_role;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'current_role' at line 1
drop role current_user;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'current_user' at line 1
drop role current_role;
ERROR HY000: Operation DROP ROLE failed for CURRENT_ROLE
show warnings;
Level Code Message
Error 1959 Invalid role specification `NONE`
Error 1396 Operation DROP ROLE failed for CURRENT_ROLE
change_user root,,;
create role r1;
grant r1 to current_user;
set role r1;
select current_role();
current_role()
r1
create user current_role;
ERROR HY000: Operation CREATE USER failed for CURRENT_ROLE
create role current_role;
ERROR HY000: Operation CREATE ROLE failed for CURRENT_ROLE
drop user current_role;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'current_role' at line 1
drop role current_role;