diff --git a/maxscale-system-test/mariadb_nodes.cpp b/maxscale-system-test/mariadb_nodes.cpp index 1d45b99ce..acd683f74 100644 --- a/maxscale-system-test/mariadb_nodes.cpp +++ b/maxscale-system-test/mariadb_nodes.cpp @@ -1315,19 +1315,27 @@ void Mariadb_nodes::sync_slaves(int node) if (res) { MYSQL_ROW row = mysql_fetch_row(res); - if (row && row[node] && row[1]) + if (row && row[0] && row[1]) { - const char* file_suffix = strchr(row[node], '.') + 1; - int filenum = atoi(file_suffix); - int pos = atoi(row[1]); - - for (int i = 0; i < this->N; i++) + const char* file_suffix = strchr(row[0], '.'); + if (file_suffix) { - if (i != node) + file_suffix++; + int filenum = atoi(file_suffix); + int pos = atoi(row[1]); + + for (int i = 0; i < this->N; i++) { - wait_until_pos(this->nodes[i], filenum, pos); + if (i != node) + { + wait_until_pos(this->nodes[i], filenum, pos); + } } } + else + { + printf("Cannot sync slaves, invalid binlog file name: %s", row[0]); + } } mysql_free_result(res); }