SET ROLE
You are viewing an old version of this article. View
the current version here.
MariaDB starting with 10.0.5
Roles were introduced in MariaDB 10.0.5.
Contents
Syntax
SET ROLE { role | NONE }
Description
The SET ROLE
statement enables a role for the current session. To unset a role, use NONE
.
If a role that doesn't exist, or to which the user has not been assigned, is specified, an ERROR 1959 (OP000): Invalid role specification
error occurs.
Example
SELECT CURRENT_ROLE; +--------------+ | CURRENT_ROLE | +--------------+ | NULL | +--------------+ SET ROLE staff; SELECT CURRENT_ROLE; +--------------+ | CURRENT_ROLE | +--------------+ | staff | +--------------+ SET ROLE NONE; Query OK, 0 rows affected (0.00 sec) SELECT CURRENT_ROLE(); +----------------+ | CURRENT_ROLE() | +----------------+ | NULL | +----------------+
Comments
Comments loading...
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.