Merge "Set flush mode in DatabasePostgres::reportQueryError()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 15 Jun 2017 18:14:02 +0000 (18:14 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 15 Jun 2017 18:14:02 +0000 (18:14 +0000)
includes/libs/rdbms/database/DatabasePostgres.php

index 57acd01..fd0956a 100644 (file)
@@ -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 );
        }