Browse Source

Fixed an issue where STOP SLAVE generated a warning to error log which test case couldn't handle, fixed by checking for io slave killed before checking for network error

pull/374/head
Mikael Ronstrom 16 years ago
parent
commit
32b9defd3c
  1. 17
      sql/slave.cc

17
sql/slave.cc

@ -1219,6 +1219,8 @@ static int get_master_version_and_clock(MYSQL* mysql, Master_info* mi)
mi->clock_diff_with_master=
(long) (time((time_t*) 0) - strtoul(master_row[0], 0, 10));
}
else if (check_io_slave_killed(mi->io_thd, mi, NULL))
goto slave_killed_err;
else if (is_network_error(mysql_errno(mysql)))
{
mi->report(WARNING_LEVEL, mysql_errno(mysql),
@ -1271,7 +1273,9 @@ not always make sense; please check the manual before using it).";
}
else if (mysql_errno(mysql))
{
if (is_network_error(mysql_errno(mysql)))
if (check_io_slave_killed(mi->io_thd, mi, NULL))
goto slave_killed_err;
else if (is_network_error(mysql_errno(mysql)))
{
mi->report(WARNING_LEVEL, mysql_errno(mysql),
"Get master SERVER_ID failed with error: %s", mysql_error(mysql));
@ -1342,6 +1346,8 @@ be equal for the Statement-format replication to work";
goto err;
}
}
else if (check_io_slave_killed(mi->io_thd, mi, NULL))
goto slave_killed_err;
else if (is_network_error(mysql_errno(mysql)))
{
mi->report(WARNING_LEVEL, mysql_errno(mysql),
@ -1403,6 +1409,8 @@ be equal for the Statement-format replication to work";
goto err;
}
}
else if (check_io_slave_killed(mi->io_thd, mi, NULL))
goto slave_killed_err;
else if (is_network_error(mysql_errno(mysql)))
{
mi->report(WARNING_LEVEL, mysql_errno(mysql),
@ -1466,6 +1474,11 @@ network_err:
if (master_res)
mysql_free_result(master_res);
DBUG_RETURN(2);
slave_killed_err:
if (master_res)
mysql_free_result(master_res);
DBUG_RETURN(2);
}
/*
@ -2884,7 +2897,7 @@ connected:
if (ret == 1)
/* Fatal error */
goto err;
if (ret == 2)
{
if (check_io_slave_killed(mi->io_thd, mi, "Slave I/O thread killed"

Loading…
Cancel
Save