Bug #55661 Workbench overwrites VIEW code in diagrams when two views have the same name
Submitted: 31 Jul 2010 13:11 Modified: 24 Sep 2010 15:59
Reporter: Leandro Santiago Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S2 (Serious)
Version:5.2.25 OS:Any
Assigned to: Sergei Tkachenko CPU Architecture:Any

[31 Jul 2010 13:11] Leandro Santiago
Description:
In diagram editor, when I create two views with the same name (but differents contents), Workbench overwrites the content of the oldest view by the newest view.

How to repeat:
Create a new diagram.

In diagram, create a new view named FirstView with any content. For example:

CREATE VIEW `mydb`.`FirstView` AS
SELECT 

	MAX(V.pontos)

FROM

	valores AS V;

Then create another view named SecondView with this content (example):

CREATE VIEW `mydb`.`SecondView` AS
SELECT 

	CONCAT(DATE(NOW())," ",YEAR(NOW()));

By now, everything Ok. But if you rename SecondView to FirstView (in the text editor), the body of FirstView is overwrited by the body of SecondView and Second and this name is not changed to FirstView.

As result, you have two views with the same content, but different names. You lost the all FirstView content.

(sorry my bad English. I hope you understand me)
[2 Aug 2010 9:30] Susanne Ebrecht
I am not able to follow you.

Please describe step by step what you did and/or attach screenshots.
[2 Aug 2010 12:43] Leandro Santiago
Step by step

Attachment: workbench-view-bug-step.png (image/png, text), 42.10 KiB.

[2 Aug 2010 13:44] MySQL Verification Team
Thank you for the feedback.
[23 Aug 2010 15:11] Alfredo Kojima
Apparently the editor will update the code from the object named in the view code, instead of the editor being edited.
[20 Sep 2010 13:44] Johannes Taxacher
fix confirmed in release 5.2.28
[24 Sep 2010 15:59] Tony Bedford
An entry has been added to the 5.2.28 changelog:

In the View Editor, if the name of a view was changed in the code editor to the name of a pre-existing view of that name, the contents of the pre-existing view were replaced by the contents of the new view, even though the new view was created with a different name.