summaryrefslogtreecommitdiff
path: root/mysql-test/r/sp-error.result
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/r/sp-error.result
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/r/sp-error.result')
-rw-r--r--mysql-test/r/sp-error.result31
1 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index 4cd1c4c961c..2ece3e61d1d 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -47,6 +47,11 @@ iterate bar;
end loop;
ERROR HY000: ITERATE with no matching label: bar
create procedure foo()
+foo: begin
+iterate foo;
+end;
+ERROR HY000: ITERATE with no matching label: foo
+create procedure foo()
foo: loop
foo: loop
set @x=2;
@@ -219,4 +224,30 @@ end;
call p();
ERROR HY000: Wrong number of FETCH variables
drop procedure p;
+create procedure p(in x int, x char(10))
+begin
+end;
+ERROR HY000: Duplicate parameter: x
+create function p(x int, x char(10))
+begin
+end;
+ERROR HY000: Duplicate parameter: x
+create procedure p()
+begin
+declare x float;
+declare x int;
+end;
+ERROR HY000: Duplicate parameter: x
+create procedure p()
+begin
+declare c condition for 1064;
+declare c condition for 1065;
+end;
+ERROR HY000: Duplicate condition: c
+create procedure p()
+begin
+declare c cursor for select * from t1;
+declare c cursor for select field from t1;
+end;
+ERROR HY000: Duplicate cursor: c
drop table t1;