summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorpem@mysql.com <>2006-01-25 17:19:54 +0100
committerpem@mysql.com <>2006-01-25 17:19:54 +0100
commit998f0c0aa32116bf094d4e4ac407ee6c6a3a1629 (patch)
tree293c4c465e55ca4f595ab77c8504a3b583dd7271 /sql
parent933dfc583d7092a9554cc086769e5f789e9620de (diff)
downloadmariadb-git-998f0c0aa32116bf094d4e4ac407ee6c6a3a1629.tar.gz
Fixed BUGS#15011: error handler for mysql errno in nested block not activated
For nested sql errno handlers (unlike sqlexception and other), we didn't stop searching when the innermost handler was found - now make sure we do.
Diffstat (limited to 'sql')
-rw-r--r--sql/sp_rcontext.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc
index 215de01e657..4818ffbbe31 100644
--- a/sql/sp_rcontext.cc
+++ b/sql/sp_rcontext.cc
@@ -188,7 +188,8 @@ sp_rcontext::find_handler(uint sql_errno,
switch (cond->type)
{
case sp_cond_type_t::number:
- if (sql_errno == cond->mysqlerr)
+ if (sql_errno == cond->mysqlerr &&
+ (found < 0 || m_handler[found].cond->type > sp_cond_type_t::number))
found= i; // Always the most specific
break;
case sp_cond_type_t::state: