Bug #38851 Entering 999.99 into FLOAT(5,2) gives warning 1264 (Out of range value adjust..)
Submitted: 18 Aug 2008 12:47 Modified: 18 Aug 2008 16:35
Reporter: Thomas Tallyce Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.51a-community OS:Linux (SUSE)
Assigned to: CPU Architecture:Any
Tags: FLOAT

[18 Aug 2008 12:47] Thomas Tallyce
Description:
UPDATE `test` SET `floattest` = '999.99' WHERE `id` =1 ;

stores 999.99 but throws a warning:

mysql> SHOW WARNINGS;
+---------+------+-------------------------------------------------------------+
| Level   | Code | Message                                                     |
+---------+------+-------------------------------------------------------------+
| Warning | 1264 | Out of range value adjusted for column 'floattest' at row 1 |
+---------+------+-------------------------------------------------------------+
1 row in set (0.00 sec)

I know that a FLOAT is approximate, but this does seem odd.

How to repeat:
+---------------------------------------+--------------+------+-----+---------+----------------+
| Field                                 | Type         | Null | Key | Default | Extra          |
+---------------------------------------+--------------+------+-----+---------+----------------+
| id                                    | int(11)      | NO   | PRI | NULL    | auto_increment |
| floattest                             | float(5,2)   | NO   |     | NULL    |                |
+---------------------------------------+--------------+------+-----+---------+----------------+

UPDATE `test` SET `floattest` = '999.99' WHERE `id` =1 ;
[18 Aug 2008 16:35] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior with current development sources, although bug is repeatable with current version 5.0.67. Please wait next release.