This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-23. For the latest, interactive version please visit https://mariadb.com/kb/.

SESSION_USER

Syntax

SESSION_USER()

Description

Prior to MariaDB 11.7, SESSION_USER() is a synonym for USER().

From MariaDB 11.7, it shows the value of CURRENT_USER() when the session was created, that is, it shows a user@host pair from the mysql.global_priv table, like CURRENT_USER(), but unlike CURRENT_USER() it will not change inside stored routines and views. This is SQL Standard behavior for the SESSION_USER function.

Backward-compatible behavior can be restored by setting old mode to SESSION_USER_IS_USER.

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.