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: 2020-11-26 23:02 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: cmb (profile)
Status: Closed Package: MySQLi related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [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
 [2020-11-26 23:02 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2020-11-26 23:02 UTC] cmb@php.net
This has already been fixed[1] quite a while ago!

[1] <https://github.com/php/doc-en/commit/3a488bc675db0eef92c52122486574c58ca8c417>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 06:01:29 2024 UTC