From: Brion Vibber Date: Sun, 13 Mar 2005 06:43:33 +0000 (+0000) Subject: fix deadlock loop X-Git-Tag: 1.5.0alpha1~638 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=0a5bd473fda045bffb4f91070982f13177086208;p=lhc%2Fweb%2Fwiklou.git fix deadlock loop --- diff --git a/includes/Database.php b/includes/Database.php index ae035683b7..23645514a3 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -1217,7 +1217,7 @@ class Database { $this->query( 'BEGIN', $myFname ); $args = func_get_args(); $function = array_shift( $args ); - $oldIgnore = $dbw->ignoreErrors( true ); + $oldIgnore = $this->ignoreErrors( true ); $tries = DEADLOCK_TRIES; if ( is_array( $function ) ) { $fname = $function[0]; @@ -1231,14 +1231,14 @@ class Database { $sql = $this->lastQuery(); if ( $errno ) { - if ( $dbw->wasDeadlock() ) { + if ( $this->wasDeadlock() ) { # Retry usleep( mt_rand( DEADLOCK_DELAY_MIN, DEADLOCK_DELAY_MAX ) ); } else { - $dbw->reportQueryError( $error, $errno, $sql, $fname ); + $this->reportQueryError( $error, $errno, $sql, $fname ); } } - } while( $dbw->wasDeadlock && --$tries > 0 ); + } while( $this->wasDeadlock() && --$tries > 0 ); $this->ignoreErrors( $oldIgnore ); if ( $tries <= 0 ) { $this->query( 'ROLLBACK', $myFname );