Bug #16177 clipping a float value without a notice?
Submitted: 4 Jan 2006 8:01 Modified: 4 Jan 2006 8:36
Reporter: Carsten Meyer Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.10a (mig. 3.23.XX) OS:Linux (SuSE Linux)
Assigned to: CPU Architecture:Any

[4 Jan 2006 8:01] Carsten Meyer
I find it a little bit strange, clipping a float value that does not fit into a field without a notice. 

MySQL 3.XX.XX didn't clip such (wrong) values, but after the migration to 4.1.10a values were changed. 

How to repeat:
create table floattest ( val float (5,2));
insert into floattest (val) values (1000.00);
SELECT * FROM floattest;

val 999.99

Suggested fix:
What is the option to set this behavior?

And why isn't it metioned in the chapter "Date Types / Float"?
[4 Jan 2006 8:36] Valeriy Kravchuk
Thank you for a problem report. Sorry, but it is not a bug. It is known and documented behaviour of float data type, that can give you different results on different versions, architectures etc. Please, read http://dev.mysql.com/doc/refman/4.1/en/problems-with-float.html for the details.