Bug #8409 Stored procedure crash if function contains FLUSH
Submitted: 9 Feb 2005 22:17 Modified: 1 Jun 2005 3:31
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.3-alpha-debug OS:Linux (SUSE 9.2)
Assigned to: Bugs System CPU Architecture:Any

[9 Feb 2005 22:17] Peter Gulutzan
Description:
If a function contains FLUSH, a statement which uses the function crashes.
(This depends on a new 'feature' to allow table references in functions.)

How to repeat:
mysql> create table t27 (s1 int)//
Query OK, 0 rows affected (0.01 sec)

mysql> create function f27 () returns int begin flush tables; return 5; end;//
Query OK, 0 rows affected (0.00 sec)

mysql> insert into t27 values (f27())//
ERROR 2013 (HY000): Lost connection to MySQL server during query
[9 Feb 2005 22:21] Miguel Solorzano
Thank you for the bug report. I was able to repeat.
[27 May 2005 18:30] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/25314
[31 May 2005 11:00] Per-Erik Martin
FLUSH is now disallowed in functions.
[1 Jun 2005 3:31] Paul Dubois
Noted in 5.0.7 changelog.