Bug #80045 Syntax error returned for invalid D in DECIMAL(M, D), ERROR 1427 expected
Submitted: 19 Jan 2016 9:03 Modified: 19 Jan 2016 10:19
Reporter: Su Dylan Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.7.8, 5.5.48, 5.6.28, 5.7.10 OS:Any
Assigned to: CPU Architecture:Any

[19 Jan 2016 9:03] Su Dylan
Description:
Output:
=====
mysql> select cast(1 AS DECIMAL( 1, 3041853440 ) );
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '3041853440 ) )' at line 1
mysql> select version();
+-----------+
| version() |
+-----------+
| 5.7.8-rc  |
+-----------+
1 row in set (0.00 sec)

Problem:
=====

How to repeat:
select cast(1 AS DECIMAL( 1, 3041853440 ) );

Suggested fix:
The following error message is returned.

ERROR 1427 (42000): For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '').
[19 Jan 2016 10:19] MySQL Verification Team
Hello Su Dylan,

Thank you for the report and test case.
Observed that 5.5.48, 5.6.28 and 5.7.10 are affected.

Thanks,
Umesh