diff --git a/include/mysqld_error.h b/include/mysqld_error.h index baf35687bb6..e25424a8bb1 100644 --- a/include/mysqld_error.h +++ b/include/mysqld_error.h @@ -312,7 +312,7 @@ #define ER_SP_UNINIT_VAR 1292 #define ER_SP_BADSELECT 1293 #define ER_SP_BADRETURN 1294 -#define ER_SP_BADQUERY 1295 +#define ER_SP_BADSTATEMENT 1295 #define ER_UPDATE_LOG_DEPRECATED_IGNORED 1296 #define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1297 #define ER_QUERY_INTERRUPTED 1298 diff --git a/include/sql_state.h b/include/sql_state.h index 2bca08f33fd..363632bc167 100644 --- a/include/sql_state.h +++ b/include/sql_state.h @@ -171,9 +171,9 @@ ER_SP_LILABEL_MISMATCH, "42000", "", ER_SP_LABEL_REDEFINE, "42000", "", ER_SP_LABEL_MISMATCH, "42000", "", ER_SP_UNINIT_VAR, "01000", "", -ER_SP_BADSELECT, "04000", "", +ER_SP_BADSELECT, "0A000", "", ER_SP_BADRETURN, "42000", "", -ER_SP_BADQUERY, "04000", "", +ER_SP_BADSTATEMENT, "0A000", "", ER_UPDATE_LOG_DEPRECATED_IGNORED, "42000", "", ER_UPDATE_LOG_DEPRECATED_TRANSLATED, "42000", "", ER_QUERY_INTERRUPTED, "70100", "", diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 738067898c9..a2f7d5def27 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -79,7 +79,7 @@ select name from mysql.proc; select type from mysql.proc; end; call foo(); -ERROR 04000: SELECT in a stored procedure must have INTO +ERROR 0A000: SELECT in a stored procedure must have INTO drop procedure foo; create procedure foo() return 42; @@ -90,7 +90,7 @@ declare x int; select max(c) into x from test.t; return x; end; -ERROR 04000: Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION +ERROR 0A000: Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION create procedure p(x int) insert into test.t1 values (x); create function f(x int) returns int diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt index 7a13dfca46e..4dba54823ec 100644 --- a/sql/share/czech/errmsg.txt +++ b/sql/share/czech/errmsg.txt @@ -307,7 +307,7 @@ character-set=latin2 "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt index c5a4092f14b..07cbc84be14 100644 --- a/sql/share/danish/errmsg.txt +++ b/sql/share/danish/errmsg.txt @@ -301,7 +301,7 @@ character-set=latin1 "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt index 68d0ee50f06..8731c94fcdd 100644 --- a/sql/share/dutch/errmsg.txt +++ b/sql/share/dutch/errmsg.txt @@ -309,7 +309,7 @@ character-set=latin1 "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt index 655428e97f2..9f93925a1ac 100644 --- a/sql/share/english/errmsg.txt +++ b/sql/share/english/errmsg.txt @@ -298,7 +298,7 @@ character-set=latin1 "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt index aeb398eb6b0..0365cb776fb 100644 --- a/sql/share/estonian/errmsg.txt +++ b/sql/share/estonian/errmsg.txt @@ -303,7 +303,7 @@ character-set=latin7 "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt index bad1f3ccafb..7a8ff9d3c8c 100644 --- a/sql/share/french/errmsg.txt +++ b/sql/share/french/errmsg.txt @@ -298,7 +298,7 @@ character-set=latin1 "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt index 10fcdda16e3..e465cb3f899 100644 --- a/sql/share/german/errmsg.txt +++ b/sql/share/german/errmsg.txt @@ -310,7 +310,7 @@ character-set=latin1 "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt index 1a22f72c8c4..6bbcae1bca0 100644 --- a/sql/share/greek/errmsg.txt +++ b/sql/share/greek/errmsg.txt @@ -298,7 +298,7 @@ character-set=greek "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt index a1c84108cc5..73203da9826 100644 --- a/sql/share/hungarian/errmsg.txt +++ b/sql/share/hungarian/errmsg.txt @@ -300,7 +300,7 @@ character-set=latin2 "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt index 47af6ec3639..a99e381521e 100644 --- a/sql/share/italian/errmsg.txt +++ b/sql/share/italian/errmsg.txt @@ -298,7 +298,7 @@ character-set=latin1 "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt index ce798eeceff..fb85ae593d3 100644 --- a/sql/share/japanese/errmsg.txt +++ b/sql/share/japanese/errmsg.txt @@ -300,7 +300,7 @@ character-set=ujis "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt index d9a7c1d90cc..50415a9b051 100644 --- a/sql/share/korean/errmsg.txt +++ b/sql/share/korean/errmsg.txt @@ -298,7 +298,7 @@ character-set=euckr "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt index cf885ff266d..9409c82e06e 100644 --- a/sql/share/norwegian-ny/errmsg.txt +++ b/sql/share/norwegian-ny/errmsg.txt @@ -300,7 +300,7 @@ character-set=latin1 "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt index 26f9c31e274..f14abb40111 100644 --- a/sql/share/norwegian/errmsg.txt +++ b/sql/share/norwegian/errmsg.txt @@ -300,7 +300,7 @@ character-set=latin1 "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt index 4487f5f7cbd..dcf2369f727 100644 --- a/sql/share/polish/errmsg.txt +++ b/sql/share/polish/errmsg.txt @@ -302,7 +302,7 @@ character-set=latin2 "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt index ac7064ff337..ea002431020 100644 --- a/sql/share/portuguese/errmsg.txt +++ b/sql/share/portuguese/errmsg.txt @@ -299,7 +299,7 @@ character-set=latin1 "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt index 47d9cfc4f05..8f279b86731 100644 --- a/sql/share/romanian/errmsg.txt +++ b/sql/share/romanian/errmsg.txt @@ -302,7 +302,7 @@ character-set=latin2 "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt index ef1b4f1923e..b4e33c2e26e 100644 --- a/sql/share/russian/errmsg.txt +++ b/sql/share/russian/errmsg.txt @@ -300,7 +300,7 @@ character-set=koi8r "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/serbian/errmsg.txt b/sql/share/serbian/errmsg.txt index 12728e8985e..074714047de 100644 --- a/sql/share/serbian/errmsg.txt +++ b/sql/share/serbian/errmsg.txt @@ -293,7 +293,7 @@ character-set=cp1250 "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt index bc700c4e972..39aca7893a9 100644 --- a/sql/share/slovak/errmsg.txt +++ b/sql/share/slovak/errmsg.txt @@ -306,7 +306,7 @@ character-set=latin2 "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt index c7cd21baa4e..465fc98d60f 100644 --- a/sql/share/spanish/errmsg.txt +++ b/sql/share/spanish/errmsg.txt @@ -300,7 +300,7 @@ character-set=latin1 "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt index 785809f482d..a1e06d2bde7 100644 --- a/sql/share/swedish/errmsg.txt +++ b/sql/share/swedish/errmsg.txt @@ -298,7 +298,7 @@ character-set=latin1 "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt index 884b084c0a3..ddf632e0dbd 100644 --- a/sql/share/ukrainian/errmsg.txt +++ b/sql/share/ukrainian/errmsg.txt @@ -303,7 +303,7 @@ character-set=koi8u "Referring to uninitialized variable %s" "SELECT in a stored procedure must have INTO" "RETURN is only allowed in a FUNCTION" -"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" +"Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION" "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored." "The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN." "Query execution was interrupted" diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index b83f1488fb1..2d25301fc0b 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1523,7 +1523,7 @@ sp_proc_stmt: if (lex->sphead->m_type == TYPE_ENUM_FUNCTION && lex->sql_command != SQLCOM_SET_OPTION) { - send_error(YYTHD, ER_SP_BADQUERY); + send_error(YYTHD, ER_SP_BADSTATEMENT); YYABORT; } else