Merge "Database: Avoid internal use of ignoreErrors()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 29 Dec 2016 20:38:26 +0000 (20:38 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 29 Dec 2016 20:38:26 +0000 (20:38 +0000)
includes/libs/rdbms/database/Database.php
includes/libs/rdbms/database/DatabasePostgres.php

index b9beac8..69cf1ac 100644 (file)
@@ -1419,9 +1419,8 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                }
 
                $table = $this->tableName( $table );
-               $old = $this->ignoreErrors( true );
-               $res = $this->query( "SELECT 1 FROM $table LIMIT 1", $fname );
-               $this->ignoreErrors( $old );
+               $ignoreErrors = true;
+               $res = $this->query( "SELECT 1 FROM $table LIMIT 1", $fname, $ignoreErrors );
 
                return (bool)$res;
        }
index cd02177..42113b0 100644 (file)
@@ -243,9 +243,7 @@ class DatabasePostgres extends Database {
                }
                /* Transaction stays in the ERROR state until rolled back */
                if ( $this->mTrxLevel ) {
-                       $ignore = $this->ignoreErrors( true );
                        $this->rollback( __METHOD__ );
-                       $this->ignoreErrors( $ignore );
                }
                parent::reportQueryError( $error, $errno, $sql, $fname, false );
        }