mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix Bug#11333 "Stored Procedure: Memory blow up on repeated SELECT ... INTO query"
mysql-test/r/sp.result: update result mysql-test/t/sp.test: Add test for Bug #11333 "Stored Procedure: Memory blow up on repeated SELECT ... INTO query" sql/item.cc: we should call destructors for Items before reuse sql/item.h: Add new method and constructor for Item_string. sql/sp_head.cc: String allocation should be done on the system heap for now.
This commit is contained in:
@ -3166,4 +3166,23 @@ a
|
||||
4
|
||||
truncate t2|
|
||||
drop procedure if exists bug12168|
|
||||
drop table if exists t3|
|
||||
drop procedure if exists bug11333|
|
||||
create table t3 (c1 char(128))|
|
||||
insert into t3 values
|
||||
('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA')|
|
||||
create procedure bug11333(i int)
|
||||
begin
|
||||
declare tmp varchar(128);
|
||||
set @x = 0;
|
||||
repeat
|
||||
select c1 into tmp from t3
|
||||
where c1 = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
|
||||
set @x = @x + 1;
|
||||
until @x >= i
|
||||
end repeat;
|
||||
end|
|
||||
call bug11333(10)|
|
||||
drop procedure bug11333|
|
||||
drop table t3|
|
||||
drop table t1,t2;
|
||||
|
@ -3995,6 +3995,40 @@ select * from t2|
|
||||
truncate t2|
|
||||
drop procedure if exists bug12168|
|
||||
|
||||
#
|
||||
# Bug #11333 "Stored Procedure: Memory blow up on repeated SELECT ... INTO
|
||||
# query"
|
||||
# One more memleak bug. Use the test to check memory consumption.
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t3|
|
||||
drop procedure if exists bug11333|
|
||||
--enable_warnings
|
||||
|
||||
create table t3 (c1 char(128))|
|
||||
|
||||
insert into t3 values
|
||||
('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA')|
|
||||
|
||||
|
||||
create procedure bug11333(i int)
|
||||
begin
|
||||
declare tmp varchar(128);
|
||||
set @x = 0;
|
||||
repeat
|
||||
select c1 into tmp from t3
|
||||
where c1 = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
|
||||
set @x = @x + 1;
|
||||
until @x >= i
|
||||
end repeat;
|
||||
end|
|
||||
|
||||
call bug11333(10)|
|
||||
|
||||
drop procedure bug11333|
|
||||
drop table t3|
|
||||
|
||||
#
|
||||
# BUG#NNNN: New bug synopsis
|
||||
#
|
||||
|
Reference in New Issue
Block a user