diff --git a/include/mysqld_error.h b/include/mysqld_error.h index a339f44b258..e540b8371d8 100644 --- a/include/mysqld_error.h +++ b/include/mysqld_error.h @@ -270,4 +270,11 @@ #define ER_SP_ALREADY_EXISTS 1251 #define ER_SP_DOES_NOT_EXIST 1252 #define ER_SP_DROP_FAILED 1253 -#define ER_ERROR_MESSAGES 254 +#define ER_SP_STORE_FAILED 1254 +#define ER_SP_LEAVE_MISMATCH 1255 +#define ER_SP_ITERATE_MISMATCH 1256 +#define ER_SP_LABEL_REDEFINE 1257 +#define ER_SP_LABEL_MISMATCH 1258 +#define ER_SP_UNINIT_VAR 1259 +#define ER_ERROR_MESSAGES 260 + diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt index d56f043b78f..79dae19dbc8 100644 --- a/sql/share/czech/errmsg.txt +++ b/sql/share/czech/errmsg.txt @@ -264,3 +264,9 @@ v/* "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt index 9eea7e96e90..a77c2b59622 100644 --- a/sql/share/danish/errmsg.txt +++ b/sql/share/danish/errmsg.txt @@ -258,3 +258,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt index 8ae5806594a..5f78ba6c21d 100644 --- a/sql/share/dutch/errmsg.txt +++ b/sql/share/dutch/errmsg.txt @@ -266,3 +266,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt index 76acfc558ff..9fe52f075dc 100644 --- a/sql/share/english/errmsg.txt +++ b/sql/share/english/errmsg.txt @@ -255,4 +255,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" -"Failed to store PROCEDURE" +"Failed to CREATE PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt index 5caa6e8206c..8202d782408 100644 --- a/sql/share/estonian/errmsg.txt +++ b/sql/share/estonian/errmsg.txt @@ -260,3 +260,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt index eb5c147b35a..799cb76d8c0 100644 --- a/sql/share/french/errmsg.txt +++ b/sql/share/french/errmsg.txt @@ -255,3 +255,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt index a13e2988335..d6c9a2fb8ed 100644 --- a/sql/share/german/errmsg.txt +++ b/sql/share/german/errmsg.txt @@ -265,3 +265,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt index c71559ba363..c78d410df83 100644 --- a/sql/share/greek/errmsg.txt +++ b/sql/share/greek/errmsg.txt @@ -255,3 +255,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt index 0a570ea4879..b42c4a87c4f 100644 --- a/sql/share/hungarian/errmsg.txt +++ b/sql/share/hungarian/errmsg.txt @@ -257,3 +257,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt index 9a1f7bd5e7f..937f2d41379 100644 --- a/sql/share/italian/errmsg.txt +++ b/sql/share/italian/errmsg.txt @@ -255,3 +255,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt index d110d9a766a..136e4c77fb6 100644 --- a/sql/share/japanese/errmsg.txt +++ b/sql/share/japanese/errmsg.txt @@ -257,3 +257,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt index 896f359a30a..08c496984a8 100644 --- a/sql/share/korean/errmsg.txt +++ b/sql/share/korean/errmsg.txt @@ -255,3 +255,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt index d2f6c4816c2..7c7387da2fe 100644 --- a/sql/share/norwegian-ny/errmsg.txt +++ b/sql/share/norwegian-ny/errmsg.txt @@ -257,3 +257,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt index 7132e49b00b..fc42860af0d 100644 --- a/sql/share/norwegian/errmsg.txt +++ b/sql/share/norwegian/errmsg.txt @@ -257,3 +257,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt index f7657e67dfa..f907222ea28 100644 --- a/sql/share/polish/errmsg.txt +++ b/sql/share/polish/errmsg.txt @@ -259,3 +259,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt index 8b7d9c76d14..a26d6dae971 100644 --- a/sql/share/portuguese/errmsg.txt +++ b/sql/share/portuguese/errmsg.txt @@ -255,3 +255,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt index 4bd79d1b905..e2ac7eade01 100644 --- a/sql/share/romanian/errmsg.txt +++ b/sql/share/romanian/errmsg.txt @@ -259,3 +259,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt index dd941428dfc..8d350e62f00 100644 --- a/sql/share/russian/errmsg.txt +++ b/sql/share/russian/errmsg.txt @@ -258,3 +258,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/serbian/errmsg.txt b/sql/share/serbian/errmsg.txt index 8739f7bfa34..e12c2953805 100644 --- a/sql/share/serbian/errmsg.txt +++ b/sql/share/serbian/errmsg.txt @@ -251,3 +251,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt index 212ea72c727..391b531cfdb 100644 --- a/sql/share/slovak/errmsg.txt +++ b/sql/share/slovak/errmsg.txt @@ -263,3 +263,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt index 87934beb754..528c89893cc 100644 --- a/sql/share/spanish/errmsg.txt +++ b/sql/share/spanish/errmsg.txt @@ -256,3 +256,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt index c4964688102..e8f1d4eec0f 100644 --- a/sql/share/swedish/errmsg.txt +++ b/sql/share/swedish/errmsg.txt @@ -255,3 +255,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt index 0d8f89ac431..965da3cd29d 100644 --- a/sql/share/ukrainian/errmsg.txt +++ b/sql/share/ukrainian/errmsg.txt @@ -260,3 +260,9 @@ "PROCEDURE already exists" "PROCEDURE does not exist" "Failed to DROP PROCEDURE" +"Failed to store PROCEDURE" +"LEAVE with no matching label" +"ITERATE with no matching label" +"Redefining label" +"End-label without match" +"Referring to uninitialized variable" diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 4f05d1c475b..2cc2f674d4a 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1097,7 +1097,7 @@ sp_proc_stmt: if (! lab) { - printf("QQ LEAVE with no matching label\n"); + send_error(YYTHD, ER_SP_LEAVE_MISMATCH); YYABORT; } else @@ -1115,7 +1115,7 @@ sp_proc_stmt: if (! lab) { - printf("QQ ITERATE with no matching label\n"); + send_error(YYTHD, ER_SP_ITERATE_MISMATCH); YYABORT; } else @@ -1217,7 +1217,7 @@ sp_labeled_control: if (lab) { - printf("QQ Redefining label\n"); + send_error(YYTHD, ER_SP_LABEL_REDEFINE); YYABORT; } else @@ -1231,14 +1231,9 @@ sp_labeled_control: LEX *lex= Lex; sp_label_t *lab= lex->spcont->find_label($5.str); - if (! lab) + if (! lab || strcasecmp($5.str, lab->name) != 0) { - printf("QQ end-label without match\n"); - YYABORT; - } - else if (strcasecmp($5.str, lab->name) != 0) - { - printf("QQ mismatching labels\n"); + send_error(YYTHD, ER_SP_LABEL_MISMATCH); YYABORT; } else @@ -4158,8 +4153,8 @@ simple_ident: { /* We're compiling a stored procedure and found a variable */ if (lex->sql_command != SQLCOM_CALL && ! spv->isset) { - printf("QQ Referring to an unitialized variable\n"); - YYABORT; /* QQ Referring to an unitialized variable */ + send_error(YYTHD, ER_SP_UNINIT_VAR); + YYABORT; } else $$ = (Item*) new Item_splocal(spv->offset);