MySQL 9.1.0
Source Code Documentation
|
sp_parser_data provides a scope for attributes used at the SP-parsing stage only. More...
#include <sp_head.h>
Classes | |
struct | Backpatch_info |
Public Member Functions | |
sp_parser_data () | |
void | start_parsing_sp_body (THD *thd, sp_head *sp) |
Start parsing a stored program body statement. More... | |
void | finish_parsing_sp_body (THD *thd) |
Finish parsing of a stored program body statement. More... | |
bool | is_parsing_sp_body () const |
void | process_new_sp_instr (THD *thd, sp_instr *i) |
const char * | get_current_stmt_start_ptr () const |
void | set_current_stmt_start_ptr (const char *stmt_start_ptr) |
const char * | get_option_start_ptr () const |
void | set_option_start_ptr (const char *option_start_ptr) |
const char * | get_parameter_start_ptr () const |
void | set_parameter_start_ptr (const char *ptr) |
const char * | get_parameter_end_ptr () const |
void | set_parameter_end_ptr (const char *ptr) |
const char * | get_body_start_ptr () const |
void | set_body_start_ptr (const char *ptr) |
void | push_lex (LEX *lex) |
LEX * | pop_lex () |
bool | add_backpatch_entry (sp_branch_instr *i, sp_label *label) |
Put the instruction on the backpatch list, associated with the label. More... | |
void | do_backpatch (sp_label *label, uint dest) |
Update all instruction with the given label in the backpatch list to the given instruction pointer. More... | |
bool | new_cont_backpatch () |
Start a new backpatch level for the SP-instruction requiring continue destination. More... | |
bool | add_cont_backpatch_entry (sp_lex_branch_instr *i) |
Add a SP-instruction to the current level. More... | |
void | do_cont_backpatch (uint dest) |
Backpatch (and pop) the current level to the given instruction pointer. More... | |
Private Attributes | |
const char * | m_current_stmt_start_ptr |
Start of the current statement's query string. More... | |
const char * | m_option_start_ptr |
Start of the SET-expression query string. More... | |
List< LEX > | m_lex_stack |
Stack of LEX-objects. More... | |
const char * | m_param_start_ptr |
Position in the CREATE PROCEDURE- or CREATE FUNCTION-statement's query string corresponding to the start of parameter declarations (stored procedure or stored function parameters). More... | |
const char * | m_param_end_ptr |
Position in the CREATE PROCEDURE- or CREATE FUNCTION-statement's query string corresponding to the end of parameter declarations (stored procedure or stored function parameters). More... | |
const char * | m_body_start_ptr |
Position in the CREATE-/ALTER-stored-program statement's query string corresponding to the start of the first SQL-statement. More... | |
List< Backpatch_info > | m_backpatch |
Instructions needing backpatching. More... | |
List< sp_lex_branch_instr > | m_cont_backpatch |
We need a special list for backpatching of instructions with a continue destination (in the case of a continue handler catching an error in the test), since it would otherwise interfere with the normal backpatch mechanism - e.g. More... | |
uint | m_cont_level |
The current continue backpatch level. More... | |
MEM_ROOT * | m_saved_memroot |
THD's memroot. More... | |
Item * | m_saved_item_list |
THD's item list. More... | |
sp_parser_data provides a scope for attributes used at the SP-parsing stage only.
|
inline |
bool sp_parser_data::add_backpatch_entry | ( | sp_branch_instr * | i, |
sp_label * | label | ||
) |
Put the instruction on the backpatch list, associated with the label.
i | The SP-instruction. |
label | The label. |
bool sp_parser_data::add_cont_backpatch_entry | ( | sp_lex_branch_instr * | i | ) |
Add a SP-instruction to the current level.
i | The SP-instruction. |
void sp_parser_data::do_backpatch | ( | sp_label * | label, |
uint | dest | ||
) |
Update all instruction with the given label in the backpatch list to the given instruction pointer.
label | The label. |
dest | The instruction pointer. |
void sp_parser_data::do_cont_backpatch | ( | uint | dest | ) |
Backpatch (and pop) the current level to the given instruction pointer.
dest | The instruction pointer. |
void sp_parser_data::finish_parsing_sp_body | ( | THD * | thd | ) |
Finish parsing of a stored program body statement.
This method switches THD::mem_root and THD::m_item_list back when SP-body parsing is completed.
thd | Thread context. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
true | if SP-body statement is being parsed. |
false | otherwise. |
|
inline |
Start a new backpatch level for the SP-instruction requiring continue destination.
If the SP-instruction is NULL, the level is just increased.
That's why the methods below accept sp_lex_branch_instr to make this relationship clear. And these two functions are the only places where set_cont_dest() is used, so set_cont_dest() is also a member of sp_lex_branch_instr.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Start parsing a stored program body statement.
This method switches THD::mem_root and THD::m_item_list in order to parse SP-body. The current values are kept to be restored after the body statement is parsed.
thd | Thread context. |
sp | Stored Program being parsed. |
|
private |
Instructions needing backpatching.
|
private |
Position in the CREATE-/ALTER-stored-program statement's query string corresponding to the start of the first SQL-statement.
|
private |
We need a special list for backpatching of instructions with a continue destination (in the case of a continue handler catching an error in the test), since it would otherwise interfere with the normal backpatch mechanism - e.g.
jump_if_not instructions have two different destinations which are to be patched differently. Since these occur in a more restricted way (always the same "level" in the code), we don't need the label.
|
private |
The current continue backpatch level.
|
private |
Start of the current statement's query string.
Stack of LEX-objects.
It's needed to handle processing of sub-statements.
|
private |
Start of the SET-expression query string.
|
private |
Position in the CREATE PROCEDURE- or CREATE FUNCTION-statement's query string corresponding to the end of parameter declarations (stored procedure or stored function parameters).
|
private |
Position in the CREATE PROCEDURE- or CREATE FUNCTION-statement's query string corresponding to the start of parameter declarations (stored procedure or stored function parameters).
|
private |
THD's item list.
|
private |
THD's memroot.