From: Aaron Schulz Date: Thu, 15 Jun 2017 08:25:17 +0000 (-0700) Subject: Set flush mode in DatabasePostgres::reportQueryError() X-Git-Tag: 1.31.0-rc.0~2965^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/%7B%7B%20url_for%28%27vote%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=b7aaa8cdbe04ac00fe85ece88b9249ee207ae1e2;p=lhc%2Fweb%2Fwiklou.git Set flush mode in DatabasePostgres::reportQueryError() Bug: T167927 Change-Id: Ib02608cf33d369939a9e587cebfc736336a1e979 --- diff --git a/includes/libs/rdbms/database/DatabasePostgres.php b/includes/libs/rdbms/database/DatabasePostgres.php index 57acd012f8..fd0956aed5 100644 --- a/includes/libs/rdbms/database/DatabasePostgres.php +++ b/includes/libs/rdbms/database/DatabasePostgres.php @@ -256,7 +256,10 @@ class DatabasePostgres extends Database { } /* Transaction stays in the ERROR state until rolled back */ if ( $this->mTrxLevel ) { - $this->rollback( __METHOD__ ); + // Throw away the transaction state, then raise the error as normal. + // Note that if this connection is managed by LBFactory, it's already expected + // that the other transactions LBFactory manages will be rolled back. + $this->rollback( __METHOD__, self::FLUSHING_INTERNAL ); } parent::reportQueryError( $error, $errno, $sql, $fname, false ); }