Commit 10d4a951 authored by Mikael Ronstrom's avatar Mikael Ronstrom

Fixed an issue where STOP SLAVE generated a warning to error log which test...

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
parent b2439d5c
...@@ -1219,6 +1219,8 @@ static int get_master_version_and_clock(MYSQL* mysql, Master_info* mi) ...@@ -1219,6 +1219,8 @@ static int get_master_version_and_clock(MYSQL* mysql, Master_info* mi)
mi->clock_diff_with_master= mi->clock_diff_with_master=
(long) (time((time_t*) 0) - strtoul(master_row[0], 0, 10)); (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))) else if (is_network_error(mysql_errno(mysql)))
{ {
mi->report(WARNING_LEVEL, 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)."; ...@@ -1271,7 +1273,9 @@ not always make sense; please check the manual before using it).";
} }
else if (mysql_errno(mysql)) 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), mi->report(WARNING_LEVEL, mysql_errno(mysql),
"Get master SERVER_ID failed with error: %s", mysql_error(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"; ...@@ -1342,6 +1346,8 @@ be equal for the Statement-format replication to work";
goto err; 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))) else if (is_network_error(mysql_errno(mysql)))
{ {
mi->report(WARNING_LEVEL, mysql_errno(mysql), mi->report(WARNING_LEVEL, mysql_errno(mysql),
...@@ -1403,6 +1409,8 @@ be equal for the Statement-format replication to work"; ...@@ -1403,6 +1409,8 @@ be equal for the Statement-format replication to work";
goto err; 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))) else if (is_network_error(mysql_errno(mysql)))
{ {
mi->report(WARNING_LEVEL, mysql_errno(mysql), mi->report(WARNING_LEVEL, mysql_errno(mysql),
...@@ -1466,6 +1474,11 @@ when it try to get the value of TIME_ZONE global variable from master."; ...@@ -1466,6 +1474,11 @@ when it try to get the value of TIME_ZONE global variable from master.";
if (master_res) if (master_res)
mysql_free_result(master_res); mysql_free_result(master_res);
DBUG_RETURN(2); DBUG_RETURN(2);
slave_killed_err:
if (master_res)
mysql_free_result(master_res);
DBUG_RETURN(2);
} }
/* /*
...@@ -2884,7 +2897,7 @@ pthread_handler_t handle_slave_io(void *arg) ...@@ -2884,7 +2897,7 @@ pthread_handler_t handle_slave_io(void *arg)
if (ret == 1) if (ret == 1)
/* Fatal error */ /* Fatal error */
goto err; goto err;
if (ret == 2) if (ret == 2)
{ {
if (check_io_slave_killed(mi->io_thd, mi, "Slave I/O thread killed" if (check_io_slave_killed(mi->io_thd, mi, "Slave I/O thread killed"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment