Bug #9871 float numbers / difference in cnversion
Submitted: 13 Apr 2005 14:10 Modified: 5 May 2006 21:33
Reporter: Martin Friebe (Gold Quality Contributor) (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S4 (Feature request)
Version:4.0, 4.1 OS:Any (*)
Assigned to: Paul DuBois CPU Architecture:Any

[13 Apr 2005 14:10] Martin Friebe
Description:
Following the explanations from Bug #9840 http://bugs.mysql.com/bug.php?id=9840 see comment from  [13 Apr 3:41pm] Sergei Golubchik:

I have looked through the documentation, at http://dev.mysql.com/doc/mysql/en/problems-with-float.html but not found any reference to the difference ways (and resulting differences) in conversion of string vs (big-)int to float.

I believe this could be included and also linked from http://dev.mysql.com/doc/mysql/en/comparison-operators.html in the context of " In all other cases, the arguments are compared as floating-point (real) numbers"

Which is likely to applz to All number-string comparisation.

How to repeat:
-

Suggested fix:
add to documentation, possibly link from indicated page

Thanks
[13 Apr 2005 14:22] Martin Friebe
And another thing, that should also be documented on htis page, or linked to:

As the above results show, the results with floating numbers may differ depnding on the build (optimization, version, compiler), or maybe even the system/ architecture the server is running on.
This could break replication. It is unavoidable, therefore not a bug, but it should be included on this page, and be linked to from the replication page

http://dev.mysql.com/doc/mysql/en/replication-features.html
[5 May 2006 21:33] 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:

I've updated these sections with additional information
about type conversion and floating-point comparisons:

http://dev.mysql.com/doc/refman/5.0/en/type-conversion.html
http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html

I've also added a note about how master/slave differences
can arise from floating-point operations:

http://dev.mysql.com/doc/refman/5.0/en/replication-features.html

See also Bug#9840.