Fix error messages in sync_slaves

Fixed missing newlines in the error output printf calls of
sync_slaves. Changed the order of commands pers_02 executes to a more
correct way.
This commit is contained in:
Markus Mäkelä 2017-10-08 23:25:05 +03:00 committed by Johan Wikman
parent 489520a5c0
commit 621444e5e4
2 changed files with 7 additions and 5 deletions

View File

@ -1299,14 +1299,15 @@ static void wait_until_pos(MYSQL *mysql, int filenum, int pos)
void Mariadb_nodes::sync_slaves(int node)
{
if (this->nodes[node] == NULL)
if (this->nodes[node] == NULL && this->connect())
{
this->connect();
printf("Failed to connect to all nodes.\n");
return;
}
if (mysql_query(this->nodes[node], "SHOW MASTER STATUS"))
{
printf("Failed to execute SHOW MASTER STATUS: %s", mysql_error(this->nodes[node]));
printf("Failed to execute SHOW MASTER STATUS: %s\n", mysql_error(this->nodes[node]));
}
else
{
@ -1334,7 +1335,7 @@ void Mariadb_nodes::sync_slaves(int node)
}
else
{
printf("Cannot sync slaves, invalid binlog file name: %s", row[0]);
printf("Cannot sync slaves, invalid binlog file name: %s\n", row[0]);
}
}
mysql_free_result(res);

View File

@ -25,9 +25,10 @@ int main(int argc, char *argv[])
Test->create_connections(75, true, true, true, true);
Test->stop_timeout();
Test->repl->close_connections();
Test->repl->stop_nodes();
Test->repl->start_replication();
Test->repl->close_connections();
Test->repl->connect();
Test->repl->sync_slaves();
Test->set_timeout(60);