php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #68808 Release savepoint states that it rolls back the transaction
Submitted: 2015-01-12 10:18 UTC Modified: 2017-01-28 17:15 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: jesper at prisjakt dot nu Assigned:
Status: Open Package: MySQLi related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jesper at prisjakt dot nu
New email:
PHP Version: OS:

 

 [2015-01-12 10:18 UTC] jesper at prisjakt dot nu
Description:
------------
---
From manual page: http://www.php.net/mysqli.release-savepoint
---

The documentation states:

mysqli::release_savepoint -- mysqli_release_savepoint — Rolls back a transaction to the named savepoint

However, this is not what RELEASE SAVEPOINT does (http://dev.mysql.com/doc/refman/5.0/en/savepoint.html) (and a quick test verifies that this function does not roll back either)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-30 11:37 UTC] ghostaldev at gmail dot com
Here is a test to confirm. The table ends up as:

apple
potato
orange

"pomegranate" is missing, because it has been rolled back, but potato is included, because release_savepoint() actually has the effect of "forgetting" that savepoint, but NOT rolling back the work.

$db->begin_transaction();
$db->query('INSERT INTO utility_belt SET item="apple"');
$db->savepoint('vegetables');
$db->query('INSERT INTO utility_belt SET item="potato"');
$db->release_savepoint('vegetables');
$db->savepoint('nope');
$db->query('INSERT INTO utility_belt SET item="pomegranate"');
$db->query('ROLLBACK TO nope'); // No rollback to savepoint function..?
$db->query('INSERT INTO utility_belt SET item="orange"');
$db->commit();

It's interesting too that there appears to be no function to ACTUALLY rollback to a given savepoint.
 [2015-03-19 20:41 UTC] cmb@php.net
I have submitted a respective patch via PHDOE.

> It's interesting too that there appears to be no function to
> ACTUALLY rollback to a given savepoint.

Feel free to file a respective feature request. :)
 [2017-01-28 17:15 UTC] cmb@php.net
-Package: Documentation problem +Package: MySQLi related
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Nov 11 22:01:32 2019 UTC