summaryrefslogtreecommitdiff
path: root/sql/sp_head.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sp_head.h')
-rw-r--r--sql/sp_head.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/sql/sp_head.h b/sql/sp_head.h
index 601d41ab04a..cea7d27afee 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -625,6 +625,23 @@ public:
DBUG_RETURN(false);
}
+ /**
+ Iterate through the LEX stack from the top (the newest) to the bottom
+ (the oldest) and find the one that contains a non-zero spname.
+ @returns - the address of spname, or NULL of no spname found.
+ */
+ const sp_name *find_spname_recursive()
+ {
+ uint count= m_lex.elements;
+ for (uint i= 0; i < count; i++)
+ {
+ const LEX *tmp= m_lex.elem(count - i - 1);
+ if (tmp->spname)
+ return tmp->spname;
+ }
+ return NULL;
+ }
+
/// Put the instruction on the backpatch list, associated with the label.
int
push_backpatch(THD *thd, sp_instr *, sp_label *);
@@ -1041,7 +1058,8 @@ public:
Query_arena(thd->lex->sphead->get_main_mem_root(), STMT_INITIALIZED_FOR_SP)
{ }
~sp_lex_cursor() { free_items(); }
- void cleanup_stmt(bool /*restore_set_statement_vars*/) { }
+ virtual bool cleanup_stmt(bool /*restore_set_statement_vars*/) override
+ { return false; }
Query_arena *query_arena() { return this; }
bool validate()
{
@@ -1831,8 +1849,8 @@ public:
cursor is closed. For now stored procedures always use materialized
cursors and the call is not used.
*/
- virtual void cleanup_stmt(bool /*restore_set_statement_vars*/)
- { /* no op */ }
+ virtual bool cleanup_stmt(bool /*restore_set_statement_vars*/) override
+ { return false; }
private:
sp_lex_keeper m_lex_keeper;