mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
fix for Bug #12849 Stored Procedure: Crash on procedure call with CHAR type 'INOUT' parameter
(recommit with the right Bug#) mysql-test/r/sp.result: result file modified to reflect new test mysql-test/t/sp.test: added test for the bug sql/item.cc: protect Item_splocal value from modification by CONCAT() et al sql/item.h: added a buffer to save Item_splocal string pointer sql/sp_head.cc: don't employ reuse mechanism to save var into itself
This commit is contained in:
@ -3193,4 +3193,23 @@ set f1= concat( 'hello', f1 );
|
||||
return f1;
|
||||
end|
|
||||
drop function bug9048|
|
||||
drop procedure if exists bug12849_1|
|
||||
create procedure bug12849_1(inout x char) select x into x|
|
||||
set @var='a'|
|
||||
call bug12849_1(@var)|
|
||||
select @var|
|
||||
@var
|
||||
a
|
||||
drop procedure bug12849_1|
|
||||
drop procedure if exists bug12849_2|
|
||||
create procedure bug12849_2(inout foo varchar(15))
|
||||
begin
|
||||
select concat(foo, foo) INTO foo;
|
||||
end|
|
||||
set @var='abcd'|
|
||||
call bug12849_2(@var)|
|
||||
select @var|
|
||||
@var
|
||||
abcdabcd
|
||||
drop procedure bug12849_2|
|
||||
drop table t1,t2;
|
||||
|
@ -4043,6 +4043,32 @@ begin
|
||||
end|
|
||||
drop function bug9048|
|
||||
|
||||
#
|
||||
# Bug #12849 Stored Procedure: Crash on procedure call with CHAR type
|
||||
# 'INOUT' parameter
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop procedure if exists bug12849_1|
|
||||
--enable_warnings
|
||||
create procedure bug12849_1(inout x char) select x into x|
|
||||
set @var='a'|
|
||||
call bug12849_1(@var)|
|
||||
select @var|
|
||||
drop procedure bug12849_1|
|
||||
|
||||
--disable_warnings
|
||||
drop procedure if exists bug12849_2|
|
||||
--enable_warnings
|
||||
create procedure bug12849_2(inout foo varchar(15))
|
||||
begin
|
||||
select concat(foo, foo) INTO foo;
|
||||
end|
|
||||
set @var='abcd'|
|
||||
call bug12849_2(@var)|
|
||||
select @var|
|
||||
drop procedure bug12849_2|
|
||||
|
||||
#
|
||||
# BUG#NNNN: New bug synopsis
|
||||
#
|
||||
|
Reference in New Issue
Block a user