Loading mysql-test/r/sp-error.result +14 −0 Original line number Diff line number Diff line Loading @@ -672,3 +672,17 @@ select default(t30.s1) from t30; end| drop procedure bug10969| drop table t1| prepare stmt from "select 1"; create procedure p() deallocate prepare stmt; ERROR 0A000: DEALLOCATE is not allowed in stored procedures create function f() returns int begin deallocate prepare stmt; ERROR 0A000: DEALLOCATE is not allowed in stored procedures create procedure p() prepare stmt from "select 1"; ERROR 0A000: PREPARE is not allowed in stored procedures create function f() returns int begin prepare stmt from "select 1"; ERROR 0A000: PREPARE is not allowed in stored procedures create procedure p() execute stmt; ERROR 0A000: EXECUTE is not allowed in stored procedures create function f() returns int begin execute stmt; ERROR 0A000: EXECUTE is not allowed in stored procedures deallocate prepare stmt; mysql-test/t/sp-error.test +21 −0 Original line number Diff line number Diff line Loading @@ -965,3 +965,24 @@ drop procedure bug10969| drop table t1| delimiter ;| # # Bug#10975, #10605, #7115: Dynamic SQL by means of # PREPARE/EXECUTE/DEALLOCATE is not supported yet. # Check that an error message is returned. # prepare stmt from "select 1"; --error ER_SP_BADSTATEMENT create procedure p() deallocate prepare stmt; --error ER_SP_BADSTATEMENT create function f() returns int begin deallocate prepare stmt; --error ER_SP_BADSTATEMENT create procedure p() prepare stmt from "select 1"; --error ER_SP_BADSTATEMENT create function f() returns int begin prepare stmt from "select 1"; --error ER_SP_BADSTATEMENT create procedure p() execute stmt; --error ER_SP_BADSTATEMENT create function f() returns int begin execute stmt; deallocate prepare stmt; sql/sql_yacc.yy +15 −0 Original line number Diff line number Diff line Loading @@ -919,6 +919,11 @@ deallocate: yyerror(ER(ER_SYNTAX_ERROR)); YYABORT; } if (lex->sphead) { my_error(ER_SP_BADSTATEMENT, MYF(0), "DEALLOCATE"); YYABORT; } lex->sql_command= SQLCOM_DEALLOCATE_PREPARE; lex->prepared_stmt_name= $3; }; Loading @@ -939,6 +944,11 @@ prepare: yyerror(ER(ER_SYNTAX_ERROR)); YYABORT; } if (lex->sphead) { my_error(ER_SP_BADSTATEMENT, MYF(0), "PREPARE"); YYABORT; } lex->sql_command= SQLCOM_PREPARE; lex->prepared_stmt_name= $2; }; Loading Loading @@ -969,6 +979,11 @@ execute: yyerror(ER(ER_SYNTAX_ERROR)); YYABORT; } if (lex->sphead) { my_error(ER_SP_BADSTATEMENT, MYF(0), "EXECUTE"); YYABORT; } lex->sql_command= SQLCOM_EXECUTE; lex->prepared_stmt_name= $2; } Loading Loading
mysql-test/r/sp-error.result +14 −0 Original line number Diff line number Diff line Loading @@ -672,3 +672,17 @@ select default(t30.s1) from t30; end| drop procedure bug10969| drop table t1| prepare stmt from "select 1"; create procedure p() deallocate prepare stmt; ERROR 0A000: DEALLOCATE is not allowed in stored procedures create function f() returns int begin deallocate prepare stmt; ERROR 0A000: DEALLOCATE is not allowed in stored procedures create procedure p() prepare stmt from "select 1"; ERROR 0A000: PREPARE is not allowed in stored procedures create function f() returns int begin prepare stmt from "select 1"; ERROR 0A000: PREPARE is not allowed in stored procedures create procedure p() execute stmt; ERROR 0A000: EXECUTE is not allowed in stored procedures create function f() returns int begin execute stmt; ERROR 0A000: EXECUTE is not allowed in stored procedures deallocate prepare stmt;
mysql-test/t/sp-error.test +21 −0 Original line number Diff line number Diff line Loading @@ -965,3 +965,24 @@ drop procedure bug10969| drop table t1| delimiter ;| # # Bug#10975, #10605, #7115: Dynamic SQL by means of # PREPARE/EXECUTE/DEALLOCATE is not supported yet. # Check that an error message is returned. # prepare stmt from "select 1"; --error ER_SP_BADSTATEMENT create procedure p() deallocate prepare stmt; --error ER_SP_BADSTATEMENT create function f() returns int begin deallocate prepare stmt; --error ER_SP_BADSTATEMENT create procedure p() prepare stmt from "select 1"; --error ER_SP_BADSTATEMENT create function f() returns int begin prepare stmt from "select 1"; --error ER_SP_BADSTATEMENT create procedure p() execute stmt; --error ER_SP_BADSTATEMENT create function f() returns int begin execute stmt; deallocate prepare stmt;
sql/sql_yacc.yy +15 −0 Original line number Diff line number Diff line Loading @@ -919,6 +919,11 @@ deallocate: yyerror(ER(ER_SYNTAX_ERROR)); YYABORT; } if (lex->sphead) { my_error(ER_SP_BADSTATEMENT, MYF(0), "DEALLOCATE"); YYABORT; } lex->sql_command= SQLCOM_DEALLOCATE_PREPARE; lex->prepared_stmt_name= $3; }; Loading @@ -939,6 +944,11 @@ prepare: yyerror(ER(ER_SYNTAX_ERROR)); YYABORT; } if (lex->sphead) { my_error(ER_SP_BADSTATEMENT, MYF(0), "PREPARE"); YYABORT; } lex->sql_command= SQLCOM_PREPARE; lex->prepared_stmt_name= $2; }; Loading Loading @@ -969,6 +979,11 @@ execute: yyerror(ER(ER_SYNTAX_ERROR)); YYABORT; } if (lex->sphead) { my_error(ER_SP_BADSTATEMENT, MYF(0), "EXECUTE"); YYABORT; } lex->sql_command= SQLCOM_EXECUTE; lex->prepared_stmt_name= $2; } Loading