MySQL 8.0.40
Source Code Documentation
parse_tree_hints.cc File Reference
#include "sql/parse_tree_hints.h"
#include <assert.h>
#include <cstddef>
#include <cstdio>
#include <cstring>
#include "lex_string.h"
#include "m_ctype.h"
#include "m_string.h"
#include "my_alloc.h"
#include "my_sqlcommand.h"
#include "mysqld_error.h"
#include "sql/derror.h"
#include "sql/item_subselect.h"
#include "sql/mysqld.h"
#include "sql/parse_tree_helpers.h"
#include "sql/query_options.h"
#include "sql/resourcegroups/resource_group_basic_types.h"
#include "sql/resourcegroups/resource_group_mgr.h"
#include "sql/set_var.h"
#include "sql/sql_class.h"
#include "sql/sql_const.h"
#include "sql/sql_error.h"
#include "sql/sql_lex.h"

Functions

static Opt_hints_globalget_global_hints (Parse_context *pc)
 Returns pointer to Opt_hints_global object, create Opt_hints object if not exist. More...
 
static Opt_hints_qbget_qb_hints (Parse_context *pc, Query_block *select)
 Returns pointer to Opt_hints_qb object for query block given by parse context, create Opt_hints_qb object if not exist. More...
 
static Opt_hints_qbfind_qb_hints (Parse_context *pc, const LEX_CSTRING *qb_name, PT_hint *hint)
 Find existing Opt_hints_qb object, print warning if the query block is not found. More...
 
static Opt_hints_tableget_table_hints (Parse_context *pc, Hint_param_table *table_name, Opt_hints_qb *qb)
 Returns pointer to Opt_hints_table object, create Opt_hints_table object if not exist. More...
 

Variables

struct st_opt_hint_info opt_hint_info []
 Information about hints. More...
 

Function Documentation

◆ find_qb_hints()

static Opt_hints_qb * find_qb_hints ( Parse_context pc,
const LEX_CSTRING qb_name,
PT_hint hint 
)
static

Find existing Opt_hints_qb object, print warning if the query block is not found.

Parameters
pcpointer to Parse_context object
qb_namequery block name
hintprocessed hint
Returns
pointer to Opt_hints_table object if found, NULL otherwise

◆ get_global_hints()

static Opt_hints_global * get_global_hints ( Parse_context pc)
static

Returns pointer to Opt_hints_global object, create Opt_hints object if not exist.

Parameters
pcpointer to Parse_context object
Returns
pointer to Opt_hints object, NULL if failed to create the object

◆ get_qb_hints()

static Opt_hints_qb * get_qb_hints ( Parse_context pc,
Query_block select 
)
static

Returns pointer to Opt_hints_qb object for query block given by parse context, create Opt_hints_qb object if not exist.

Parameters
pcpointer to Parse_context object
selectpointer to Query_block object
Returns
pointer to Opt_hints_qb object, NULL if failed to create the object

◆ get_table_hints()

static Opt_hints_table * get_table_hints ( Parse_context pc,
Hint_param_table table_name,
Opt_hints_qb qb 
)
static

Returns pointer to Opt_hints_table object, create Opt_hints_table object if not exist.

Parameters
pcpointer to Parse_context object
table_namepointer to Hint_param_table object
qbpointer to Opt_hints_qb object
Returns
pointer to Opt_hints_table object, NULL if failed to create the object

Variable Documentation

◆ opt_hint_info

struct st_opt_hint_info opt_hint_info[]
extern

Information about hints.

Should be synchronized with opt_hints_enum enum.

Note: Hint name depends on hint state. 'NO_' prefix is added if appropriate hint state bit(see Opt_hints_map::hints) is not set. Depending on 'switch_state_arg' argument in 'parse tree object' constructors(see parse_tree_hints.[h,cc]) implementor can control wishful form of the hint name.