Bug #55226 Unable to rename a view name appended with '_WRONG_SCHEMA'
Submitted: 13 Jul 2010 18:36 Modified: 13 Jul 2010 19:28
Reporter: Winny Mathew Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:5.2.25 CE (GA) OS:Windows
Assigned to: CPU Architecture:Any
Tags: 5.2.25, rename, VIEW, workbench, WRONG_SCHEMA

[13 Jul 2010 18:36] Winny Mathew
Description:
When I try to create a view with the following syntax in the Workbench,

CREATE VIEW `test_database`.`View_Test` AS 
SELECT TT.Id AS TestId, T.Name
FROM Test_Table TT 
JOIN Test T ON TT.Id = T.Id 

the view name gets automatically appended with the string _WRONG_SCHEMA and becomes 'View_Test_WRONG_SCHEMA'.

Part 1:
The view syntax shows no error in the Workbench and is consistent with the syntax for 'create view' specified in MySQL documentation. It executes without errors in MySQL Query Browser, still this view is automatically appended with the '_WRONG_SCHEMA' string.

Part 2:
In previous versions of the Workbench I could rename this to just 'View_Test'. Current version seems to miss the 'rename' option.

How to repeat:
1. Open or Create a EER Model using Workbench.
2. Double click 'Add View' to create a new view.
3. Paste the following code in the editor for the new view created.

CREATE VIEW `test_database`.`View_Test` AS 
SELECT TT.Id AS TestId, T.Name
FROM Test_Table TT 
JOIN Test T ON TT.Id = T.Id

The view will be named as 'View_Test_WRONG_SCHEMA'. This happens even if the tables are defined.
[13 Jul 2010 18:52] MySQL Verification Team
Thank you for the bug report. Do you have test_database schema before the paste action?. Thanks in advance.
[13 Jul 2010 19:11] Winny Mathew
Yes, I do have the right schema name.

Ah ha... I found the issue!!!

I had named the schema as 'Test_Database'. The view got renamed correctly when I changed the schema name from 'test_database' to 'Test_Database'.

I did not notice the case. MySQL is case insensitive for table and view names, I thought the same might apply for schema names too.

Thanks and Regards,

Winny
[13 Jul 2010 19:28] Valeriy Kravchuk
So, this is not a bug.