Merge "maintenance: Fix autopatrols typo in deleteAutoPatrolLogs"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 6 Apr 2018 18:25:38 +0000 (18:25 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 6 Apr 2018 18:25:38 +0000 (18:25 +0000)
includes/libs/rdbms/database/Database.php
tests/phpunit/maintenance/DumpTestCase.php

index 5336b25..c924e4e 100644 (file)
@@ -1070,6 +1070,9 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
        public function query( $sql, $fname = __METHOD__, $tempIgnore = false ) {
                $this->assertTransactionStatus( $sql, $fname );
 
+               # Avoid fatals if close() was called
+               $this->assertOpen();
+
                $priorWritesPending = $this->writesOrCallbacksPending();
                $this->lastQuery = $sql;
 
@@ -1120,9 +1123,6 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                        $this->queryLogger->debug( "{$this->dbName} {$commentedSql}" );
                }
 
-               # Avoid fatals if close() was called
-               $this->assertOpen();
-
                # Send the query to the server and fetch any corresponding errors
                $ret = $this->doProfiledQuery( $sql, $commentedSql, $isNonTempWrite, $fname );
                $lastError = $this->lastError();
index c872993..9b90bfe 100644 (file)
@@ -8,6 +8,7 @@ use MediaWikiLangTestCase;
 use Page;
 use User;
 use XMLReader;
+use MWException;
 
 /**
  * Base TestCase for dumps