summaryrefslogtreecommitdiff
path: root/mysql-test/t/sp-error.test
diff options
context:
space:
mode:
authorunknown <pem@mysql.comhem.se>2003-11-13 19:34:56 +0100
committerunknown <pem@mysql.comhem.se>2003-11-13 19:34:56 +0100
commitc9232c60e2ec287932158b6d820352dd98e85fd7 (patch)
treedf91989d7134f7e1e4a3a6c110312d910b30c970 /mysql-test/t/sp-error.test
parent4696bb41b4cce563ffff8d7b6c32576214109113 (diff)
downloadmariadb-git-c9232c60e2ec287932158b6d820352dd98e85fd7.tar.gz
Various bug fixes:
- Duplicate parameters/variables, conditions and cursors (not allowed). - ITERATE in labelled BEGIN-END (not allowed). - Missing SQLSTATE [VALUE] keywords in CONDITION/HANDLER declaration (added). - Empty BEGIN-END (now allowed). - End label (now optional). include/mysqld_error.h: New error code for duplicate things (vars et al) in SPs. mysql-test/r/sp-error.result: New error tests for ITERATE in begin-end block and duplicate variables, conditions and cursors. mysql-test/r/sp.result: New tests for empty begin-end blocks, overriding local variables outside scope only, leave a begin-end block, and SQLSTATE [VALUE] words for CONDITION/HANDLER declarations. mysql-test/t/sp-error.test: New error tests for ITERATE in begin-end block and duplicate variables, conditions and cursors. mysql-test/t/sp.test: New tests for empty begin-end blocks, overriding local variables outside scope only, leave a begin-end block, and SQLSTATE [VALUE] words for CONDITION/HANDLER declarations. sql/lex.h: New SQLSTATE keyword. sql/share/czech/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/danish/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/dutch/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/english/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/estonian/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/french/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/german/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/greek/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/hungarian/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/italian/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/japanese/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/korean/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/norwegian-ny/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/norwegian/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/polish/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/portuguese/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/romanian/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/russian/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/serbian/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/slovak/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/spanish/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/swedish/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/share/ukrainian/errmsg.txt: New error message for duplicate things (vars et al) in SPs. sql/sp_pcontext.cc: Keep track on scope limits for error checking of duplicate variables, conditions and cursors. sql/sp_pcontext.h: Keep track on scope limits for error checking of duplicate variables, conditions and cursors. Also need to flag BEGIN labels to check for illegal ITERATEs. sql/sql_yacc.yy: End-labels in SPs loop and begin-end blocks are now optional. SQLSTATE [VALUE] added to syntax for sqlstates. Check for duplicate variable, condition and cursor declarations, but only in the same scope. Empty BEGIN-END statements now allowed. Check if ITERATE is referring to a BEGIN label.
Diffstat (limited to 'mysql-test/t/sp-error.test')
-rw-r--r--mysql-test/t/sp-error.test32
1 files changed, 32 insertions, 0 deletions
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index 7c541029452..09a1e196786 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -74,6 +74,11 @@ create procedure foo()
foo: loop
iterate bar;
end loop|
+--error 1285
+create procedure foo()
+foo: begin
+ iterate foo;
+end|
# Redefining label
--error 1286
@@ -298,6 +303,33 @@ end|
call p()|
drop procedure p|
+--error 1307
+create procedure p(in x int, x char(10))
+begin
+end|
+--error 1307
+create function p(x int, x char(10))
+begin
+end|
+--error 1307
+create procedure p()
+begin
+ declare x float;
+ declare x int;
+end|
+--error 1307
+create procedure p()
+begin
+ declare c condition for 1064;
+ declare c condition for 1065;
+end|
+--error 1307
+create procedure p()
+begin
+ declare c cursor for select * from t1;
+ declare c cursor for select field from t1;
+end|
+
drop table t1|
delimiter ;|