mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixed BUG#12379: PROCEDURE with HANDLER calling FUNCTION with error
get strange result according to Monty's suggestions, fixing the SELECT behaviour on errors with SP handlers. Note that some warnings from SELECT still shows up when the handler has caught - this is an effect of another known bug (BUG#7049).
This commit is contained in:
@ -4108,6 +4108,61 @@ drop procedure bug131333|
|
||||
drop function bug131333|
|
||||
|
||||
|
||||
#
|
||||
# BUG#12379: PROCEDURE with HANDLER calling FUNCTION with error get
|
||||
# strange result
|
||||
#
|
||||
--disable_warnings
|
||||
drop function if exists bug12379|
|
||||
drop procedure if exists bug12379_1|
|
||||
drop procedure if exists bug12379_2|
|
||||
drop procedure if exists bug12379_3|
|
||||
drop table if exists t3|
|
||||
--enable_warnings
|
||||
|
||||
create table t3 (c1 char(1) primary key not null)|
|
||||
|
||||
create function bug12379()
|
||||
returns integer
|
||||
begin
|
||||
insert into t3 values('X');
|
||||
insert into t3 values('X');
|
||||
return 0;
|
||||
end|
|
||||
|
||||
create procedure bug12379_1()
|
||||
begin
|
||||
declare exit handler for sqlexception select 42;
|
||||
|
||||
select bug12379();
|
||||
END|
|
||||
create procedure bug12379_2()
|
||||
begin
|
||||
declare exit handler for sqlexception begin end;
|
||||
|
||||
select bug12379();
|
||||
end|
|
||||
create procedure bug12379_3()
|
||||
begin
|
||||
select bug12379();
|
||||
end|
|
||||
|
||||
--error 1062
|
||||
select bug12379()|
|
||||
select 1|
|
||||
call bug12379_1()|
|
||||
select 2|
|
||||
call bug12379_2()|
|
||||
select 3|
|
||||
--error 1062
|
||||
call bug12379_3()|
|
||||
select 4|
|
||||
|
||||
drop function bug12379|
|
||||
drop procedure bug12379_1|
|
||||
drop procedure bug12379_2|
|
||||
drop procedure bug12379_3|
|
||||
|
||||
#
|
||||
# BUG#NNNN: New bug synopsis
|
||||
#
|
||||
|
Reference in New Issue
Block a user