Bug #7582 Query Browser can no longer edit when table structure changes
Submitted: 29 Dec 2004 22:42 Modified: 30 Dec 2004 0:26
Reporter: Michael Lee Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.1.3 OS:Windows (Windows XP SP2)
Assigned to: CPU Architecture:Any

[29 Dec 2004 22:42] Michael Lee
Description:
The following operations cause the edit button for a result set to become disabled and the program continually asks if you want to discard the changes you just made to the result set.

Basically, I was editing some data in a result set and realized I needed another column for data I wanted to enter.  I immediately added the column to the table but then I needed to run the select query again to retrieve the data in the new structure.  At this point, the query browser asks if I want to discard the data but can't resolve what table I was working on.

How to repeat:
I had just selected results from a table

select * from a table;

Then, I clicked the edit button to edit the results (yes, this table has a primary key)

I changed a value in the table (the field color changes on the table)

Then, edit the table structure and add a new field

Apply the table structure changes.

Run the select query again.

Since you have changes in the table data, the browser will ask you if you want to discard the changes.  However, it no longer recognizes the table you were working on and can't get itself out of it.  New selects will bring up data but you can no longer click on the edit button.  The buttons states for edit/apply changes/discard changes at the bottom of the screen will be stuck in their states from the previous table structure.

Suggested fix:
No real suggestions though it shouldn't be too hard to find in the code.

My work arounds are:

1. Discard changes before editing the table structure.
2. If problem occurs, reconnect to the database and close the old query brower window (it will ask one more time if you want to discard the changes).
[30 Dec 2004 0:26] MySQL Verification Team
I wasn't able to repeat with QB version 1.1.4.