MySQL  8.0.18
Source Code Documentation
auth_common.cc File Reference
#include "sql/auth/auth_common.h"
#include "sql/auth/auth_utility.h"
#include "sql/auth/sql_auth_cache.h"
#include <string.h>
#include <cmath>
#include "sql/field.h"
#include "sql/table.h"
#include "sql_string.h"

Namespaces

 consts
 

Functions

const std::string consts::mysql ("mysql")
 
const std::string consts::system_user ("SYSTEM_USER")
 
std::string get_one_priv (ulong &revoke_privs)
 Converts privilege represented by LSB to string. More...
 
void set_system_user_flag (THD *thd, bool check_for_main_security_ctx)
 Set the system_user flag in the THD. More...
 

Function Documentation

◆ get_one_priv()

std::string get_one_priv ( ulong revoke_privs)

Converts privilege represented by LSB to string.

This is used while serializing in-memory data to JSON format.

Parameters
[in,out]revoke_privsPrivilege bitmask
Returns
Name for the privilege represented by LSB

◆ set_system_user_flag()

void set_system_user_flag ( THD thd,
bool  check_for_main_security_ctx 
)

Set the system_user flag in the THD.

Probe the security context for the SYSTEM_USER dynamic privileve only if it has not been changed from original security context in the THD. If the original security context does not have SYSTEM_USER privlege then reset the flag in the THD, otherwise set it.

Parameters
[in,out]thdThead handle
[in]check_for_main_security_ctxIf this flag value is true then we toggle value in THD only if current security context is same as main security context.