From b89a4d32d17cdd5daa4e4fdc43757f8fa87d4d83 Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Thu, 9 Dec 2010 10:04:38 +0000 Subject: [PATCH] Improved the detection of MySQL Slave status SVN:trunk[1023] --- core/cmdbsource.class.inc.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/core/cmdbsource.class.inc.php b/core/cmdbsource.class.inc.php index 4b78f0886..cf91820f6 100644 --- a/core/cmdbsource.class.inc.php +++ b/core/cmdbsource.class.inc.php @@ -562,19 +562,21 @@ class CMDBSource { return false; } - if ($aRow['Slave_IO_Running'] != 'Yes') - { - return false; - } if (!isset($aRow['Slave_SQL_Running'])) { return false; } - if ($aRow['Slave_SQL_Running'] != 'Yes') + + // If at least one slave thread is running, then we consider that the slave is enabled + if ($aRow['Slave_IO_Running'] == 'Yes') { - return false; + return true; } - return true; + if ($aRow['Slave_SQL_Running'] == 'Yes') + { + return true; + } + return false; } }