Bug #9101 Rollback to savepoint destroys savepoint
Submitted: 10 Mar 2005 19:31 Modified: 11 Mar 2005 20:00
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.3-alpha-debug-log OS:Linux (SUSE 9.2)
Assigned to: Sergei Golubchik CPU Architecture:Any

[10 Mar 2005 19:31] Peter Gulutzan
Description:
If I say ROLLBACK TO SAVEPOINT S, savepoint S is destroyed.
This isn't what a standard-compliant DBMS would do.  
The standard document says "All savepoints established by the
current SQL-transaction SUBSEQUENT to the establishment of S
are destroyed." The DB2 manual says; "After a successful
ROLLBACK, the savepoint continues to exist." The Oracle
manual says: "The named savepoint is retained, so you can
roll back to the same savepoint multiple times."

How to repeat:
mysql> start transaction;
Query OK, 0 rows affected (0.00 sec)

mysql> savepoint some;
Query OK, 0 rows affected (0.00 sec)

mysql> rollback to savepoint some;
Query OK, 0 rows affected (0.00 sec)

mysql> rollback to savepoint some;
ERROR 1305 (42000): SAVEPOINT some does not exist
[11 Mar 2005 20:00] Sergei Golubchik
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 bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html
[11 Mar 2005 20:03] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/22949