Commit 4c49970e authored by pem@mysql.comhem.se's avatar pem@mysql.comhem.se

Fixed BUG#8409: Stored procedure crash if function contains FLUSH

  by simply disabling FLUSH for stored functions. (I can't really work.)
parent fcb3b032
...@@ -646,4 +646,12 @@ drop procedure if exists bug10537| ...@@ -646,4 +646,12 @@ drop procedure if exists bug10537|
create procedure bug10537() create procedure bug10537()
load data local infile '/tmp/somefile' into table t1| load data local infile '/tmp/somefile' into table t1|
ERROR 0A000: LOAD DATA is not allowed in stored procedures ERROR 0A000: LOAD DATA is not allowed in stored procedures
drop function if exists bug8409|
create function bug8409()
returns int
begin
flush tables;
return 5;
end|
ERROR 0A000: FLUSH is not allowed in stored procedures
drop table t1| drop table t1|
...@@ -905,6 +905,21 @@ create procedure bug10537() ...@@ -905,6 +905,21 @@ create procedure bug10537()
load data local infile '/tmp/somefile' into table t1| load data local infile '/tmp/somefile' into table t1|
#
# BUG#8409: Stored procedure crash if function contains FLUSH
#
--disable_warnings
drop function if exists bug8409|
--enable_warnings
--error ER_SP_BADSTATEMENT
create function bug8409()
returns int
begin
flush tables;
return 5;
end|
# #
# BUG#NNNN: New bug synopsis # BUG#NNNN: New bug synopsis
# #
......
...@@ -6511,6 +6511,11 @@ flush: ...@@ -6511,6 +6511,11 @@ flush:
FLUSH_SYM opt_no_write_to_binlog FLUSH_SYM opt_no_write_to_binlog
{ {
LEX *lex=Lex; LEX *lex=Lex;
if (lex->sphead && lex->sphead->m_type == TYPE_ENUM_FUNCTION)
{
my_error(ER_SP_BADSTATEMENT, MYF(0), "FLUSH");
YYABORT;
}
lex->sql_command= SQLCOM_FLUSH; lex->type=0; lex->sql_command= SQLCOM_FLUSH; lex->type=0;
lex->no_write_to_binlog= $2; lex->no_write_to_binlog= $2;
} }
......
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