Bug #9351 Strange results when using double
Submitted: 23 Mar 2005 9:53 Modified: 24 Mar 2005 1:58
Reporter: [ name withheld ] Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.10a-log OS:FreeBSD (FreeBSD 5.3)
Assigned to: CPU Architecture:Any

[23 Mar 2005 9:53] [ name withheld ]
Description:
When creating a table with fieldtype double without specifying the size and entering a decimal number the results of a select are very strange. See the how to repeat section.

We tested it in MySQL 4.0 without any problems. When altering the size of the field ( double 8,2)) the results are ok, without reentering the decimal.

How to repeat:
mysql> create table test (prijs double);
Query OK, 0 rows affected, 1 warning (0.07 sec)

mysql> insert into test values(112.50);
Query OK, 1 row affected (0.00 sec)

mysql> select * from test;
+------------------+
| prijs            |
+------------------+
| 000.000011920929 |
+------------------+
1 row in set (0.02 sec)
[24 Mar 2005 1:58] MySQL Verification Team
I wasn't able to repeat with current BK source:

mysql> create table test (prijs double);
Query OK, 0 rows affected (0.02 sec)

mysql>  insert into test values(112.50);
Query OK, 1 row affected (0.00 sec)

mysql> select * from test;
+-------+
| prijs |
+-------+
| 112.5 |
+-------+
1 row in set (0.00 sec)

mysql> select version();
+------------------+
| version()        |
+------------------+
| 4.1.11-debug-log |
+------------------+
1 row in set (0.00 sec)