Commit b6e27f84 authored by unknown's avatar unknown

Changed single generic error code/message into different ones for duplicate things.

(For multi-lingual support.)
Also fixed memory leak when aborting parsing for a duplicate cursor.


include/mysqld_error.h:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
mysql-test/r/sp-error.result:
  Fixed error message for duplicate variable.
mysql-test/t/sp-error.test:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/czech/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/danish/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/dutch/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/english/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/estonian/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/french/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/german/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/greek/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/hungarian/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/italian/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/japanese/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/korean/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/norwegian-ny/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/norwegian/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/polish/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/portuguese/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/romanian/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/russian/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/serbian/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/slovak/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/spanish/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/swedish/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
sql/share/ukrainian/errmsg.txt:
  Changed single generic error code/message into different ones for duplicate things.
  (For multi-lingual support.)
parent ed71e4bd
...@@ -323,5 +323,8 @@ ...@@ -323,5 +323,8 @@
#define ER_SP_UNDECLARED_VAR 1304 #define ER_SP_UNDECLARED_VAR 1304
#define ER_SP_WRONG_NO_OF_FETCH_ARGS 1305 #define ER_SP_WRONG_NO_OF_FETCH_ARGS 1305
#define ER_SP_FETCH_NO_DATA 1306 #define ER_SP_FETCH_NO_DATA 1306
#define ER_SP_DUP_THING 1307 #define ER_SP_DUP_PARAM 1307
#define ER_ERROR_MESSAGES 308 #define ER_SP_DUP_VAR 1308
#define ER_SP_DUP_COND 1309
#define ER_SP_DUP_CURS 1310
#define ER_ERROR_MESSAGES 311
...@@ -237,7 +237,7 @@ begin ...@@ -237,7 +237,7 @@ begin
declare x float; declare x float;
declare x int; declare x int;
end; end;
ERROR HY000: Duplicate parameter: x ERROR HY000: Duplicate variable: x
create procedure p() create procedure p()
begin begin
declare c condition for 1064; declare c condition for 1064;
......
...@@ -311,19 +311,22 @@ end| ...@@ -311,19 +311,22 @@ end|
create function p(x int, x char(10)) create function p(x int, x char(10))
begin begin
end| end|
--error 1307
--error 1308
create procedure p() create procedure p()
begin begin
declare x float; declare x float;
declare x int; declare x int;
end| end|
--error 1307
--error 1309
create procedure p() create procedure p()
begin begin
declare c condition for 1064; declare c condition for 1064;
declare c condition for 1065; declare c condition for 1065;
end| end|
--error 1307
--error 1310
create procedure p() create procedure p()
begin begin
declare c cursor for select * from t1; declare c cursor for select * from t1;
......
...@@ -319,4 +319,7 @@ character-set=latin2 ...@@ -319,4 +319,7 @@ character-set=latin2
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -313,4 +313,7 @@ character-set=latin1 ...@@ -313,4 +313,7 @@ character-set=latin1
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -321,4 +321,7 @@ character-set=latin1 ...@@ -321,4 +321,7 @@ character-set=latin1
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -310,4 +310,7 @@ character-set=latin1 ...@@ -310,4 +310,7 @@ character-set=latin1
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -315,4 +315,7 @@ character-set=latin7 ...@@ -315,4 +315,7 @@ character-set=latin7
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -310,4 +310,7 @@ character-set=latin1 ...@@ -310,4 +310,7 @@ character-set=latin1
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -322,4 +322,7 @@ character-set=latin1 ...@@ -322,4 +322,7 @@ character-set=latin1
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -310,4 +310,7 @@ character-set=greek ...@@ -310,4 +310,7 @@ character-set=greek
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -312,4 +312,7 @@ character-set=latin2 ...@@ -312,4 +312,7 @@ character-set=latin2
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -310,4 +310,7 @@ character-set=latin1 ...@@ -310,4 +310,7 @@ character-set=latin1
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -312,4 +312,7 @@ character-set=ujis ...@@ -312,4 +312,7 @@ character-set=ujis
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -310,4 +310,7 @@ character-set=euckr ...@@ -310,4 +310,7 @@ character-set=euckr
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -312,4 +312,7 @@ character-set=latin1 ...@@ -312,4 +312,7 @@ character-set=latin1
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -312,4 +312,7 @@ character-set=latin1 ...@@ -312,4 +312,7 @@ character-set=latin1
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -314,4 +314,7 @@ character-set=latin2 ...@@ -314,4 +314,7 @@ character-set=latin2
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -311,4 +311,7 @@ character-set=latin1 ...@@ -311,4 +311,7 @@ character-set=latin1
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -314,4 +314,7 @@ character-set=latin2 ...@@ -314,4 +314,7 @@ character-set=latin2
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -312,4 +312,7 @@ character-set=koi8r ...@@ -312,4 +312,7 @@ character-set=koi8r
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -305,4 +305,7 @@ character-set=cp1250 ...@@ -305,4 +305,7 @@ character-set=cp1250
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -318,4 +318,7 @@ character-set=latin2 ...@@ -318,4 +318,7 @@ character-set=latin2
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -312,4 +312,7 @@ character-set=latin1 ...@@ -312,4 +312,7 @@ character-set=latin1
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -310,4 +310,7 @@ character-set=latin1 ...@@ -310,4 +310,7 @@ character-set=latin1
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -315,4 +315,7 @@ character-set=koi8u ...@@ -315,4 +315,7 @@ character-set=koi8u
"Undeclared variable: %s" "Undeclared variable: %s"
"Wrong number of FETCH variables" "Wrong number of FETCH variables"
"No data to FETCH" "No data to FETCH"
"Duplicate %s: %s" "Duplicate parameter: %s"
"Duplicate variable: %s"
"Duplicate condition: %s"
"Duplicate cursor: %s"
...@@ -1155,7 +1155,7 @@ sp_fdparam: ...@@ -1155,7 +1155,7 @@ sp_fdparam:
if (spc->find_pvar(&$1, TRUE)) if (spc->find_pvar(&$1, TRUE))
{ {
net_printf(YYTHD, ER_SP_DUP_THING, "parameter", $1.str); net_printf(YYTHD, ER_SP_DUP_PARAM, $1.str);
YYABORT; YYABORT;
} }
spc->push_pvar(&$1, (enum enum_field_types)$2, sp_param_in); spc->push_pvar(&$1, (enum enum_field_types)$2, sp_param_in);
...@@ -1181,7 +1181,7 @@ sp_pdparam: ...@@ -1181,7 +1181,7 @@ sp_pdparam:
if (spc->find_pvar(&$2, TRUE)) if (spc->find_pvar(&$2, TRUE))
{ {
net_printf(YYTHD, ER_SP_DUP_THING, "parameter", $2.str); net_printf(YYTHD, ER_SP_DUP_PARAM, $2.str);
YYABORT; YYABORT;
} }
spc->push_pvar(&$2, (enum enum_field_types)$3, spc->push_pvar(&$2, (enum enum_field_types)$3,
...@@ -1252,7 +1252,7 @@ sp_decl: ...@@ -1252,7 +1252,7 @@ sp_decl:
if (spc->find_cond(&$2, TRUE)) if (spc->find_cond(&$2, TRUE))
{ {
net_printf(YYTHD, ER_SP_DUP_THING, "condition", $2.str); net_printf(YYTHD, ER_SP_DUP_COND, $2.str);
YYABORT; YYABORT;
} }
YYTHD->lex->spcont->push_cond(&$2, $5); YYTHD->lex->spcont->push_cond(&$2, $5);
...@@ -1302,7 +1302,8 @@ sp_decl: ...@@ -1302,7 +1302,8 @@ sp_decl:
if (spc->find_cursor(&$2, &offp, TRUE)) if (spc->find_cursor(&$2, &offp, TRUE))
{ {
net_printf(YYTHD, ER_SP_DUP_THING, "cursor", $2.str); net_printf(YYTHD, ER_SP_DUP_CURS, $2.str);
delete $5;
YYABORT; YYABORT;
} }
i= new sp_instr_cpush(sp->instructions(), $5); i= new sp_instr_cpush(sp->instructions(), $5);
...@@ -1432,7 +1433,7 @@ sp_decl_idents: ...@@ -1432,7 +1433,7 @@ sp_decl_idents:
if (spc->find_pvar(&$1, TRUE)) if (spc->find_pvar(&$1, TRUE))
{ {
net_printf(YYTHD, ER_SP_DUP_THING, "parameter", $1.str); net_printf(YYTHD, ER_SP_DUP_VAR, $1.str);
YYABORT; YYABORT;
} }
spc->push_pvar(&$1, (enum_field_types)0, sp_param_in); spc->push_pvar(&$1, (enum_field_types)0, sp_param_in);
...@@ -1445,7 +1446,7 @@ sp_decl_idents: ...@@ -1445,7 +1446,7 @@ sp_decl_idents:
if (spc->find_pvar(&$3, TRUE)) if (spc->find_pvar(&$3, TRUE))
{ {
net_printf(YYTHD, ER_SP_DUP_THING, "parameter", $3.str); net_printf(YYTHD, ER_SP_DUP_VAR, $3.str);
YYABORT; YYABORT;
} }
spc->push_pvar(&$3, (enum_field_types)0, sp_param_in); spc->push_pvar(&$3, (enum_field_types)0, sp_param_in);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment