MXS-3306 Make binary_ps test work with more servers than 4
When doing the match, the test only checked slaves 1 - 3. If the test is run after a heavy test there will also be slaves 4 - 14.
This commit is contained in:
@ -54,14 +54,25 @@ int main(int argc, char** argv)
|
|||||||
test.add_result(mysql_stmt_execute(stmt), "Failed to execute");
|
test.add_result(mysql_stmt_execute(stmt), "Failed to execute");
|
||||||
test.add_result(mysql_stmt_bind_result(stmt, bind), "Failed to bind result");
|
test.add_result(mysql_stmt_bind_result(stmt, bind), "Failed to bind result");
|
||||||
test.add_result(mysql_stmt_fetch(stmt), "Failed to fetch result");
|
test.add_result(mysql_stmt_fetch(stmt), "Failed to fetch result");
|
||||||
test.add_result(strcmp(buffer,
|
std::string server_ids;
|
||||||
server_id[1]) && strcmp(buffer, server_id[2]) && strcmp(buffer, server_id[3]),
|
bool found = false;
|
||||||
"Expected one of the slave server IDs (%s, %s or %s), not '%s'",
|
for (int i = 1; i < test.repl->N; ++i)
|
||||||
server_id[1],
|
{
|
||||||
server_id[2],
|
if (strcmp(buffer, server_id[i]) == 0)
|
||||||
server_id[3],
|
{
|
||||||
buffer);
|
found = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!server_ids.empty())
|
||||||
|
{
|
||||||
|
server_ids += ", ";
|
||||||
|
}
|
||||||
|
|
||||||
|
server_ids += server_id[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
test.expect(found, "Expected one of the slave server IDs (%s), not '%s'",
|
||||||
|
server_ids.c_str(), buffer);
|
||||||
|
|
||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user