Rolling back to a savepoint should leave the savepoint in the transaction stack

Created on 3 September 2023, 10 months ago
Updated 30 October 2023, 8 months ago

Problem/Motivation

When rolling back to a savepoint, we are currently removing the reference to the Transaction object in the stack. This means that a later release or rollback of the same savepoint on the database is not happening.

However, per MySQL docs (emphasis mine), https://dev.mysql.com/doc/refman/8.0/en/savepoint.html:

The ROLLBACK TO SAVEPOINT statement rolls back a transaction to the named savepoint without terminating the transaction. Modifications that the current transaction made to rows after the savepoint was set are undone in the rollback, but InnoDB does not release the row locks that were stored in memory after the savepoint. (For a new inserted row, the lock information is carried by the transaction ID stored in the row; the lock is not separately stored in memory. In this case, the row lock is released in the undo.) Savepoints that were set at a later time than the named savepoint are deleted.

So if I am reading this correctly, the savepoint rolled back to remains actually active, and we should not remove it from our transaction stack.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Fixed

Version

10.2

Component
Database 

Last updated about 5 hours ago

  • Maintained by
  • 🇳🇱Netherlands @daffie
Created by

🇮🇹Italy mondrake 🇮🇹

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024