Bug #9775 Stored procedures: crash if create function that returns enum or set
Submitted: 8 Apr 2005 20:56 Modified: 25 Apr 2005 16:19
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.4-beta-debug OS:Linux (SUSE 9.2)
Assigned to: Antony Curtis CPU Architecture:Any

[8 Apr 2005 20:56] Peter Gulutzan
Description:
During CREATE FUNCTION ... RETURNS ENUM ... or CREATE FUNCTION RETURNS SET ...,
crash.

This may turn out to be a duplicate of BUG#9102 ("RETURNS BLOB"), BUG#9495 ("RETURNS MEDIUMTEXT"), BUG#9537 ("RETURNS LONGTEXT"), or even already-closed BUG#3788 ("RETURNS BINARY"). I begin to suspect a pattern.

How to repeat:
mysql> create function fenum () returns enum('a','b') return 'a'//
ERROR 2013 (HY000): Lost connection to MySQL server during query
[20 Apr 2005 17:09] 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/24171
[21 Apr 2005 14:51] Antony Curtis
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Fixed for 5.0.5
[25 Apr 2005 16:19] Paul DuBois
Noted in 5.0.5 changelog.

Added a note to the CREATE FUNCTION section
that the value returned by the RETURN statement
is coerced to the data type indicated by the RETURNS
clause.