summaryrefslogtreecommitdiff
path: root/mysql-test/r/sp.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/sp.result')
-rw-r--r--mysql-test/r/sp.result37
1 files changed, 34 insertions, 3 deletions
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index c5cd1c6a1b9..4f66dafbe81 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -36,6 +36,20 @@ select * from t1;
id data
bar 666
delete from t1;
+create procedure empty()
+begin
+end;
+call empty();
+drop procedure empty;
+create procedure scope(a int, b float)
+begin
+declare b int;
+declare c float;
+begin
+declare c int;
+end;
+end;
+drop procedure scope;
create procedure two(x1 char(16), x2 char(16), y int)
begin
insert into test.t1 values (x1, y);
@@ -256,7 +270,7 @@ insert into test.t1 values ("d", x);
set x = x-1;
leave hmm;
insert into test.t1 values ("x", x);
-end while hmm;
+end while;
call d(3);
select * from t1;
id data
@@ -335,6 +349,21 @@ h1 1
h? 17
delete from t1;
drop procedure h;
+create procedure i(x int)
+foo:
+begin
+if x = 0 then
+leave foo;
+end if;
+insert into test.t1 values ("i", x);
+end foo;
+call i(0);
+call i(3);
+select * from t1;
+id data
+i 3
+delete from t1;
+drop procedure i;
create procedure into_test(x char(16), y int)
begin
insert into test.t1 values (x, y);
@@ -461,6 +490,8 @@ create procedure hndlr1(val int)
begin
declare x int default 0;
declare foo condition for 1146;
+declare bar condition for sqlstate '42S98'; # Just for testing syntax
+declare zip condition for sqlstate value '42S99'; # Just for testing syntax
declare continue handler for foo set x = 1;
insert into test.t666 values ("hndlr1", val); # Non-existing table
if (x) then
@@ -477,7 +508,7 @@ create procedure hndlr2(val int)
begin
declare x int default 0;
begin
-declare exit handler for '42S02' set x = 1;
+declare exit handler for sqlstate '42S02' set x = 1;
insert into test.t666 values ("hndlr2", val); # Non-existing table
end;
insert into test.t1 values ("hndlr2", x);
@@ -744,7 +775,7 @@ end if;
set s = s+1;
end;
end if;
-end loop again;
+end loop;
end;
create procedure ip(m int unsigned)
begin