Roles were introduced in MariaDB 10.0.5.
CURRENT_ROLE, CURRENT_ROLE()
Returns the current role name. This determines your access privileges. The return value is a string in the utf8 character set.
If there is no current role, NULL is returned.
The output of SELECT CURRENT_ROLE
is equivalent to the contents of the ENABLED_ROLES
Information Schema table.
USER()
returns the combination of user and host used to login. CURRENT_USER()
returns the account used to determine current connection's privileges.
SELECT CURRENT_ROLE; +--------------+ | CURRENT_ROLE | +--------------+ | NULL | +--------------+ SET ROLE staff; SELECT CURRENT_ROLE; +--------------+ | CURRENT_ROLE | +--------------+ | staff | +--------------+
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/current_role/