MariaDB "EXECUTE AS" or User Impersonation With MariaDB, is there a way to impersonate a user execution context when  connected with a higher privileged account?

For instance, when connected with a "MasterUser" execute a SELECT using the more limited privileges of a "ClientUser".

The classic idea is to avoid the server application to perform thousands of connections to MariaDB -- if most requests could be handled through a "broker" user which would connect once and operate under the appropriate privilege level for each given transaction.

Thank you!
You can create a number of different roles and SET ROLE to switch between them.