MySQL  8.0.19
Source Code Documentation
resource_group_sql_cmd.cc File Reference
#include "sql/resourcegroups/resource_group_sql_cmd.h"
#include <stdint.h>
#include <string.h>
#include <memory>
#include <new>
#include <string>
#include <utility>
#include <vector>
#include "m_ctype.h"
#include "m_string.h"
#include "my_compiler.h"
#include "my_dbug.h"
#include "my_psi_config.h"
#include "my_sys.h"
#include "mysql/components/services/log_shared.h"
#include "mysql/components/services/psi_thread_bits.h"
#include "mysql/psi/mysql_mutex.h"
#include "mysql_com.h"
#include "mysqld_error.h"
#include "pfs_thread_provider.h"
#include "sql/auth/auth_acls.h"
#include "sql/auth/auth_common.h"
#include "sql/auth/sql_security_ctx.h"
#include "sql/current_thd.h"
#include "sql/dd/cache/dictionary_client.h"
#include "sql/dd/dd_resource_group.h"
#include "sql/dd/string_type.h"
#include "sql/derror.h"
#include "sql/lock.h"
#include "sql/mdl.h"
#include "sql/mysqld_thd_manager.h"
#include "sql/parse_tree_helpers.h"
#include "sql/resourcegroups/resource_group.h"
#include "sql/resourcegroups/resource_group_mgr.h"
#include "sql/resourcegroups/thread_resource_control.h"
#include "sql/sql_backup_lock.h"
#include "sql/sql_class.h"
#include "sql/sql_error.h"
#include "sql/sql_lex.h"
#include "sql/system_variables.h"
#include "sql/thd_raii.h"

Namespaces

 dd
 The version of the current data dictionary table definitions.
 

Functions

static resourcegroups::Resource_groupcheck_and_load_resource_group (THD *thd, const LEX_CSTRING &resource_group_name)
 Check if a resource group specified by a name is present in memory. More...
 
static bool check_and_apply_resource_grp (THD *thd, ulonglong thread_id, resourcegroups::Resource_group *resource_group, bool error)
 Check if resource group controls can be applied to thread identified by PFS thread id. More...
 
static bool check_resource_group_set_privilege (Security_context *sctx)
 Check if user has sufficient privilege to exercise SET RESOURCE GROUP. More...
 

Function Documentation

◆ check_and_apply_resource_grp()

static bool check_and_apply_resource_grp ( THD thd,
ulonglong  thread_id,
resourcegroups::Resource_group resource_group,
bool  error 
)
inlinestatic

Check if resource group controls can be applied to thread identified by PFS thread id.

Apply the controls to thread if the checks were successful.

Parameters
thdTHD context
thread_idThread id of the thread.
resource_groupPointer to resource group.
errorLog error so that error is returned to client.
Returns
true if the function fails else false.

◆ check_and_load_resource_group()

static resourcegroups::Resource_group* check_and_load_resource_group ( THD thd,
const LEX_CSTRING resource_group_name 
)
inlinestatic

Check if a resource group specified by a name is present in memory.

Load a resource group from the Data Dictionary if it missed in memory.

Parameters
thdTHD context.
resource_group_nameResource group name.
Returns
nullptr in case of error, else return a pointer to an instance of class resourcegroups::Resource_group.
Note
in case nullptr is returned an error is set in Diagnostics_area.

◆ check_resource_group_set_privilege()

static bool check_resource_group_set_privilege ( Security_context sctx)
static

Check if user has sufficient privilege to exercise SET RESOURCE GROUP.

Parameters
sctxPointer to security context.
Returns
true if sufficient privilege exists for SET RESOURCE GROUP else false.