-
Alexander Nozdrin authored
program statements. This patch contains the following refactorings: - Introduce enum_sp_type enum with type-code constants for stored procedures, functions and triggers (SP_TYPE_FUNCTION, SP_TYPE_PROCEDURE, SP_TYPE_TRIGGER). Those constants should be used instead of TYPE_ENUM_ macros. - Introduce sp_start_parsing() and sp_finish_parsing() functions to be used in the parser instead of the typical sequence of operations (including reset_thd_mem_root() and restore_thd_mem_root()). - Introduce sp_parser_data class -- the class that contains attributes used at the SP-parsing time only. sp_parser_data has been extracted from sp_head. - Get rid of sp_head::m_tmp_query -- a pointer, which pointed to different things. Introduced various push_xxx_ptr() / pop_xxx_ptr() instead. - Move LEX::trg_table_fields to sp_head::m_trg_table_fields. - Move LEX::trg_chistics to sp_head::m_trg_chistics. - Use Table_triggers_list::trigger_table in a member function (Table_triggers_list::prepare_record1_accessors) instead of passing the table object by argument. - Change ambiguous names - THD::spcont -> THD::sp_runtime_ctx - LEX::spcont -> LEX::sp_current_parsing_ctx - sp_head::m_pcont -> sp_head::m_parsing_ctx - sp_head::get_parse_ctx() -> sp_head::get_parsing_ctx() - sp_head::m_parsing_ctx -> sp_head::m_root_parsing_ctx - sp_head::push_backpatch() -> sp_parser_data::add_backpatch_entry() - sp_head::push_cont_backpatch() -> sp_parser_data::add_cont_backpatch_entry() - sp_head::backpatch() -> sp_parser_data::do_backpatch() - bp_t -> Backpatch_info - bp_t::lab -> Backpatch_info::label - sp_instr::is_marked() -> sp_instr::opt_is_marked() - Make LEX::sp_current_parsing_ctx private and provide get/set accessors for it. - Remove sp_runtime_ctx_saved from sp_head::execute() as it is not used. - Combine sp_pcontext::register_case_expr() and sp_pcontext::push_case_expr_id(). - Add two new methods in the Dynamic_array template: - elements(uint) to directly assign the number of elements; - set(index, element) to directly assign item at the given index. - Change sp_head::m_instr to be of Dynamic_array instead of DYNAMIC_ARRAY. - Make operations return bool instead of int, use boolean values instead of numbers. - Avoid SP-variable substitution for SET-statements. It did not work properly anyway -- the positions of Item_splocal were not properly calculated. In any case, it does not make sense to do the substitution for SET-statememnts, because they are not bin-logged. - Use placement new explicitly for SP-instruction instantiations. - Use accessors (sp_head::get_ip()) instead of attibutes (sp_head::m_ip). - Move global functions out of sp_head.h/.cc to sp.h/.cc - Introduce sp_printable interface to be used in the Optimizer Traces (to avoid using sp_instr there). - Introduce sp_branch_instr class -- an interface for all SP-instructions with destinations that need to be updated by the SP-optimizer. - Introduce sp_lex_instr class -- base class for SP-instructions, whose execution is based on expression evaluation.
Alexander Nozdrin authoredprogram statements. This patch contains the following refactorings: - Introduce enum_sp_type enum with type-code constants for stored procedures, functions and triggers (SP_TYPE_FUNCTION, SP_TYPE_PROCEDURE, SP_TYPE_TRIGGER). Those constants should be used instead of TYPE_ENUM_ macros. - Introduce sp_start_parsing() and sp_finish_parsing() functions to be used in the parser instead of the typical sequence of operations (including reset_thd_mem_root() and restore_thd_mem_root()). - Introduce sp_parser_data class -- the class that contains attributes used at the SP-parsing time only. sp_parser_data has been extracted from sp_head. - Get rid of sp_head::m_tmp_query -- a pointer, which pointed to different things. Introduced various push_xxx_ptr() / pop_xxx_ptr() instead. - Move LEX::trg_table_fields to sp_head::m_trg_table_fields. - Move LEX::trg_chistics to sp_head::m_trg_chistics. - Use Table_triggers_list::trigger_table in a member function (Table_triggers_list::prepare_record1_accessors) instead of passing the table object by argument. - Change ambiguous names - THD::spcont -> THD::sp_runtime_ctx - LEX::spcont -> LEX::sp_current_parsing_ctx - sp_head::m_pcont -> sp_head::m_parsing_ctx - sp_head::get_parse_ctx() -> sp_head::get_parsing_ctx() - sp_head::m_parsing_ctx -> sp_head::m_root_parsing_ctx - sp_head::push_backpatch() -> sp_parser_data::add_backpatch_entry() - sp_head::push_cont_backpatch() -> sp_parser_data::add_cont_backpatch_entry() - sp_head::backpatch() -> sp_parser_data::do_backpatch() - bp_t -> Backpatch_info - bp_t::lab -> Backpatch_info::label - sp_instr::is_marked() -> sp_instr::opt_is_marked() - Make LEX::sp_current_parsing_ctx private and provide get/set accessors for it. - Remove sp_runtime_ctx_saved from sp_head::execute() as it is not used. - Combine sp_pcontext::register_case_expr() and sp_pcontext::push_case_expr_id(). - Add two new methods in the Dynamic_array template: - elements(uint) to directly assign the number of elements; - set(index, element) to directly assign item at the given index. - Change sp_head::m_instr to be of Dynamic_array instead of DYNAMIC_ARRAY. - Make operations return bool instead of int, use boolean values instead of numbers. - Avoid SP-variable substitution for SET-statements. It did not work properly anyway -- the positions of Item_splocal were not properly calculated. In any case, it does not make sense to do the substitution for SET-statememnts, because they are not bin-logged. - Use placement new explicitly for SP-instruction instantiations. - Use accessors (sp_head::get_ip()) instead of attibutes (sp_head::m_ip). - Move global functions out of sp_head.h/.cc to sp.h/.cc - Introduce sp_printable interface to be used in the Optimizer Traces (to avoid using sp_instr there). - Introduce sp_branch_instr class -- an interface for all SP-instructions with destinations that need to be updated by the SP-optimizer. - Introduce sp_lex_instr class -- base class for SP-instructions, whose execution is based on expression evaluation.
Loading