Bug #19238 Incorrect UPDATE statement generated editing single row in Query Browser
Submitted: 21 Apr 2006 1:08 Modified: 5 Oct 2006 10:27
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.1.20 OS:Windows (Windows)
Assigned to: Vladimir Kolesnikov CPU Architecture:Any
Tags: Result Set

[21 Apr 2006 1:08] Shane Bester
Description:
When issueing a SELECT, 1 result is returned.  Click 'edit' to edit a value in the row, then apply changes.

Even though the table has a primary key, an incorrect UPDATE statement is generated, and wrong rows are updated.

How to repeat:
import the attached sql dump.

run the following statement which returns one record:
select * from lots where lotnb = 'SA0940' 
- Click on the Edit button
- Change RevisionID from 35 to 49
- Click Apply Changes
- In the general query log this query appears:

UPDATE `test`.`lots` SET `RevisionId`=49 WHERE `RevisionId`=35

It *should* really be updating using the primary key:

UPDATE `test`.`lots` SET `RevisionId`=49 WHERE `LotId`=679

Suggested fix:
make sure query browser uses a primary key or unique index for updates.
[5 Oct 2006 10:27] 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