Bug #72909 Synchronize model uses already disabled partition data
Submitted: 7 Jun 2014 23:23 Modified: 17 Feb 2015 1:28
Reporter: Ádám Fibinger Email Updates:
Status: Closed Impact on me:
Category:MySQL Workbench Severity:S3 (Non-critical)
Version: build 1642 OS:Microsoft Windows
Assigned to: CPU Architecture:Any
Tags: model, partition, save, synchronize

[7 Jun 2014 23:23] Ádám Fibinger
Experimented with partitioning and used the Export -> Forward engineer SQL.. option, worked fine.

Later, tried to use Database -> Sync model and kept inserting non-existent partition data into the alter statement.

Tried to re-enable and disable partition data for the table, did not work, still got weird partition data in the query.


1 - Turn off partitioning on the table and save the model (Create a backup!!!)
2 - Rename from model.mwb -> model.zip
3 - Extract document.mwb.xml from the zip
4 - Edit the document.mwb.xml, make sure in the table this item is zero:
<value type="int" key="partitionCount">0</value>
And this item is empty:
<value type="string" key="partitionExpression"></value>
5 - Compress your script again
6 - Rename the zip back to the proper *.mwb extension
7 - Synchronize is working again.

How to repeat:
Create a table, create set up hash partitioning for it. Set partition count to 10.

Save the model. Remove partition information, save again. 

Export trough Export -> Forward engineer SQL script and use that to create the table in a MySQL database.

Use Database -> Synchronize model on the same database you created. It will use partition information again (probably with some kind of syntax error).
[27 Aug 2014 11:35] Marcin Szalowicz
Thank you for the bug report.
[17 Feb 2015 1:28] Philip Olson
Posted by developer:
Fixed as of the upcoming MySQL Workbench 6.2.5 release, and here's the changelog entry:

The "Synchronize Model" wizard would fail on forward engineered tables
that had hash partitioning enabled and then disabled. It assumed that
partitioning was still enabled.

Thank you for the bug report.