mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Fixed BUG#9598: stored procedure call within stored procedure
overwrites IN variable and added error checking of variables for [IN]OUT parameters while rewriting the out parameter handling.
This commit is contained in:
@@ -410,6 +410,31 @@ begin
|
||||
label L1;
|
||||
end|
|
||||
|
||||
# Check in and inout arguments.
|
||||
--disable_warnings
|
||||
drop procedure if exists p|
|
||||
--enable_warnings
|
||||
create procedure p(in x int, inout y int, out z int)
|
||||
begin
|
||||
set y = x+y;
|
||||
set z = x+y;
|
||||
end|
|
||||
|
||||
set @tmp_x = 42|
|
||||
set @tmp_y = 3|
|
||||
set @tmp_z = 0|
|
||||
# For reference: this is ok
|
||||
call p(@tmp_x, @tmp_y, @tmp_z)|
|
||||
select @tmp_x, @tmp_y, @tmp_z|
|
||||
|
||||
--error ER_SP_NOT_VAR_ARG
|
||||
call p(42, 43, @tmp_z)|
|
||||
--error ER_SP_NOT_VAR_ARG
|
||||
call p(42, @tmp_y, 43)|
|
||||
|
||||
drop procedure p|
|
||||
|
||||
|
||||
#
|
||||
# BUG#1965
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user