summaryrefslogtreecommitdiff
path: root/sql/sp_rcontext.cc
diff options
context:
space:
mode:
authorunknown <pem@mysql.com>2006-01-25 17:19:54 +0100
committerunknown <pem@mysql.com>2006-01-25 17:19:54 +0100
commitcc037976c3205a010d522c6318ba86cb67017c4e (patch)
tree293c4c465e55ca4f595ab77c8504a3b583dd7271 /sql/sp_rcontext.cc
parentd9a008d970c3e579c839d586c39110b0625c5b2e (diff)
downloadmariadb-git-cc037976c3205a010d522c6318ba86cb67017c4e.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. mysql-test/r/sp.result: Updated result for BUG#15011. mysql-test/t/sp.test: New testcase for BUG#15011. sql/sp_rcontext.cc: Make sure we stop at the innermost sql_errno handler.
Diffstat (limited to 'sql/sp_rcontext.cc')
-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: