Bug #32988 Deleting a layer deletes tables but leaves dangling fks, crashes wb
Submitted: 4 Dec 2007 23:51 Modified: 7 Dec 2007 8:48
Reporter: Roland Bouman Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S1 (Critical)
Version:5.0.10 OS:Windows (XP home)
Assigned to: Johannes Taxacher CPU Architecture:Any

[4 Dec 2007 23:51] Roland Bouman
Description:
When deleting a layer, the tables inside it are also deleted (I don't like this behaviour but I heard that it is infact intentional)

if the are fks on tables inside the layer to tables outside the layer, the relationships are not removed, and remain dangling.

If you undo that, the layer and tables re-appear, but the fk is not attached to the table anymore. 

If you save and reload a model with a dangling fk, wb crahses

How to repeat:
see attachments, open layer_fk.mwb, review png screenshots layer_fk1 through 3.

Then reproduce deletion in layer_fk.mwb, observe bug. Then save under a different name, re-open => crash.

(layer_fk3.mwb contains such a model with dangling fk and can be used to crash wb

Suggested fix:
Personally I think that only the layer should be removed. But at any rate, no dangling fk's should ever appear, no crash should occur. Also, the undo should undo properly (and not leave danglin fk)
[4 Dec 2007 23:52] Roland Bouman
model to reproduce issue

Attachment: layer_fk.mwb (application/octet-stream, text), 4.67 KiB.

[4 Dec 2007 23:52] Roland Bouman
model with issue, caution: crashes wb

Attachment: layer_fk3.mwb (application/octet-stream, text), 4.45 KiB.

[4 Dec 2007 23:52] Roland Bouman
step1 to reproduce

Attachment: layer_fk1.PNG (image/png, text), 46.56 KiB.

[4 Dec 2007 23:52] Roland Bouman
step2 to reproduce

Attachment: layer_fk2.PNG (image/png, text), 40.05 KiB.

[4 Dec 2007 23:53] Roland Bouman
step3 to reproduce

Attachment: layer_fk3.PNG (image/png, text), 45.15 KiB.

[5 Dec 2007 4:28] Valeriy Kravchuk
Thank you for a detailed bug report. Verified just as described. In my case attempt to move table that left after layer deletion also lead to crash.
[6 Dec 2007 22:55] Alfredo Kojima
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html
[7 Dec 2007 8:48] Johannes Taxacher
works in 5.0.10 SVN rev 2322