added checks in blr_stop_slave()

errorReply sets mysql_errno into router struct
blr_slave_send_slave_status displays mysql errno
added checks in blr_stop_slave()
This commit is contained in:
MassimilianoPinto
2015-06-05 17:37:05 +02:00
parent 2a15e6e774
commit 945e2f8132
4 changed files with 46 additions and 5 deletions

View File

@ -472,7 +472,17 @@ char query[128];
break;
case BLRM_MUUID:
{
char *val = blr_extract_column(buf, 2);
char *key;
char *val = NULL;
key = blr_extract_column(buf, 1);
if (key && strlen(key))
val = blr_extract_column(buf, 2);
if (key)
free(key);
if (router->master_uuid)
free(router->master_uuid);
router->master_uuid = val;
// Response to the SERVER_UUID, should be stored
@ -907,6 +917,9 @@ static REP_HEADER phdr;
phdr = hdr;
if (hdr.ok == 0)
{
/* set mysql errno to 0 */
router->m_errno = 0;
/*
* First check that the checksum we calculate matches the
* checksum in the packet we received.
@ -1080,6 +1093,11 @@ static REP_HEADER phdr;
}
else
{
unsigned long mysql_errno = extract_field(ptr+5, 16);
/* set mysql_errno */
router->m_errno = mysql_errno;
LOGIF(LE,(skygw_log_write(LOGFILE_ERROR,
"Error packet in binlog stream.%s @ %d.",
router->binlog_name,