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,
| 6962 | @retval - the variable (if found), or NULL otherwise. |
| 6963 | */ |
| 6964 | sp_variable * |
| 6965 | LEX::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 | |
| 6989 | bool LEX::check_variable_is_refcursor(const LEX_CSTRING &verb_clause, |
no test coverage detected