X-Git-Url: https://git.cyclocoop.org/admin/?a=blobdiff_plain;f=includes%2Fdb%2FDatabase.php;h=1e54f55457a0da3cfe08fbbc6c6236261a3b9386;hb=73f52a6c0c913c927cc32bcbe3558c49f57f3350;hp=aa8e2a002858cbdbe1643546362c6124f800fb33;hpb=6c4601cfbde285ece65aecddcdad2585be418521;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/db/Database.php b/includes/db/Database.php index aa8e2a0028..1e54f55457 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -58,7 +58,6 @@ abstract class DatabaseBase implements IDatabase { protected $mSchema; protected $mFlags; protected $mForeign; - protected $mErrorCount = 0; protected $mLBInfo = array(); protected $mDefaultBigSelects = null; protected $mSchemaVars = false; @@ -259,15 +258,6 @@ abstract class DatabaseBase implements IDatabase { 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 ); - } - /** * Get/set the table prefix. * @param string $prefix The table prefix to set, or omitted to leave it unchanged. @@ -1111,8 +1101,6 @@ abstract class DatabaseBase implements IDatabase { * @throws DBQueryError */ public function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = false ) { - ++$this->mErrorCount; - if ( $this->ignoreErrors() || $tempIgnore ) { wfDebug( "SQL ERROR (ignored): $error\n" ); } else { @@ -1901,9 +1889,6 @@ abstract class DatabaseBase implements IDatabase { * This causes a multi-row INSERT on DBMSs that support it. The keys in * each subarray must be identical to each other, and in the same order. * - * Usually throws a DBQueryError on failure. If errors are explicitly ignored, - * returns success. - * * $options is an array of options, with boolean options encoded as values * with numeric keys, in the same style as $options in * DatabaseBase::select(). Supported options are: @@ -1919,6 +1904,9 @@ abstract class DatabaseBase implements IDatabase { * @param string $fname Calling function name (use __METHOD__) for logs/profiling * @param array $options Array of options * + * @throws DBQueryError Usually throws a DBQueryError on failure. If errors are explicitly ignored, + * returns success. + * * @return bool */ public function insert( $table, $a, $fname = __METHOD__, $options = array() ) { @@ -3238,9 +3226,6 @@ abstract class DatabaseBase implements IDatabase { $retVal = call_user_func_array( $function, $args ); break; } catch ( DBQueryError $e ) { - $error = $this->lastError(); - $errno = $this->lastErrno(); - $sql = $this->lastQuery(); if ( $this->wasDeadlock() ) { // Retry after a randomized delay usleep( mt_rand( self::DEADLOCK_DELAY_MIN, self::DEADLOCK_DELAY_MAX ) );