Commit bebaaac5 authored by pem@mysql.comhem.se's avatar pem@mysql.comhem.se

New test case for BUG#4726: Stored procedure crash when looping over SELECT with complex WHERE's.

(The fix was merged in from 4.1)
parent d1c454a6
...@@ -1408,6 +1408,25 @@ Warnings: ...@@ -1408,6 +1408,25 @@ Warnings:
drop procedure bug4579_1| drop procedure bug4579_1|
drop procedure bug4579_2| drop procedure bug4579_2|
drop table t3| drop table t3|
drop table if exists t3|
create table t3 (f1 int, f2 int, f3 int)|
insert into t3 values (1,1,1)|
create procedure bug4726()
begin
declare tmp_o_id INT;
declare tmp_d_id INT default 1;
while tmp_d_id <= 2 do
begin
select f1 into tmp_o_id from t3 where f2=1 and f3=1;
set tmp_d_id = tmp_d_id + 1;
end;
end while;
end|
call bug4726()|
call bug4726()|
call bug4726()|
drop procedure bug4726|
drop table t3|
drop table if exists fac| drop table if exists fac|
create table fac (n int unsigned not null primary key, f bigint unsigned)| create table fac (n int unsigned not null primary key, f bigint unsigned)|
create procedure ifac(n int unsigned) create procedure ifac(n int unsigned)
......
...@@ -1623,6 +1623,37 @@ drop procedure bug4579_2| ...@@ -1623,6 +1623,37 @@ drop procedure bug4579_2|
drop table t3| drop table t3|
#
# BUG#4726
#
--disable_warnings
drop table if exists t3|
--enable_warnings
create table t3 (f1 int, f2 int, f3 int)|
insert into t3 values (1,1,1)|
create procedure bug4726()
begin
declare tmp_o_id INT;
declare tmp_d_id INT default 1;
while tmp_d_id <= 2 do
begin
select f1 into tmp_o_id from t3 where f2=1 and f3=1;
set tmp_d_id = tmp_d_id + 1;
end;
end while;
end|
call bug4726()|
call bug4726()|
call bug4726()|
drop procedure bug4726|
drop table t3|
# #
# Some "real" examples # Some "real" examples
# #
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment