summaryrefslogtreecommitdiff
path: root/mysql-test/t/sp.test
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-06-06 17:51:28 +0200
committerSergei Golubchik <sergii@pisem.net>2013-06-06 17:51:28 +0200
commit4749d40c635634e25e07d28ce1a04e9263bcc375 (patch)
treec5bb3287675cd8676d76c8ee42ef2d79cc599e25 /mysql-test/t/sp.test
parent1ff1cb10fc236010b5969058cab934c2b306c931 (diff)
parent33ef993773449cb3917665b188f6b6575d399bd0 (diff)
downloadmariadb-git-4749d40c635634e25e07d28ce1a04e9263bcc375.tar.gz
5.5 merge
Diffstat (limited to 'mysql-test/t/sp.test')
-rw-r--r--mysql-test/t/sp.test63
1 files changed, 62 insertions, 1 deletions
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 9db6709a8d2..0fb3474f877 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -9209,5 +9209,66 @@ DROP FUNCTION f2;
DROP FUNCTION f3;
DROP FUNCTION f4;
---echo # End of 5.5 test
+--echo
+--echo Stored procedures and a condition handler in a nested procedure call
+--echo doesn't suppress the condition from being passed on to the calling
+--echo procedure
+--echo
+
+--disable_warnings
+drop procedure if exists p1;
+drop procedure if exists p0;
+--enable_warnings
+
+create table t1 (id int);
+delimiter $$;
+create procedure p1 () begin
+declare i int default 0;
+declare continue handler for not found begin
+select "You should see this message and the warning that generated this" as "message";
+show warnings;
+end;
+select id into i from t1;
+end$$
+create procedure p0 () begin
+declare continue handler for not found begin
+select "You should NOT see this message" as "message";
+end;
+call p1();
+end$$
+delimiter ;$$
+call p0();
+drop procedure p1;
+drop procedure p0;
+drop table t1;
+
+--echo
+--echo Test if stored procedures propagates errors
+--echo
+
+create table t1 (id int primary key);
+delimiter $$;
+create procedure p1 () begin
+insert into t1 values(1);
+insert into t1 values(2);
+insert into t1 values(2);
+insert into t1 values(3);
+end$$
+create procedure p2 () begin
+ declare x int;
+ select id into x from t1 where id=5;
+end$$
+delimiter ;$$
+--error ER_DUP_ENTRY
+call p1();
+show warnings;
+select * from t1;
+call p2();
+
+drop procedure p1;
+drop procedure p2;
+
+drop table t1;
+
+--echo # End of 5.5 test