From 8f8c0f177d3aad294164e4ac7ed220010cc54a69 Mon Sep 17 00:00:00 2001 From: saper Date: Tue, 22 Jan 2013 21:53:18 +0100 Subject: [PATCH] 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 --- includes/db/DatabasePostgres.php | 2 ++ 1 file changed, 2 insertions(+) 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; } } -- 2.20.1