From: saper Date: Tue, 22 Jan 2013 20:53:18 +0000 (+0100) Subject: bug 44136: Don't rollback after successful commit X-Git-Tag: 1.31.0-rc.0~20838^2 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;ds=sidebyside;h=8f8c0f177d3aad294164e4ac7ed220010cc54a69;p=lhc%2Fweb%2Fwiklou.git bug 44136: Don't rollback after successful commit For PostgreSQL only: SavepointPostgres tries to rollback already committed/rolled back transactions, so after it got committed, don't try to rollback it again in SavepointPostgres::__destroy. This happens only when trying to INSERT IGNORE something without having a transaction open first (e.g. during unit testing). Thanks to: OverlordQ Change-Id: I40ff757a7e2c6ff21f73e1ecd35754e1981f1941 --- diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index 419488e595..dcb96fbe9d 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -232,12 +232,14 @@ class SavepointPostgres { public function __destruct() { if ( $this->didbegin ) { $this->dbw->rollback(); + $this->didbegin = false; } } public function commit() { if ( $this->didbegin ) { $this->dbw->commit(); + $this->didbegin = false; } }