Bug #69754 Syntax 'DOUBLE PRECISION' rejected in MySQL Workbench
Submitted: 16 Jul 2013 9:36 Modified: 21 Aug 2014 0:36
Reporter: John Kirkwood Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:5.2.46, 5.2.47,6.0.3 OS:Linux (Ubuntu 10.04.4)
Assigned to: CPU Architecture:Any
Tags: double, precision

[16 Jul 2013 9:36] John Kirkwood
Description:
MySQL permits a nonstandard syntax: FLOAT(M,D) or REAL(M,D) or DOUBLE PRECISION(M,D).
http://dev.mysql.com/doc/refman/5.1/en/floating-point-types.html

The MySQL Workbench SQL Editor does not accept the keyword 'precision' as valid and red-underlines it in the editor.

The Modelling function 'Reverse Engineer MySQL Create Script' throws an error for any occurrence of 'double precision' and will only accept fields declared without the 'precision' keyword.

The Table Editor does not offer the REAL(M,D) or DOUBLE PRECISION(M,D) datatypes.

How to repeat:
SQL Editor:
Enter this text in a new editor pane:
CREATE TABLE `TestTable` (
    `test_float` double precision);
The keyword 'precision' is red-underlined. [Save this script.]

Modelling:
Using menu 'File > Import > Reverse Engineer MySQL Create Script', attempt to import the script saved above. The action will fail and the message log will show:
ERROR: Line 3: SQL syntax error near 'precision)'. Statement skipped.

Suggested fix:
Allow the use of the syntax 'double precision' throughout MySQL Workbench.

Workaround:
Remove all occurrences of the keyword 'precision' from existing SQL create scripts before attempting to import or edit them.

Background:
The Django web framework, up to and including the latest version 1.5.1, generates MySQL declarations for its FloatField datatype using the syntax 'double precision'.
https://github.com/django/django/blob/master/django/db/backends/mysql/creation.py
I will also raise this issue on djangoproject.com.
[16 Jul 2013 11:06] MySQL Verification Team
Hello John,

Thank you for the bug report and the test case. 
Verified as described on 6.0.3(11035)/5.2.47.

Thanks,
Umesh
[21 Aug 2014 0:36] Philip Olson
Fixed as of the MySQL Workbench 6.2.0 release, and here's the changelog entry:

The "precision" keyword was not considered valid in MySQL Workbench. The SQL
editor, reverse engineering wizard, and table editor were updated to
accept the "precision" keyword.

Thank you for the bug report.