diff options
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r-- | sql/sql_lex.h | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 45fbe38e974..5710c990855 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -2343,6 +2343,19 @@ public: return m_cpp_ptr; } + /** + Get the current stream pointer, in the pre-processed buffer, + with traling spaces removed. + */ + const char *get_cpp_ptr_rtrim() + { + const char *p; + for (p= m_cpp_ptr; + p > m_cpp_buf && my_isspace(system_charset_info, p[-1]); + p--) + { } + return p; + } /** Get the utf8-body string. */ const char *get_body_utf8_str() { @@ -3212,15 +3225,10 @@ public: sp_name *make_sp_name(THD *thd, const LEX_CSTRING *name); sp_name *make_sp_name(THD *thd, const LEX_CSTRING *name1, const LEX_CSTRING *name2); + sp_name *make_sp_name_package_routine(THD *thd, const LEX_CSTRING *name); sp_head *make_sp_head(THD *thd, const sp_name *name, const Sp_handler *sph); sp_head *make_sp_head_no_recursive(THD *thd, const sp_name *name, - const Sp_handler *sph) - { - if (!sphead) - return make_sp_head(thd, name, sph); - my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), sph->type_str()); - return NULL; - } + const Sp_handler *sph); sp_head *make_sp_head_no_recursive(THD *thd, DDL_options_st options, sp_name *name, const Sp_handler *sph) @@ -3231,10 +3239,29 @@ public: } bool sp_body_finalize_function(THD *); bool sp_body_finalize_procedure(THD *); + sp_package *create_package_start(THD *thd, + enum_sql_command command, + const Sp_handler *sph, + const sp_name *name, + DDL_options_st options); + bool create_package_finalize(THD *thd, + const sp_name *name, + const sp_name *name2, + const char *body_start, + const char *body_end); bool call_statement_start(THD *thd, sp_name *name); bool call_statement_start(THD *thd, const LEX_CSTRING *name); bool call_statement_start(THD *thd, const LEX_CSTRING *name1, const LEX_CSTRING *name2); + sp_variable *find_variable(const LEX_CSTRING *name, + sp_pcontext **ctx, + const Sp_rcontext_handler **rh) const; + sp_variable *find_variable(const LEX_CSTRING *name, + const Sp_rcontext_handler **rh) const + { + sp_pcontext *not_used_ctx; + return find_variable(name, ¬_used_ctx, rh); + } bool init_internal_variable(struct sys_var_with_base *variable, const LEX_CSTRING *name); bool init_internal_variable(struct sys_var_with_base *variable, @@ -3318,6 +3345,7 @@ public: /* Create an Item corresponding to a ROW field valiable: var.field @param THD - THD, for mem_root + @param rh [OUT] - the rcontext handler (local vs package variables) @param var - the ROW variable name @param field - the ROW variable field name @param spvar - the variable that was previously found by name @@ -3326,6 +3354,7 @@ public: @param end - end in the query (for binary log) */ Item_splocal *create_item_spvar_row_field(THD *thd, + const Sp_rcontext_handler *rh, const LEX_CSTRING *var, const LEX_CSTRING *field, sp_variable *spvar, @@ -3419,6 +3448,8 @@ public: Item *make_item_func_replace(THD *thd, Item *org, Item *find, Item *replace); Item *make_item_func_substr(THD *thd, Item *a, Item *b, Item *c); Item *make_item_func_substr(THD *thd, Item *a, Item *b); + my_var *create_outvar(THD *thd, const LEX_CSTRING *name); + /* Create a my_var instance for a ROW field variable that was used as an OUT SP parameter: CALL p1(var.field); @@ -3479,6 +3510,7 @@ public: bool sp_block_with_exceptions_finalize_exceptions(THD *thd, uint executable_section_ip, uint exception_count); + bool sp_block_with_exceptions_add_empty(THD *thd); bool sp_exit_statement(THD *thd, Item *when); bool sp_exit_statement(THD *thd, const LEX_CSTRING *label_name, Item *item); bool sp_leave_statement(THD *thd, const LEX_CSTRING *label_name); @@ -3728,6 +3760,7 @@ public: { return create_info.vers_info; } + sp_package *get_sp_package() const; }; |