Bug #82656 Table Data Import Wizard doesn't have DECIMAL as choice
Submitted: 19 Aug 2016 16:02 Modified: 19 Aug 2016 18:37
Reporter: Christian McDonald Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:6.3.7 OS:Mac OS X (El Capitan)
Assigned to: CPU Architecture:Any

[19 Aug 2016 16:02] Christian McDonald
Description:
I have a csv data set with a typical monetary field with values like "1205.34". When I use the Table Data Import Wizard to import this data set, the only number type field available is DOUBLE, which is an approximate number type. I want to use the DECIMAL exact number type, but it is not a choice at import.

How to repeat:
Use a csv data set, such as this example:

TABC Permit Number,Trade Name,Location Address,Location City,Location State,Location Zip Code,Location County Code,Blank,Report Period,Report Tax
MB821424,ABI-HAUS,959 N 2ND ST,ABILENE,TX,79601,221,,2015/02,783.23
MB638028,ABILENE BEEHIVE INC,442 CEDAR ST STE A,ABILENE,TX,79601,221,,2015/03,2350.42
MB543114,ABILENE BOWLING LANES INC,279 RUIDOSA AVE,ABILENE,TX,79605,221,,2015/02,346.99

and use the Table Data Import Wizard to import that data. on the Table Data Import screen, you'll see the options for data types for the Report Tax field. The GUI suggests DOUBLE, and there is no option to choose DECIMAL.

Suggested fix:
Allow the use of DECIMAL as an option. Also, much like datepart formats with DATETIME, you should give options to control the precision and scale.

I'm told by a colleague that the DOUBLE opton is hard coded into the app:

As for Workbench's limitation, it appears that the table import wizard hardcodes types. See line 381 of:

./plugins/wb.sqlide/sqlide_power_import_wizard.py:

       type_items = {'is_string':'text', 'is_number':'int', 'is_float':'double', 'is_bin':'binary', 'is_date_or_time': 'datetime', 'is_json':'json'}

But I don't pretend to know that is for sure the place to fix this.
[19 Aug 2016 18:37] MySQL Verification Team
Thank you for the bug report.