Merge "Produce monolog messages through kafka+avro"
[lhc/web/wiklou.git] / includes / db / Database.php
index aa8e2a0..1e54f55 100644 (file)
@@ -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 ) );