Bug #8447 Precision math/Procedures: Crash when function uses large decimal
Submitted: 11 Feb 2005 18:09 Modified: 6 May 2005 16:08
Reporter: Trudy Pelzer 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.1)
Assigned to: Alexey Botchkov CPU Architecture:Any

[11 Feb 2005 18:09] Trudy Pelzer
Description:
When a function definition contains a large decimal
value, the server crashes when the function is called.

How to repeat:
mysql> delimiter //

mysql> create function f1 (param1 decimal(38,0)) returns decimal(38,0) 
  begin 
    declare v decimal(38,0);
    set v=123456789012345678901234567890; 
    return v/param1; 
  end;//
Query OK, 0 rows affected (0.00 sec)

mysql> select f1(10)//
ERROR 2013 (HY000): Lost connection to MySQL server during query
[6 May 2005 16:08] Alexey Botchkov
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 with the 'big' decimal-related patch.