[MediaWiki-commits] [Gerrit] Database: Remove unused errorCount() method - change (mediawiki/core)

2015-09-18 Thread PleaseStand (Code Review)
PleaseStand has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/239324

Change subject: Database: Remove unused errorCount() method
..

Database: Remove unused errorCount() method

Change-Id: Ie26a5f5ef7dc5619d9db38d3eb6b7af3e6592aff
---
M RELEASE-NOTES-1.26
M includes/db/Database.php
M includes/db/DatabaseOracle.php
3 files changed, 1 insertion(+), 26 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/24/239324/1

diff --git a/RELEASE-NOTES-1.26 b/RELEASE-NOTES-1.26
index 4463c78..13239de 100644
--- a/RELEASE-NOTES-1.26
+++ b/RELEASE-NOTES-1.26
@@ -187,6 +187,7 @@
 * Watchlist tokens, SpecialResetTokens, and User::getTokenFromOption()
   are deprecated. Applications using those can work via the OAuth
   extension instead. New tokens types should not be added.
+* DatabaseBase::errorCount() was removed (unused).
 
 == Compatibility ==
 
diff --git a/includes/db/Database.php b/includes/db/Database.php
index 4d1b1c0..4ceebaf 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -58,7 +58,6 @@
protected $mSchema;
protected $mFlags;
protected $mForeign;
-   protected $mErrorCount = 0;
protected $mLBInfo = array();
protected $mDefaultBigSelects = null;
protected $mSchemaVars = false;
@@ -257,15 +256,6 @@
 */
public function trxTimestamp() {
return $this->mTrxLevel ? $this->mTrxTimestamp : null;
-   }
-
-   /**
-* Get/set the number of errors logged. Only useful when errors are 
ignored
-* @param int $count The count to set, or omitted to leave it unchanged.
-* @return int The error count
-*/
-   public function errorCount( $count = null ) {
-   return wfSetVar( $this->mErrorCount, $count );
}
 
/**
@@ -,8 +1101,6 @@
 * @throws DBQueryError
 */
public function reportQueryError( $error, $errno, $sql, $fname, 
$tempIgnore = false ) {
-   ++$this->mErrorCount;
-
if ( $this->ignoreErrors() || $tempIgnore ) {
wfDebug( "SQL ERROR (ignored): $error\n" );
} else {
diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php
index 081174a..87c3164 100644
--- a/includes/db/DatabaseOracle.php
+++ b/includes/db/DatabaseOracle.php
@@ -971,20 +971,6 @@
return $valuedata;
}
 
-   function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = 
false ) {
-   # Ignore errors during error handling to avoid infinite
-   # recursion
-   $ignore = $this->ignoreErrors( true );
-   ++$this->mErrorCount;
-
-   if ( $ignore || $tempIgnore ) {
-   wfDebug( "SQL ERROR (ignored): $error\n" );
-   $this->ignoreErrors( $ignore );
-   } else {
-   throw new DBQueryError( $this, $error, $errno, $sql, 
$fname );
-   }
-   }
-
/**
 * @return string Wikitext of a link to the server software's web site
 */

-- 
To view, visit https://gerrit.wikimedia.org/r/239324
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie26a5f5ef7dc5619d9db38d3eb6b7af3e6592aff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: PleaseStand 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Database: Remove unused errorCount() method - change (mediawiki/core)

2015-09-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Database: Remove unused errorCount() method
..


Database: Remove unused errorCount() method

Also removed the protected $mErrorCount property used by this method.

Also removed DatabaseOracle::reportQueryError(). After removing its use
of $mErrorCount and applying relevant changes from 419221e4a71b ("Fixed
bug where catching DB errors left ignoreErrors() on"), the only effect
would be that, like for the other DB types, query errors would be
logged using wfLogDBError().

Change-Id: Ie26a5f5ef7dc5619d9db38d3eb6b7af3e6592aff
---
M RELEASE-NOTES-1.26
M includes/db/Database.php
M includes/db/DatabaseOracle.php
3 files changed, 1 insertion(+), 26 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/RELEASE-NOTES-1.26 b/RELEASE-NOTES-1.26
index 4463c78..13239de 100644
--- a/RELEASE-NOTES-1.26
+++ b/RELEASE-NOTES-1.26
@@ -187,6 +187,7 @@
 * Watchlist tokens, SpecialResetTokens, and User::getTokenFromOption()
   are deprecated. Applications using those can work via the OAuth
   extension instead. New tokens types should not be added.
+* DatabaseBase::errorCount() was removed (unused).
 
 == Compatibility ==
 
diff --git a/includes/db/Database.php b/includes/db/Database.php
index 4d1b1c0..4ceebaf 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -58,7 +58,6 @@
protected $mSchema;
protected $mFlags;
protected $mForeign;
-   protected $mErrorCount = 0;
protected $mLBInfo = array();
protected $mDefaultBigSelects = null;
protected $mSchemaVars = false;
@@ -257,15 +256,6 @@
 */
public function trxTimestamp() {
return $this->mTrxLevel ? $this->mTrxTimestamp : null;
-   }
-
-   /**
-* Get/set the number of errors logged. Only useful when errors are 
ignored
-* @param int $count The count to set, or omitted to leave it unchanged.
-* @return int The error count
-*/
-   public function errorCount( $count = null ) {
-   return wfSetVar( $this->mErrorCount, $count );
}
 
/**
@@ -,8 +1101,6 @@
 * @throws DBQueryError
 */
public function reportQueryError( $error, $errno, $sql, $fname, 
$tempIgnore = false ) {
-   ++$this->mErrorCount;
-
if ( $this->ignoreErrors() || $tempIgnore ) {
wfDebug( "SQL ERROR (ignored): $error\n" );
} else {
diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php
index 081174a..87c3164 100644
--- a/includes/db/DatabaseOracle.php
+++ b/includes/db/DatabaseOracle.php
@@ -971,20 +971,6 @@
return $valuedata;
}
 
-   function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = 
false ) {
-   # Ignore errors during error handling to avoid infinite
-   # recursion
-   $ignore = $this->ignoreErrors( true );
-   ++$this->mErrorCount;
-
-   if ( $ignore || $tempIgnore ) {
-   wfDebug( "SQL ERROR (ignored): $error\n" );
-   $this->ignoreErrors( $ignore );
-   } else {
-   throw new DBQueryError( $this, $error, $errno, $sql, 
$fname );
-   }
-   }
-
/**
 * @return string Wikitext of a link to the server software's web site
 */

-- 
To view, visit https://gerrit.wikimedia.org/r/239324
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie26a5f5ef7dc5619d9db38d3eb6b7af3e6592aff
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: PleaseStand 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Parent5446 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits