mariadb/mysql-test/suite/roles/create_and_drop_current.result
Sergei Golubchik 979aaf8e4d fix error messages
when a definer for SP/view is wrong - it shold be ER_MALFORMED_DEFINER,
not ER_NO_SUCH_USER

when one uses current_role as a definer or grantee but there's no
current role - it should be ER_INVALID_ROLE not ER_MALFORMED_DEFINER

when a non-existent user is specified - it should be ER_NO_SUCH_USER,
which should say "The user does not exist", not "Definer does not exist"

clarify ER_CANT_CHANGE_TX_CHARACTERISTICS to say what cannot be changed
2025-03-18 18:27:26 +01:00

34 lines
1.6 KiB
Text

create user foo@localhost;
grant create user on *.* to foo@localhost;
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;
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
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;