Bug #12694 Inconsistency for float(m,d) specification
Submitted: 20 Aug 2005 13:19 Modified: 30 Sep 2005 18:10
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.12-beta-debug OS:Linux (SUSE 9.2)
Assigned to: Alexey Botchkov CPU Architecture:Any

[20 Aug 2005 13:19] Peter Gulutzan
Description:
For the non-standard syntax "float(m,d)" and "double(m,d)".
if I specify m<d, MySQL allows it. This is a recent change
(MySQL used to silently change it), but I don't know
exactly when the change happened. And, if I say FLOAT(0,2)
MySQL does silently change: it acts as if I said "FLOAT".
These are errors, so I would expect error messages or
warnings in traditional mode. In any case, the behaviour
is inconsistent when m=0 instead of m=1.

How to repeat:
mysql> create table tg5 (s1 float(0,2),s2 float(1,2));
Query OK, 0 rows affected (0.00 sec)

>mysql> show create table tg5;
>+-------+---------------------+
>| Table | Create Table                                                |
>+-------+---------------------+
>| tg5   | CREATE TABLE `tg5` (
>   `s1` float default NULL,
>   `s2` float(3,2) default NULL
>) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
>+-------+---------------------+
>1 row in set (0.01 sec)
... That's what I got a few weeks ago. Now I get:

>mysql> show create table tg5;
>+-------+---------------------+
>| Table | Create Table                                                |
>+-------+---------------------+
>| tg5   | CREATE TABLE `tg5` (
>   `s1` float default NULL,
>   `s2` float(1,2) default NULL
>) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
>+-------+---------------------+
>1 row in set (0.01 sec)
[20 Aug 2005 14:29] MySQL Verification Team
Thank you for the bug report.
[25 Aug 2005 14:04] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/28836
[8 Sep 2005 11:23] Alexey Botchkov
5.0.12
[8 Sep 2005 11:25] Alexey Botchkov
set in "Documenting" by mistake
[30 Sep 2005 18:10] Paul DuBois
Noted in 5.0.14 changelog.