Description:
Export / import buttons in the table view are not working for json, csv (comma delimited) and sql files.
CSV: after exporting to CSV file and reimporting that file, execution fails saying 'list index out of range'
JSON: after exporting to JSON and reimporting that file, all fields are detected properly, and execution "runs" but it imports 0 rows (also says imported 0 rows)
SQL: exporting to SQL requires entering a table name (which is correctly prefilled with the name of the table you're exporting from). But when opening that exported file, all statements begin with "INERT INTO `` ( ...)"; it seems that these "``" should have the table name requested while exporting but it turns out they are just empty, making the exported file useless (read need to do replace INSERT INTO `` with INERT INTO `actual table name` on the whole file before trying to run the statements)
[attached log from last import]
File "/usr/share/mysql-workbench/libraries/workbench/wizard_page_widget.py", line 97, in go_next
self.main.go_next_page()
File "/usr/share/mysql-workbench/libraries/workbench/wizard_form.py", line 76, in go_next_page
self.pages[index].page_activated(True)
File "/usr/lib/mysql-workbench/modules/sqlide_power_import_wizard.py", line 186, in page_activated
self.call_create_preview_table()
File "/usr/lib/mysql-workbench/modules/sqlide_power_import_wizard.py", line 344, in call_create_preview_table
self.create_preview_table(self.call_analyze())
File "/usr/lib/mysql-workbench/modules/sqlide_power_import_wizard.py", line 353, in call_analyze
if not self.active_module.analyze_file():
File "/usr/lib/mysql-workbench/modules/sqlide_power_import_export_be.py", line 576, in analyze_file
self._columns[j]['value'].append(col_value)
IndexError: list index out of range
11:04:51 [INF][ Wizard]: Execute 'Prepare Import'
11:04:51 [INF][ Wizard]: Starting thread for 'Import data file'
11:04:51 [ERR][sqlide_power_import_export_be.py:start_import:755]: Row import failed with error: ("Incorrect datetime value: 'None' for column 'deleted_at' at row 1", 1292)...Unhandled exception in Python code:
Traceback (most recent call last):
File "/usr/share/mysql-workbench/libraries/workbench/wizard_page_widget.py", line 97, in go_next
self.main.go_next_page()
File "/usr/share/mysql-workbench/libraries/workbench/wizard_form.py", line 76, in go_next_page
self.pages[index].page_activated(True)
File "/usr/lib/mysql-workbench/modules/sqlide_power_import_wizard.py", line 186, in page_activated
self.call_create_preview_table()
File "/usr/lib/mysql-workbench/modules/sqlide_power_import_wizard.py", line 344, in call_create_preview_table
self.create_preview_table(self.call_analyze())
File "/usr/lib/mysql-workbench/modules/sqlide_power_import_wizard.py", line 353, in call_analyze
if not self.active_module.analyze_file():
File "/usr/lib/mysql-workbench/modules/sqlide_power_import_export_be.py", line 576, in analyze_file
self._columns[j]['value'].append(col_value)
IndexError: list index out of range
11:07:09 [ERR][ pymforms]: Unhandled exception in Python code:
Traceback (most recent call last):
File "/usr/share/mysql-workbench/libraries/workbench/wizard_page_widget.py", line 97, in go_next
self.main.go_next_page()
File "/usr/share/mysql-workbench/libraries/workbench/wizard_form.py", line 76, in go_next_page
self.pages[index].page_activated(True)
File "/usr/lib/mysql-workbench/modules/sqlide_power_import_wizard.py", line 186, in page_activated
self.call_create_preview_table()
File "/usr/lib/mysql-workbench/modules/sqlide_power_import_wizard.py", line 344, in call_create_preview_table
self.create_preview_table(self.call_analyze())
File "/usr/lib/mysql-workbench/modules/sqlide_power_import_wizard.py", line 353, in call_analyze
if not self.active_module.analyze_file():
File "/usr/lib/mysql-workbench/modules/sqlide_power_import_export_be.py", line 576, in analyze_file
self._columns[j]['value'].append(col_value)
IndexError: list index out of range
11:09:35 [ERR][ pymforms]: Unhandled exception in Python code:
Traceback (most recent call last):
File "/usr/share/mysql-workbench/libraries/workbench/wizard_page_widget.py", line 97, in go_next
self.main.go_next_page()
File "/usr/share/mysql-workbench/libraries/workbench/wizard_form.py", line 76, in go_next_page
self.pages[index].page_activated(True)
File "/usr/lib/mysql-workbench/modules/sqlide_power_import_wizard.py", line 186, in page_activated
self.call_create_preview_table()
File "/usr/lib/mysql-workbench/modules/sqlide_power_import_wizard.py", line 344, in call_create_preview_table
self.create_preview_table(self.call_analyze())
File "/usr/lib/mysql-workbench/modules/sqlide_power_import_wizard.py", line 353, in call_analyze
if not self.active_module.analyze_file():
File "/usr/lib/mysql-workbench/modules/sqlide_power_import_export_be.py", line 576, in analyze_file
self._columns[j]['value'].append(col_value)
IndexError: list index out of range
How to repeat:
- create two same tables with different names
- fill fist table with some data
- open a tab and do `select * from first_table`
- click on export button
- select JSON / CSV / SQL
-- SQL: observe the exported file contents (missing table name within the INSERT INTO `` statements)
-- JSON: try to import it to the second table, execution is fine but nothing is imported
-- CSV: try to import it to the second table, execution should fail (at lest for fields containing text with with several new lines)