var $mTablePrefix;
var $mFlags;
var $mTrxLevel = 0;
+ var $mErrorCount = 0;
/**#@-*/
#------------------------------------------------------------------------------
return wfSetVar( $this->mTrxLevel, $level );
}
+ /**
+ * Number of errors logged, only useful when errors are ignored
+ */
+ function errorCount( $count = NULL ) {
+ return wfSetVar( $this->mErrorCount, $count );
+ }
+
/**#@+
* Get function
*/
$ret = $this->doQuery( $commentedSql );
# Try reconnecting if the connection was lost
- if ( false === $ret && $this->lastErrno() == 2013 ) {
+ if ( false === $ret && ( $this->lastErrno() == 2013 || $this->lastErrno() == 2006 ) ) {
# Transaction is gone, like it or not
$this->mTrxLevel = 0;
wfDebug( "Connection lost, reconnecting...\n" );
}
if ( false === $ret ) {
- # Automatic reconnect
$this->reportQueryError( $this->lastError(), $this->lastErrno(), $sql, $fname, $tempIgnore );
}
global $wgCommandLineMode, $wgFullyInitialised;
# Ignore errors during error handling to avoid infinite recursion
$ignore = $this->ignoreErrors( true );
+ $this->mErrorCount ++;
if( $ignore || $tempIgnore ) {
wfDebug("SQL ERROR (ignored): " . $error . "\n");