diff options
Diffstat (limited to 'sql/sp_rcontext.cc')
-rw-r--r-- | sql/sp_rcontext.cc | 3 |
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: |