diff options
author | unknown <pem@mysql.comhem.se> | 2005-04-08 17:31:37 +0200 |
---|---|---|
committer | unknown <pem@mysql.comhem.se> | 2005-04-08 17:31:37 +0200 |
commit | 4215d120a358c1e041a4cf1ee619dda271546fcc (patch) | |
tree | dcc647596de507271dd8467939f982c653749834 /sql/sp_rcontext.cc | |
parent | 5f006200d10542da309b9b8c21e810e9da8f637d (diff) | |
download | mariadb-git-4215d120a358c1e041a4cf1ee619dda271546fcc.tar.gz |
Fixed BUG#6900: Stored procedure inner handler ignored
and BUG#9074: STORED PROC: The scope of every handler declared is not properly applied
mysql-test/r/sp.result:
New test cases for BUG#6900 and BUG#9074 (duplicates).
mysql-test/t/sp.test:
New test cases for BUG#6900 and BUG#9074 (duplicates).
sql/sp_rcontext.cc:
Corrected logic for finding condition handlers - pick the innermost one.
Diffstat (limited to 'sql/sp_rcontext.cc')
-rw-r--r-- | sql/sp_rcontext.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc index e9271146cad..d98cdfdd226 100644 --- a/sql/sp_rcontext.cc +++ b/sql/sp_rcontext.cc @@ -80,24 +80,24 @@ sp_rcontext::find_handler(uint sql_errno, break; case sp_cond_type_t::state: if (strcmp(sqlstate, cond->sqlstate) == 0 && - (found < 0 || m_handler[found].cond->type > sp_cond_type_t::number)) + (found < 0 || m_handler[found].cond->type > sp_cond_type_t::state)) found= i; break; case sp_cond_type_t::warning: if ((sqlstate[0] == '0' && sqlstate[1] == '1' || level == MYSQL_ERROR::WARN_LEVEL_WARN) && - (found < 0 || m_handler[found].cond->type > sp_cond_type_t::state)) + found < 0) found= i; break; case sp_cond_type_t::notfound: if (sqlstate[0] == '0' && sqlstate[1] == '2' && - (found < 0 || m_handler[found].cond->type > sp_cond_type_t::state)) + found < 0) found= i; break; case sp_cond_type_t::exception: if ((sqlstate[0] != '0' || sqlstate[1] > '2') && level == MYSQL_ERROR::WARN_LEVEL_ERROR && - (found < 0 || m_handler[found].cond->type > sp_cond_type_t::state)) + found < 0) found= i; break; } |