SESSION_USER

When used outside stored routines,  CURRENT_USER,  USER, and  SESSION_USER all return the authorization identifier of the user who created the SQL session.

SESSION_USER also always returns this value when used within stored routines.

If used within a stored routine created with EXTERNAL SECURITY DEFINER, however, CURRENT_USER and USER return the authorization identifier of the user that owns the schema of the routine. This is usually the creating user, although the database owner could be the creator as well.

For information about definer’s and invoker’s rights, see  CREATE FUNCTION statement.

Syntax

SESSION_USER

Example

VALUES SESSION_USER;
1
--------------------------------------------------
SPLICE

1 row selected

See Also