![]() |
MySQL 9.5.0
Source Code Documentation
|
Classes | |
| class | sp_inline_instr |
| Base class for instructions within stored programs (currently limited to stored functions) that are eligible for inlining. More... | |
| class | sp_inline_instr_freturn |
| The sp_inline_instr_freturn class provides the base implementation for inlining RETURN instructions (sp_instr_freturn) in stored functions. More... | |
| class | sp_inline_instr_set |
| The sp_inline_instr_set class provides the base implementation for inlining SET instructions (sp_instr_set) within stored functions. More... | |
| class | sp_inline_instr_stmt |
| The sp_inline_instr_stmt class provides the base implementation for inlining statement instructions (sp_instr_stmt) within stored functions. More... | |
Functions | |
| static Item * | find_variable_from_offset_inner (uint offset, std::unordered_map< uint, Item * > &map_var_offset_to_value, Item **args, uint arg_count) |
| static Item * | find_variable_from_offset (Item *var_item, std::unordered_map< uint, Item * > &map_var_offset_to_value, Item **args, uint arg_count) |
| void | report_stored_function_inlining_error (THD *thd, const char *func_name, std::string &err_reason) |
| Finalizes the error message for stored function inlining and reports the error. More... | |
| bool | needs_stored_function_inlining (THD *thd) |
| Main functions for stored function inlining. More... | |
| bool | can_inline_stored_function (THD *thd, sp_head *sp, uint sp_arg_count) |
| Checks if general stored function properties are eligible for inlining. More... | |
| Mem_root_array< sp_inline_instr * > * | prepare (THD *thd, sp_head *sp, std::unordered_set< sp_head * > &used_sp_functions) |
| Creates the list of prepared instructions. More... | |
| Item * | inline_stored_function (THD *thd, Mem_root_array< sp_inline_instr * > *prepared_instructions, Item **sp_args, uint sp_arg_count, sp_head *sp_head, Name_resolution_context *sp_name_resolution_ctx) |
| Inlines the given stored function instructions into a single Item. More... | |
Checks if general stored function properties are eligible for inlining.
| [in] | thd | Thread context |
| [in] | sp | Stored program (function) instance |
| [in] | sp_arg_count | Number of arguments of the stored function |
|
static |
|
static |
| Item * sp_inl::inline_stored_function | ( | THD * | thd, |
| Mem_root_array< sp_inline_instr * > * | prepared_instructions, | ||
| Item ** | sp_args, | ||
| uint | sp_arg_count, | ||
| sp_head * | sp_head, | ||
| Name_resolution_context * | sp_name_resolution_ctx | ||
| ) |
Inlines the given stored function instructions into a single Item.
| [in] | thd | Thread context |
| [in] | prepared_instructions | Instructions to inline |
| [in] | sp_args | Input arguments of the stored function |
| [in] | sp_arg_count | Number of arguments of the stored function |
| [in] | sp_head | Stored function instance |
| [in] | sp_name_resolution_ctx | Name resolution context of the stored function |
| bool sp_inl::needs_stored_function_inlining | ( | THD * | thd | ) |
Main functions for stored function inlining.
Checks if stored function inlining is required.
Currently we attempt stored function inlining only for the secondary engine. In certain cases (such as PFS creation) m_sql_cmd could be nullptr.
| [in] | thd | Thread context |
| Mem_root_array< sp_inline_instr * > * sp_inl::prepare | ( | THD * | thd, |
| sp_head * | sp, | ||
| std::unordered_set< sp_head * > & | used_sp_functions | ||
| ) |
Creates the list of prepared instructions.
A prepared instruction is an instruction eligible for inlining according to its method validate(). This function also computes and marks the redundant instructions so they can be later recognized using the method is_redundant_instr(). A redundant instruction is an instruction not needed for computing the returned result of the stored function.
| [in] | thd | Thread context |
| [in] | sp | Stored program (stored function) instance |
| [out] | used_sp_functions | Set of stored function instances called from sp |
| void sp_inl::report_stored_function_inlining_error | ( | THD * | thd, |
| const char * | func_name, | ||
| std::string & | err_reason | ||
| ) |
Finalizes the error message for stored function inlining and reports the error.
| [in] | thd | Thread context |
| [in] | func_name | Stored function name |
| [in] | err_reason | Failure reason |