summaryrefslogtreecommitdiff
path: root/mysql-test/t/sp-error.test
diff options
context:
space:
mode:
authorunknown <pem@mysql.comhem.se>2004-04-05 17:01:19 +0200
committerunknown <pem@mysql.comhem.se>2004-04-05 17:01:19 +0200
commit4a7c72e9dfe2c1274d92bde9eec158c089f22dac (patch)
treecf7e76c8e635cc495116540f20458ac279c1cfd3 /mysql-test/t/sp-error.test
parentc489c6aba7b2d0d38fdf6ce8448676320282d171 (diff)
downloadmariadb-git-4a7c72e9dfe2c1274d92bde9eec158c089f22dac.tar.gz
Fixed BUG#3287: Stored procedure handler scope outside of begin/end.
Backpatching overwrote already backpatched instructions, which made it skip the hpop instruction; possibly not only a problem for handlers, but this is one known case when it happened. mysql-test/r/sp-error.result: New testcase for BUG#3287 mysql-test/t/sp-error.test: New testcase for BUG#3287 sql/sp_head.cc: Made the debug printout of hpush_jump instructions somewhat clearer. sql/sp_head.h: Don't backpatch the same instruction more than once.
Diffstat (limited to 'mysql-test/t/sp-error.test')
-rw-r--r--mysql-test/t/sp-error.test33
1 files changed, 32 insertions, 1 deletions
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index ad96d0b403b..03ab44b3e46 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -400,7 +400,7 @@ return (select sum(t.data) from test.t2 t)|
# BUG#1653
#
--disable_warnings
-drop table if exists table_1|
+drop table if exists t3|
--enable_warnings
create table t3 (column_1_0 int)|
@@ -500,6 +500,37 @@ end case|
call bug3287(2)|
drop procedure bug3287|
+
+#
+# BUG#3297
+#
+--disable_warnings
+drop table if exists t3|
+--enable_warnings
+create table t3 (s1 int, primary key (s1))|
+insert into t3 values (5),(6)|
+
+create procedure bug3279(out y int)
+begin
+ declare x int default 0;
+ begin
+ declare exit handler for sqlexception set x = x+1;
+ insert into t3 values (5);
+ end;
+ if x < 2 then
+ set x = x+1;
+ insert into t3 values (6);
+ end if;
+ set y = x;
+end|
+
+set @x = 0|
+--error 1062
+call bug3279(@x)|
+select @x|
+drop procedure bug3279|
+drop table t3|
+
drop table t1|
delimiter ;|