Bug #2776 Stored procedure crash if variable assigned to default
Submitted: 13 Feb 2004 8:05 Modified: 6 Apr 2004 6:53
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.0-alpha-debug OS:Linux (SuSE 8.2)
Assigned to: Bugs System CPU Architecture:Any

[13 Feb 2004 8:05] Peter Gulutzan
Description:
It should be possible to say "SET variable_name = DEFAULT" just as it's possible to insert 
DEFAULT, or UPDATE ... SET column_name = DEFAULT. But when I call a procedure 
containing such an assignment, I get a crash. 
 
Bug#2653 "Undeclared variables not detected in stored procedures" may look similar, but 
DEFAULT is not an "undeclared variable", and if I use some other name, e.g. "SET 
variable_name = WOMBAT", there's no crash. 
 

How to repeat:
mysql> create procedure p () begin declare v1 int; set v1 = default; end;// 
Query OK, 0 rows affected (0.01 sec) 
 
mysql> call p()// 
ERROR 2013 (HY000): Lost connection to MySQL server during query
[17 Feb 2004 11:47] Dean Ellis
Verified against 5.0.1-alpha-log.
[6 Apr 2004 6:53] Per-Erik Martin
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