MCPcopy Create free account
hub / github.com/MariaDB/server / find_variable

Method find_variable

sql/sql_lex.cc:6964–6986  ·  view source on GitHub ↗

Find a local or a package body variable by name. @param IN name - the variable name @param OUT ctx - NULL, if the variable was not found, or LEX::spcont (if a local variable was found) or the package top level context (if a package variable was found) @param OUT handler - NULL, if the variable was not found,

Source from the content-addressed store, hash-verified

6962 @retval - the variable (if found), or NULL otherwise.
6963*/
6964sp_variable *
6965LEX::find_variable(const LEX_CSTRING *name,
6966 sp_pcontext **ctx,
6967 const Sp_rcontext_handler **rh) const
6968{
6969 sp_variable *spv;
6970 if (spcont && (spv= spcont->find_variable(name, false)))
6971 {
6972 *ctx= spcont;
6973 *rh= &sp_rcontext_handler_local;
6974 return spv;
6975 }
6976 sp_package *pkg= sphead ? sphead->m_parent : NULL;
6977 if (pkg && (spv= pkg->find_package_variable(name)))
6978 {
6979 *ctx= pkg->get_parse_context()->child_context(0);
6980 *rh= &sp_rcontext_handler_package_body;
6981 return spv;
6982 }
6983 *ctx= NULL;
6984 *rh= NULL;
6985 return NULL;
6986}
6987
6988
6989bool LEX::check_variable_is_refcursor(const LEX_CSTRING &verb_clause,

Callers 14

init_methodMethod · 0.45
find_package_variableMethod · 0.45
bind_input_paramMethod · 0.45
bind_output_paramMethod · 0.45
store_schema_paramsFunction · 0.45
sp_param_initMethod · 0.45
on_after_expr_parsingMethod · 0.45
printMethod · 0.45
make_outvar_fieldMethod · 0.45

Calls 3

find_package_variableMethod · 0.80
child_contextMethod · 0.80
get_parse_contextMethod · 0.80

Tested by

no test coverage detected