Information Schema ENABLED_ROLES Table

You are viewing an old version of this article. View the current version here.
MariaDB 10.0.5

The ENABLED_ROLES table was introduced in MariaDB 10.0.5

The Information Schema ENABLED_ROLES table shows the enabled roles for the current session.

It contains the following column:

ColumnDescription
ROLE_NAMEThe enabled role name, or NULL.

This table lists all roles that are currently enabled, one role per row — the current role, roles granted to the current role, roles granted to these roles and so on. If no role is set, the row contains a NULL value.

The roles that the current user can enable are listed in the APPLICABLE_ROLES Information Schema table.

See also CURRENT_ROLE().

Examples

SELECT * FROM INFORMATION_SCHEMA.ENABLED_ROLES;
+-----------+
| ROLE_NAME |
+-----------+
| NULL      |
+-----------+

SET ROLE staff;

SELECT * FROM INFORMATION_SCHEMA.ENABLED_ROLES;
+-----------+
| ROLE_NAME |
+-----------+
| staff     |
+-----------+

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.