From: jenkins-bot Date: Fri, 6 Apr 2018 18:25:38 +0000 (+0000) Subject: Merge "maintenance: Fix autopatrols typo in deleteAutoPatrolLogs" X-Git-Tag: 1.31.0-rc.0~177 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=3c8b7ee4a144165b972f4b8d60a7916172fa0a1c;hp=810614c886c7871737b1ae832fdc856629adb986;p=lhc%2Fweb%2Fwiklou.git Merge "maintenance: Fix autopatrols typo in deleteAutoPatrolLogs" --- diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index 5336b257d4..c924e4e020 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -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(); diff --git a/tests/phpunit/maintenance/DumpTestCase.php b/tests/phpunit/maintenance/DumpTestCase.php index c872993adf..9b90bfe671 100644 --- a/tests/phpunit/maintenance/DumpTestCase.php +++ b/tests/phpunit/maintenance/DumpTestCase.php @@ -8,6 +8,7 @@ use MediaWikiLangTestCase; use Page; use User; use XMLReader; +use MWException; /** * Base TestCase for dumps