summaryrefslogtreecommitdiff
path: root/mysql-test/t/sp-code.test
diff options
context:
space:
mode:
authorunknown <malff@lambda.hsd1.co.comcast.net.>2008-01-23 15:36:57 -0700
committerunknown <malff@lambda.hsd1.co.comcast.net.>2008-01-23 15:36:57 -0700
commit9d96bb98a6b010ae708e481c22b0938a7e03c527 (patch)
treedf28f0505d70db18b9ba5e1f32959cbcde27b87a /mysql-test/t/sp-code.test
parentfca38dd705a655cf64e2826b7b693148844b8690 (diff)
parent8430df5a07e7175d2ff2a43dd80ac8f20538887d (diff)
downloadmariadb-git-9d96bb98a6b010ae708e481c22b0938a7e03c527.tar.gz
Merge lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.0-33618
into lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-33618 mysql-test/r/sp-code.result: Auto merged mysql-test/t/sp-code.test: Auto merged sql/sp_head.cc: Auto merged sql/sp_head.h: Auto merged sql/sp_rcontext.cc: Auto merged
Diffstat (limited to 'mysql-test/t/sp-code.test')
-rw-r--r--mysql-test/t/sp-code.test77
1 files changed, 77 insertions, 0 deletions
diff --git a/mysql-test/t/sp-code.test b/mysql-test/t/sp-code.test
index 66d5323d2e2..84f0201c808 100644
--- a/mysql-test/t/sp-code.test
+++ b/mysql-test/t/sp-code.test
@@ -520,6 +520,83 @@ drop table t1;
drop procedure proc_26977_broken;
drop procedure proc_26977_works;
+#
+# Bug#33618 Crash in sp_rcontext
+#
+
+--disable_warnings
+drop procedure if exists proc_33618_h;
+drop procedure if exists proc_33618_c;
+--enable_warnings
+
+delimiter //;
+
+create procedure proc_33618_h(num int)
+begin
+ declare count1 int default '0';
+ declare vb varchar(30);
+ declare last_row int;
+
+ while(num>=1) do
+ set num=num-1;
+ begin
+ declare cur1 cursor for select `a` from t_33618;
+ declare continue handler for not found set last_row = 1;
+ set last_row:=0;
+ open cur1;
+ rep1:
+ repeat
+ begin
+ declare exit handler for 1062 begin end;
+ fetch cur1 into vb;
+ if (last_row = 1) then
+ ## should generate a hpop instruction here
+ leave rep1;
+ end if;
+ end;
+ until last_row=1
+ end repeat;
+ close cur1;
+ end;
+ end while;
+end//
+
+create procedure proc_33618_c(num int)
+begin
+ declare count1 int default '0';
+ declare vb varchar(30);
+ declare last_row int;
+
+ while(num>=1) do
+ set num=num-1;
+ begin
+ declare cur1 cursor for select `a` from t_33618;
+ declare continue handler for not found set last_row = 1;
+ set last_row:=0;
+ open cur1;
+ rep1:
+ repeat
+ begin
+ declare cur2 cursor for select `b` from t_33618;
+ fetch cur1 into vb;
+ if (last_row = 1) then
+ ## should generate a cpop instruction here
+ leave rep1;
+ end if;
+ end;
+ until last_row=1
+ end repeat;
+ close cur1;
+ end;
+ end while;
+end//
+delimiter ;//
+
+show procedure code proc_33618_h;
+show procedure code proc_33618_c;
+
+drop procedure proc_33618_h;
+drop procedure proc_33618_c;
--echo End of 5.0 tests.