Bug #64208 Improve error feedback when encountering errors synchronising model to db
Submitted: 2 Feb 2012 12:49 Modified: 11 Feb 2014 7:15
Reporter: Craig Fowler Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[2 Feb 2012 12:49] Craig Fowler
Description:
At present when synchronising a database model to a MySQL server, if an error is encountered during this synchronistaion, the text of the error is displayed to the user.  For example:

ERROR: Error 1071: Specified key was too long; max key length is 767 bytes.

It would be a lot more helpful to display (alongside this error text) which SQL statement generated that error.  In the example above it would probably be the ALTER TABLE or CREATE TABLE statement that includes an INDEX() line.

Even if Workbench can't tell us exactly which part of that overall statement (which in the case of an ALTER TABLE could include many individual changes) - displaying the overall statement would greatly help narrow the search down for problems in the model.

---

Current workaround that I am using:  When I am shown the 'preview' of the SQL that Workbench is about to execute against the database (during the synchronise operation), I copy it to my clipboard and then abort the synchronisation process.  Then I load up the SQL IDE against the same database and paste/execute the script there.  If there is a problem, the script will stop executing on the line of SQL that caused the error and I will get much more useful feedback as to what I need to do.

How to repeat:
Create a model that contains some kind of problem, such as an index that is too large.  Try synchronising that model to a db server.  You will see an error message but that error message might not contain enough information to determine what needs changing in the model in order to correct the problem - in some cases it might not even indicate which table(s) need modifying/fixing.

Displaying the current command that was executing (and caused the error) would go a long way towards making that easier to do.
[2 Feb 2012 16:47] Valeriy Kravchuk
Thank you for the feature request.
[7 Feb 2014 20:16] Rafael Antonio Bedoy Torres
Posted by developer:
 
Fixed, checked using 6.1.2.11647
[11 Feb 2014 7:15] Philip Olson
Fixed as of the upcoming MySQL Workbench 6.1.2 release, and here's the changelog entry:

When synchronizing a model to a database server generates an error, the
query causing the error is now displayed alongside the generated error.

Thank you for the bug report.