Fixed BUG#6029: Stored procedure specific handlers should have priority.

mysql-test/r/sp.result:
  New test case for BUG#6022.
mysql-test/t/sp.test:
  New test case for BUG#6022.
sql/sp_rcontext.cc:
  Find the most specific condition handler, not just the first one.
  (And corrected the return type for find_handler)
sql/sp_rcontext.h:
  Corrected return type for find_handler.
This commit is contained in:
unknown 2004-10-23 14:23:32 +02:00
commit 4c06b4aed7
4 changed files with 69 additions and 18 deletions

View file

@ -2109,6 +2109,32 @@ end|
select bug6022(5)|
drop function bug6022|
#
# BUG#6029: Stored procedure specific handlers should have priority
#
--disable_warnings
drop procedure if exists bug6029|
--enable_warnings
create procedure bug6029()
begin
declare exit handler for 1136 select '1136';
declare exit handler for sqlstate '23000' select 'sqlstate 23000';
declare continue handler for sqlexception select 'sqlexception';
insert into t3 values (1);
insert into t3 values (1,2);
end|
create table t3 (s1 int, primary key (s1))|
insert into t3 values (1)|
call bug6029()|
delete from t3|
call bug6029()|
drop procedure bug6029|
drop table t3|
#
# Some "real" examples