From d8ac0467dedb496083994812ddb94fac398550d8 Mon Sep 17 00:00:00 2001 From: MassimilianoPinto Date: Thu, 26 Jun 2014 14:14:37 +0200 Subject: [PATCH] Added comments for SHOW SLAVE STATUS Added comments for SHOW SLAVE STATUS --- server/modules/monitor/mysql_mon.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/modules/monitor/mysql_mon.c b/server/modules/monitor/mysql_mon.c index d11e2c3de..e57a4bdfa 100644 --- a/server/modules/monitor/mysql_mon.c +++ b/server/modules/monitor/mysql_mon.c @@ -325,7 +325,6 @@ monitorDatabase(MYSQL_MONITOR *handle, MONITOR_SERVERS *database) MYSQL_ROW row; MYSQL_RES *result; int num_fields; -int ismaster = 0; int isslave = 0; char *uname = handle->defaultUser; char *passwd = handle->defaultPasswd; @@ -439,9 +438,12 @@ static int conn_err_count; num_fields = mysql_num_fields(result); while ((row = mysql_fetch_row(result))) { + /* get Slave_IO_Running and Slave_SQL_Running values*/ if (strncmp(row[12], "Yes", 3) == 0 && strncmp(row[13], "Yes", 3) == 0) { isslave += 1; + + /* get Master_Server_Id values */ master_id = atoi(row[41]); if (master_id == 0) master_id = -1; @@ -467,9 +469,12 @@ static int conn_err_count; num_fields = mysql_num_fields(result); while ((row = mysql_fetch_row(result))) { + /* get Slave_IO_Running and Slave_SQL_Running values*/ if (strncmp(row[10], "Yes", 3) == 0 && strncmp(row[11], "Yes", 3) == 0) { isslave = 1; + + /* get Master_Server_Id values */ master_id = atoi(row[39]); if (master_id == 0) master_id = -1;