| jim winstead
|
6
|
 |
|
01-02-2005 11:55 PM ET (US)
|
|
the scale (the second number in the type declaration) is not the number of digits that *can be* after the decimal point, it is the number of digits that *are* after the decimal point. you're specifying a value out of range for that column, so mysql is storing it as the maximum value for that column.
with mysql 4.1, you can do a 'SHOW WARNINGS' and see:
| Warning | 1264 | Data truncated; out of range for column 'example_num' at row 1 |
with mysql 5.0, you can turn on 'STRICT' mode to have it produce an error on such conditions.
mysql's decimal handling is less than perfect when it comes to performing calculations, because it falls back to using the system's floating point operations. this is also being addressed in mysql 5.0.
|