Added more error logging.
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user