Bug #35970 ROLLBACK TO savepoint_name; followed by SELECT * FROM tbl_name; gives bad result
Submitted: 10 Apr 2008 19:26 Modified: 8 Oct 2008 9:18
Reporter: Terry Cook Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:QB 1.2.12, MySQL 5.0.51a OS:Windows (xp pro sp2)
Assigned to: Mike Lischke CPU Architecture:Any

[10 Apr 2008 19:26] Terry Cook
Description:
START TRANSACTION;
SELECT * FROM inventory FOR UPDATE;
  inventoryid        checkedout
      1                  n
      2                  n
      3                  n

UPDATE inventory SET checkedout='y' WHERE inventoryid IN (1,2);
SELECT * FROM inventory;
   inventoryid        checkedout
       1                  y
       2                  y
       3                  n

SAVEPOINT sp1;
UPDATE inventory SET checkedout='y' WHERE inventoryid=3;
SELECT * FROM inventory;
    inventoryid        checkedout
        1                  y
        2                  y
        3                  y

ROLLBACK TO sp1;
SELECT * FROM inventory;

What I expected {

     inventoryid       checkedout
        1                  y
        2                  y
        3                  n
}

What I received {

     inventoryid       checkedout
        1                  n
        2                  n
        3                  n
}

---------
(When I continue, it still appears that the db holds incorrect values.)
COMMIT;
SELECT * FROM inventory;
     inventoryid       checkedout
        1                  n
        2                  n
        3                  n

...
(But when I start a new transaction, correct values reappear.)
START TRANSACTION;
SELECT * FROM inventory;
      inventoryid      checkedout
        1                  y
        2                  y
        3                  n

#the above works fine from command line, but not in MySQL Query Browser.

How to repeat:
Cut and paste the code, it always fails to show the correct data in MySQL Query Browser.
[10 Apr 2008 21:53] Peter Laursen
Just FYI: tried a 3rd party GUI client (SQLyog).  Does as expected.
[10 Apr 2008 21:54] Peter Laursen
test case in SQLyog

Attachment: inventory.jpg (image/jpeg, text), 51.63 KiB.

[5 May 2008 20:27] Sveta Smirnova
Thank you for the report.

Verified as described.
[8 Oct 2008 9:18] Mike Lischke
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