> CREATE TABLE test(foo FLOAT);
> INSERT INTO test VALUES(1.2899999);
> SELECT * FROM test;
+------+
| foo |
+------+
| 1.29 |
+------+
While it's obvious that FLOAT is not a precise data type, it is still rounding this data too arbitrarily. Let's check if it's actually able to store it:
> ALTER TABLE test MODIFY foo DOUBLE;
> SELECT * FROM test;
+--------------------+
| foo |
+--------------------+
| 1.2899998426437378 |
+--------------------+
Whoops, only the 7th digit got corrupted due format limitations. Is there a way to prevent overzealous rounding in this situation, short of converting the column to DOUBLE?
Best Answer
I hate precision-based issues. I dealt with one before: Data Truncated for Column
You may have do the ALTER TABLE manually
or
or
Not sure what will happen, but give it a try and see what happens.