Bug #9546 Precision math: crash with very long decimal literal
Submitted: 31 Mar 2005 22:39 Modified: 6 May 2005 14:07
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: Alexey Botchkov CPU Architecture:Any

[31 Mar 2005 22:39] Peter Gulutzan
Description:
Extremely long numeric literals (145 digits, say) are now treated as DECIMAL not FLOAT.
Therefore the range is smaller than it was in earlier versions, now it's 72 digits.
More importantly, I get a crash if I try to do arithmetic with such long numbers.

How to repeat:
mysql> select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 as x;
+--------------------------------------------------------------------------+
| x                                                                        |
+--------------------------------------------------------------------------+
| 999999999999999999999999999999999999999999999999999999999999999999999999 |
+--------------------------------------------------------------------------+
1 row in set, 1 warning (0.01 sec)

mysql> select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999+1 as x;
ERROR 2013 (HY000): Lost connection to MySQL server during query

/* The expression in the second query above is X+1, where X is 145 9s. */
[1 Apr 2005 0:46] MySQL Verification Team
Thank you for the bug report.
[6 May 2005 11:48] Alexey Botchkov
bk commit - 5.0 tree (holyfoot:1.1921) BUG#9546
[6 May 2005 14:07] 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