Bug #23523 all other views dropped when creating second view
Submitted: 21 Oct 2006 3:17 Modified: 23 Oct 2006 11:49
Reporter: Chun Yu Liu Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Administrator Severity:S3 (Non-critical)
Version:1.2.4 rc OS:Windows (Windows XP)
Assigned to: Vladimir Kolesnikov CPU Architecture:Any

[21 Oct 2006 3:17] Chun Yu Liu
Description:
When there is 1 view in my schema and I creating another view by the 'Create View' button in the 'Views' tab, the view is created successfully. But, the view before it is disappeared.

How to repeat:
This is the create view I used to create the first view(executed by using the 'Create View' function in the MySQL Administrator):

CREATE OR REPLACE VIEW `jnj`.`xorderdetail` AS 
select xo.SysOrderID, xo.OrderID, xo.TotalAmountCY, xo.TotalAmount, xoi.ItemSeqNo AS SeqNo,
xoi.ItemID, xoi.Quantity, xoi.UnitPriceCY, xoi.UnitPrice
from XOrder xo inner join XOrderItem xoi on
xo.SysOrderID = xoi.SysOrderID
order by xo.SysOrderID, xoi.ItemSeqNo

And, this is the second view:

CREATE OR REPLACE VIEW `jnj`.`xordersumview` AS 
select xo.SysOrderID, xo.OrderID, xo.TotalAmountCY, xo.TotalAmount,
sum(xoi.Quantity) as TotalQty,
sum(xoi.Quantity * xoi.UnitPrice) as TotalItemAmount
from XOrder xo inner join XOrderItem xoi on
xo.SysOrderID = xoi.SysOrderID
group by xo.SysOrderID, xo.OrderID, xo.TotalAmountCY, xo.TotalAmount
[23 Oct 2006 9:06] Sveta Smirnova
Thank you for the report.

Problem is not always repeatable. To repeat it some time I followed below instructions:

1. Select database without views.
2. Create view (say `aaa`) using "Create" button "AS SELECT 1";
3. Create view using create button "AS SELECT * FROM existant_table"

or

3. Close MySQL Administrator.
4. Open MySQL Administrator.
5. Click on `aaa` view and than on 'Edit' button.
6. Click 'Cancel' in appeared dialog.
7. Create view using create button "AS SELECT * FROM existant_table"
[23 Oct 2006 9:12] Sveta Smirnova
Bug #22275 and bug #18916 were marked as duplicates of this one.
[23 Oct 2006 11:49] Vladimir Kolesnikov
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