Bug #4835 | insert, numeric column, string with float value, strange result | ||
---|---|---|---|
Submitted: | 30 Jul 2004 21:33 | Modified: | 31 Jul 2004 19:43 |
Reporter: | Matthias Leich | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
Version: | 4.1 | OS: | |
Assigned to: | Paul DuBois | CPU Architecture: | Any |
[30 Jul 2004 21:33]
Matthias Leich
[30 Jul 2004 21:35]
Matthias Leich
test case
Attachment: ml_err16.test (application/octet-stream, text), 581 bytes.
[30 Jul 2004 22:59]
Sergei Golubchik
1. document as is. What happens is that for integer columns MySQL converts the string to integer, so, converting "2.0e+6" you naturally get 2, as "." is not a part of a valid integer number. For floating point numbers MySQL converts the string to float, and "2.0e+6" is the valid float. MySQL cannot convert string to float for integer types (that is it cannot convert string->double->integer) because double has lower precision than bigint, and reading the string as a float you won't be able to store "18446744073709551612" number correctly
[31 Jul 2004 19:43]
Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant product(s). Additional info: See: http://dev.mysql.com/doc/mysql/en/INSERT.html