Bug #93690 JSON export default file type
Submitted: 19 Dec 2018 21:34 Modified: 20 Dec 2018 15:10
Reporter: B Towne Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:8.0 OS:Windows
Assigned to: CPU Architecture:Any
Tags: export, json_table

[19 Dec 2018 21:34] B Towne
Description:
MySQL now has JSON_TABLE functionality; see https://dev.mysql.com/doc/refman/5.7/en/json.html or https://mysqlserverteam.com/json_table-the-best-of-both-worlds/ for more information. 

In the MySQL Workbench, in the left column there is a "Navigator" pane.  Within that is a list of Schemas.  Within each Schema there is a list of tables.  
You can right-click on any table and choose the Table Data Export Wizard.  On the second screen of this you can choose to export in CSV or JSON.  By default, the File Path is blank or the previously used path.  Assuming it is blank, if you first select the JSON file type and then click Browse for the path, the default extension is always CSV.   

How to repeat:
Open MySQL Workbench.  
Open a connection to a server with a database with data.
Right click on a table in the Schemas list and click to open the Table Data Export wizard.
Click Next. 
Select the JSON option for export format.
Click Browse to get a file picker. 
Note that in the "Save as type" box, the value selected is "Comma Separated Values (*.csv)" instead of "JavaScript Object Notation (*.json)" which is the other option. 
If you just type a title in without an extension, and accept that, you will return to CSV mode on the previous dialog.  If you then re-select JSON, the file path remains with a .csv and if you export then it will be confusing.  You must manually change the file extension here again.

Suggested fix:
When bringing up the file picker dialog, where MySQL specifies the file type filter options that should be included and which should be selected by default, the default should be determined by which option is selected in the dialog box which is launching the file picker.
[19 Dec 2018 22:06] MySQL Verification Team
Thank you for the bug report. Are you using 8.0.13?. From your how to repeat I noticed only:
Note that in the "Save as type" box, the value selected is "Comma Separated Values (*.csv)" instead of "JavaScript Object Notation (*.json)" which is the other option.
[19 Dec 2018 22:14] B Towne
Yes, I'm using the latest release: 8.0.13 build 13780177 CE (64 bits), on Windows 10 Pro.
[20 Dec 2018 14:13] MySQL Verification Team
Thank you for the feedback. The only issue I found was the 'Save as type' is .csv.
[20 Dec 2018 15:10] B Towne
Yes, that is the only issue for this bug, with the caveat that the 'save as type' *should be* .csv when the user-selected option before the file picker is CSV.  The unexpected behavior is that it *should be* .json when the user-selected option before the file picker is JSON.  

The proposed fix is to pull information about what the file picker's default 'save as type' should be from the user selection in the dialog which launches the file picker.