From fc5db9351610fed5405df1e26a0e7623d27c5f4d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 8 Apr 2005 19:58:04 +0200 Subject: Fixed BUG#9073: Able to declare two handlers for same condition in same scope mysql-test/r/sp-error.result: Added test case for BUG#9073. mysql-test/t/sp-error.test: Added test case for BUG#9073. sql/share/errmsg.txt: New error message for duplicate condition handlers in stored procedures. sql/sp_pcontext.cc: Keep track on condition handlers in the same block for error checking. sql/sp_pcontext.h: Keep track on condition handlers in the same block for error checking. sql/sql_yacc.yy: Keep track on condition handlers in the same block for error checking. --- sql/sp_pcontext.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sql/sp_pcontext.h') diff --git a/sql/sp_pcontext.h b/sql/sp_pcontext.h index 42d8140b78c..dbce191975a 100644 --- a/sql/sp_pcontext.h +++ b/sql/sp_pcontext.h @@ -241,6 +241,15 @@ class sp_pcontext : public Sql_alloc m_handlers+= 1; } + inline void + push_handler(sp_cond_type_t *cond) + { + insert_dynamic(&m_handler, (gptr)&cond); + } + + bool + find_handler(sp_cond_type *cond); + inline uint max_handlers() { @@ -293,6 +302,7 @@ private: DYNAMIC_ARRAY m_pvar; // Parameters/variables DYNAMIC_ARRAY m_cond; // Conditions DYNAMIC_ARRAY m_cursor; // Cursors + DYNAMIC_ARRAY m_handler; // Handlers, for checking of duplicates List m_label; // The label list -- cgit v1.2.1