mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/dlenev/src/mysql-5.0-bgmd sql/sql_yacc.yy: Auto merged
This commit is contained in:
@ -672,3 +672,17 @@ select default(t30.s1) from t30;
|
|||||||
end|
|
end|
|
||||||
drop procedure bug10969|
|
drop procedure bug10969|
|
||||||
drop table t1|
|
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;
|
||||||
|
@ -965,3 +965,24 @@ drop procedure bug10969|
|
|||||||
drop table t1|
|
drop table t1|
|
||||||
|
|
||||||
delimiter ;|
|
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;
|
||||||
|
|
||||||
|
@ -919,6 +919,11 @@ deallocate:
|
|||||||
yyerror(ER(ER_SYNTAX_ERROR));
|
yyerror(ER(ER_SYNTAX_ERROR));
|
||||||
YYABORT;
|
YYABORT;
|
||||||
}
|
}
|
||||||
|
if (lex->sphead)
|
||||||
|
{
|
||||||
|
my_error(ER_SP_BADSTATEMENT, MYF(0), "DEALLOCATE");
|
||||||
|
YYABORT;
|
||||||
|
}
|
||||||
lex->sql_command= SQLCOM_DEALLOCATE_PREPARE;
|
lex->sql_command= SQLCOM_DEALLOCATE_PREPARE;
|
||||||
lex->prepared_stmt_name= $3;
|
lex->prepared_stmt_name= $3;
|
||||||
};
|
};
|
||||||
@ -939,6 +944,11 @@ prepare:
|
|||||||
yyerror(ER(ER_SYNTAX_ERROR));
|
yyerror(ER(ER_SYNTAX_ERROR));
|
||||||
YYABORT;
|
YYABORT;
|
||||||
}
|
}
|
||||||
|
if (lex->sphead)
|
||||||
|
{
|
||||||
|
my_error(ER_SP_BADSTATEMENT, MYF(0), "PREPARE");
|
||||||
|
YYABORT;
|
||||||
|
}
|
||||||
lex->sql_command= SQLCOM_PREPARE;
|
lex->sql_command= SQLCOM_PREPARE;
|
||||||
lex->prepared_stmt_name= $2;
|
lex->prepared_stmt_name= $2;
|
||||||
};
|
};
|
||||||
@ -969,6 +979,11 @@ execute:
|
|||||||
yyerror(ER(ER_SYNTAX_ERROR));
|
yyerror(ER(ER_SYNTAX_ERROR));
|
||||||
YYABORT;
|
YYABORT;
|
||||||
}
|
}
|
||||||
|
if (lex->sphead)
|
||||||
|
{
|
||||||
|
my_error(ER_SP_BADSTATEMENT, MYF(0), "EXECUTE");
|
||||||
|
YYABORT;
|
||||||
|
}
|
||||||
lex->sql_command= SQLCOM_EXECUTE;
|
lex->sql_command= SQLCOM_EXECUTE;
|
||||||
lex->prepared_stmt_name= $2;
|
lex->prepared_stmt_name= $2;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user