diff --git a/server/modules/monitor/galeramon.c b/server/modules/monitor/galeramon.c index e1ddc1217..f520b44aa 100644 --- a/server/modules/monitor/galeramon.c +++ b/server/modules/monitor/galeramon.c @@ -375,7 +375,8 @@ char *server_string; if(mysql_field_count(database->con) < 2) { mysql_free_result(result); - skygw_log_write(LE,"Error: Malformed result for \"SHOW STATUS LIKE 'wsrep_local_state'\""); + skygw_log_write(LE,"Error: Unexpected result for \"SHOW STATUS LIKE 'wsrep_local_state'\". Expected 2 columns." + " MySQL Version: %s",version_str); return; } @@ -389,6 +390,13 @@ char *server_string; if (mysql_query(database->con, "SHOW VARIABLES LIKE 'wsrep_sst_method'") == 0 && (result = mysql_store_result(database->con)) != NULL) { + if(mysql_field_count(database->con) < 2) + { + mysql_free_result(result); + skygw_log_write(LE,"Error: Unexpected result for \"SHOW VARIABLES LIKE 'wsrep_sst_method'\". Expected 2 columns." + " MySQL Version: %s",version_str); + return; + } while ((row = mysql_fetch_row(result))) { if (strncmp(row[1], "xtrabackup", 10) == 0) @@ -409,7 +417,8 @@ char *server_string; if(mysql_field_count(database->con) < 2) { mysql_free_result(result); - skygw_log_write(LE,"Error: Malformed result for \"SHOW STATUS LIKE 'wsrep_local_index'\""); + skygw_log_write(LE,"Error: Unexpected result for \"SHOW STATUS LIKE 'wsrep_local_index'\". Expected 2 columns." + " MySQL Version: %s",version_str); return; } diff --git a/server/modules/monitor/mmmon.c b/server/modules/monitor/mmmon.c index 970fd0d31..e70b3684a 100644 --- a/server/modules/monitor/mmmon.c +++ b/server/modules/monitor/mmmon.c @@ -370,7 +370,8 @@ char *server_string; if(mysql_field_count(database->con) != 1) { mysql_free_result(result); - skygw_log_write(LE,"Error: Malformed result for 'SELECT @@server_id'."); + skygw_log_write(LE,"Error: Unexpected result for 'SELECT @@server_id'. Expected 1 column." + " MySQL Version: %s",version_str); return; } @@ -403,8 +404,9 @@ char *server_string; if(mysql_field_count(database->con) < 42) { mysql_free_result(result); - skygw_log_write(LE,"Error: SHOW ALL SLAVES STATUS " - "returned less than the expected amount of rows."); + skygw_log_write(LE,"Error: \"SHOW ALL SLAVES STATUS\" " + "returned less than the expected amount of columns. Expected 42 columns" + " MySQL Version: %s",version_str); return; } @@ -450,8 +452,19 @@ char *server_string; if(mysql_field_count(database->con) < 40) { mysql_free_result(result); - skygw_log_write(LE,"Error: SHOW SLAVE STATUS " - "returned less than the expected amount of rows."); + + if(server_version < 5*10000 + 5*100) + { + skygw_log_write(LE,"Error: \"SHOW SLAVE STATUS\" " + " for MySQL 5.1 does not have master_server_id, replication tree cannot be resolved." + " MySQL Version: %s",version_str); + } + else + { + skygw_log_write(LE,"Error: \"SHOW SLAVE STATUS\" " + "returned less than the expected amount of columns. Expected 40 columns." + " MySQL Version: %s",version_str); + } return; } @@ -489,7 +502,8 @@ char *server_string; if(mysql_field_count(database->con) < 2) { mysql_free_result(result); - skygw_log_write(LE,"Error: Malformed result for \"SHOW GLOBAL VARIABLES LIKE 'read_only'\""); + skygw_log_write(LE,"Error: Unexpected result for \"SHOW GLOBAL VARIABLES LIKE 'read_only'\". Expected 2 columns." + " MySQL Version: %s",version_str); return; } diff --git a/server/modules/monitor/mysql_mon.c b/server/modules/monitor/mysql_mon.c index 4c5f57ab6..d2fa7acbd 100644 --- a/server/modules/monitor/mysql_mon.c +++ b/server/modules/monitor/mysql_mon.c @@ -411,7 +411,8 @@ char *server_string; if(mysql_field_count(database->con) != 1) { mysql_free_result(result); - skygw_log_write(LE,"Error: Malformed result for 'SELECT @@server_id'."); + skygw_log_write(LE,"Error: Unexpected result for \"SELECT @@server_id\". Expected 1 columns." + " MySQL Version: %s",version_str); return; } while ((row = mysql_fetch_row(result))) @@ -443,8 +444,9 @@ char *server_string; if(mysql_field_count(database->con) < 42) { mysql_free_result(result); - skygw_log_write(LE,"Error: SHOW ALL SLAVES STATUS " - "returned less than the expected amount of rows."); + skygw_log_write(LE,"Error: \"SHOW ALL SLAVES STATUS\" " + "returned less than the expected amount of columns. Expected 42 columns." + " MySQL Version: %s",version_str); return; } @@ -489,8 +491,18 @@ char *server_string; if(mysql_field_count(database->con) < 40) { mysql_free_result(result); - skygw_log_write(LE,"Error: SHOW SLAVE STATUS " - "returned less than the expected amount of rows."); + if(server_version < 5*10000 + 5*100) + { + skygw_log_write(LE,"Error: \"SHOW SLAVE STATUS\" " + " for MySQL 5.1 does not have master_server_id, replication tree cannot be resolved." + " MySQL Version: %s",version_str); + } + else + { + skygw_log_write(LE,"Error: \"SHOW SLAVE STATUS\" " + "returned less than the expected amount of columns. Expected 40 columns." + " MySQL Version: %s",version_str); + } return; } diff --git a/server/modules/monitor/ndbclustermon.c b/server/modules/monitor/ndbclustermon.c index ed218d43e..a5d0b2455 100644 --- a/server/modules/monitor/ndbclustermon.c +++ b/server/modules/monitor/ndbclustermon.c @@ -326,7 +326,8 @@ char *server_string; if(mysql_field_count(database->con) < 2) { mysql_free_result(result); - skygw_log_write(LE,"Error: Malformed result for \"SHOW STATUS LIKE 'Ndb_number_of_ready_data_nodes'\""); + skygw_log_write(LE,"Error: Unexpected result for \"SHOW STATUS LIKE 'Ndb_number_of_ready_data_nodes'\". Expected 2 columns." + " MySQL Version: %s",version_str); return; } @@ -345,7 +346,8 @@ char *server_string; if(mysql_field_count(database->con) < 2) { mysql_free_result(result); - skygw_log_write(LE,"Error: Malformed result for \"SHOW STATUS LIKE 'Ndb_cluster_node_id'\""); + skygw_log_write(LE,"Error: Unexpected result for \"SHOW STATUS LIKE 'Ndb_cluster_node_id'\". Expected 2 columns." + " MySQL Version: %s",version_str); return; }