X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2Frdbms%2Fdatabase%2FDatabaseMysqlBase.php;h=315c9eb0ecdb5248ff77ad98deafc4cd08c884ed;hb=4255b4fa6dd303f2c2db65ff67f02c2c561e4821;hp=286d65881ec4cc7071bb786ddd7ae9e98f2e81f7;hpb=b33bc40e4026ba286569ab1b5baf609844f34a50;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/rdbms/database/DatabaseMysqlBase.php b/includes/libs/rdbms/database/DatabaseMysqlBase.php index 286d65881e..315c9eb0ec 100644 --- a/includes/libs/rdbms/database/DatabaseMysqlBase.php +++ b/includes/libs/rdbms/database/DatabaseMysqlBase.php @@ -749,6 +749,7 @@ abstract class DatabaseMysqlBase extends Database { protected function getLagFromSlaveStatus() { $res = $this->query( 'SHOW SLAVE STATUS', __METHOD__ ); $row = $res ? $res->fetchObject() : false; + // If the server is not replicating, there will be no row if ( $row && strval( $row->Seconds_Behind_Master ) !== '' ) { return intval( $row->Seconds_Behind_Master ); } @@ -856,7 +857,8 @@ abstract class DatabaseMysqlBase extends Database { // Note: this would use "TIMESTAMPDIFF(MICROSECOND,ts,UTC_TIMESTAMP(6))" but the // percision field is not supported in MySQL <= 5.5. $res = $this->query( - "SELECT ts FROM heartbeat.heartbeat WHERE $whereSQL ORDER BY ts DESC LIMIT 1" + "SELECT ts FROM heartbeat.heartbeat WHERE $whereSQL ORDER BY ts DESC LIMIT 1", + __METHOD__ ); $row = $res ? $res->fetchObject() : false; } finally {