Bug #18984 | CASTing datetime to decimal without decimals gives unexpected output | ||
---|---|---|---|
Submitted: | 10 Apr 2006 19:44 | Modified: | 18 Nov 2007 11:34 |
Reporter: | Tobias Asplund | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.0.19/5.1.7 | OS: | Any |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[10 Apr 2006 19:44]
Tobias Asplund
[3 Aug 2006 9:34]
Magnus BlÄudd
DECIMAL(14,0) interprets the zero as "use default" number of decimals. Will need to investigate how this should work.
[27 Jun 2007 12:23]
Tobias Asplund
It seems like the default is not 2 in this case, though: mysql> CREATE TABLE t1 ( a DECIMAL ); Query OK, 0 rows affected (0.05 sec) mysql> INSERT INTO t1 VALUES (2.555); Query OK, 1 row affected, 1 warning (0.00 sec) mysql> SELECT * FROM t1; +------+ | a | +------+ | 3 | +------+ 1 row in set (0.00 sec)
[9 Oct 2007 8:50]
MySQL Verification Team
see related Bug #31471
[18 Nov 2007 11:34]
Gleb Shchepa
This bug is a duplicate and already has been fixed (see bug #27921 and bug #27957).