diff options
Diffstat (limited to 'mysql-test/t/sp-error.test')
-rw-r--r-- | mysql-test/t/sp-error.test | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index fa74c318db3..e2343cd905c 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -1212,7 +1212,132 @@ call bug9367(); drop procedure bug9367; drop table t1; --enable_parsing + +# +# BUG#13510: Setting password local variable changes current password +# +delimiter |; +--disable_warnings +drop procedure if exists bug13510_1| +drop procedure if exists bug13510_2| +drop procedure if exists bug13510_3| +drop procedure if exists bug13510_4| +--enable_warnings + +--error ER_SP_BAD_VAR_SHADOW +create procedure bug13510_1() +begin + declare password varchar(10); + + set password = 'foo1'; + select password; +end| + +--error ER_SP_BAD_VAR_SHADOW +create procedure bug13510_2() +begin + declare names varchar(10); + + set names = 'foo2'; + select names; +end| + +create procedure bug13510_3() +begin + declare password varchar(10); + + set `password` = 'foo3'; + select password; +end| + +create procedure bug13510_4() +begin + declare names varchar(10); + + set `names` = 'foo4'; + select names; +end| + +call bug13510_3()| +call bug13510_4()| + +drop procedure bug13510_3| +drop procedure bug13510_4| +delimiter ;| + # +# Bug#13514 "server crash when create a stored procedure before choose a +# database" and +# Bug#13587 "Server crash when SP is created without database +# selected" +# +create database mysqltest1; +use mysqltest1; +drop database mysqltest1; +--error ER_NO_DB_ERROR +create function f1() returns int return 1; +delimiter |; +--error ER_NO_DB_ERROR +create procedure p1(out param1 int) +begin + select count(*) into param1 from t3; +end| +delimiter ;| +use test; + + +# +# BUG#13037: undefined variable in IF cause erroneous error-message +# + +--disable_warnings +DROP PROCEDURE IF EXISTS bug13037_p1; +DROP PROCEDURE IF EXISTS bug13037_p2; +DROP PROCEDURE IF EXISTS bug13037_p3; +--enable_warnings + +delimiter |; + +CREATE PROCEDURE bug13037_p1() +BEGIN + IF bug13037_foo THEN + SELECT 1; + END IF; +END| + +CREATE PROCEDURE bug13037_p2() +BEGIN + SET @bug13037_foo = bug13037_bar; +END| + +CREATE PROCEDURE bug13037_p3() +BEGIN + SELECT bug13037_foo; +END| + +delimiter ;| + +--echo + +--error 1054 +CALL bug13037_p1(); +--error 1054 +CALL bug13037_p2(); +--error 1054 +CALL bug13037_p3(); + +--error 1054 +CALL bug13037_p1(); +--error 1054 +CALL bug13037_p2(); +--error 1054 +CALL bug13037_p3(); + +DROP PROCEDURE bug13037_p1; +DROP PROCEDURE bug13037_p2; +DROP PROCEDURE bug13037_p3; + + # BUG#NNNN: New bug synopsis # #--disable_warnings |