From b7aaa8cdbe04ac00fe85ece88b9249ee207ae1e2 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 15 Jun 2017 01:25:17 -0700 Subject: [PATCH] Set flush mode in DatabasePostgres::reportQueryError() Bug: T167927 Change-Id: Ib02608cf33d369939a9e587cebfc736336a1e979 --- includes/libs/rdbms/database/DatabasePostgres.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 ); } -- 2.20.1