Added new general error message
Added new general error message Added Slave_IO_Running: No Slave_SQL_Running: No when slave is stopped
This commit is contained in:
@ -1254,9 +1254,9 @@ const char *mysql_error_msg = NULL;
|
|||||||
const char *mysql_state = NULL;
|
const char *mysql_state = NULL;
|
||||||
GWBUF *errbuf = NULL;
|
GWBUF *errbuf = NULL;
|
||||||
|
|
||||||
mysql_errno = 2003;
|
mysql_errno = 1064;
|
||||||
mysql_error_msg = "An errorr occurred ...";
|
mysql_error_msg = "An errorr occurred ...";
|
||||||
mysql_state = "HY000";
|
mysql_state = "42000";
|
||||||
|
|
||||||
field_count = 0xff;
|
field_count = 0xff;
|
||||||
gw_mysql_set_byte2(mysql_err, mysql_errno);
|
gw_mysql_set_byte2(mysql_err, mysql_errno);
|
||||||
|
|||||||
@ -154,7 +154,7 @@ blr_slave_request(ROUTER_INSTANCE *router, ROUTER_SLAVE *slave, GWBUF *queue)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
blr_send_custom_error(slave->dcb, 1, 0,
|
blr_send_custom_error(slave->dcb, 1, 0,
|
||||||
"MySQL command not supported by the binlog router.");
|
"You have an error in your SQL syntax; Check the syntax the MaxScale binlog router accepts.");
|
||||||
LOGIF(LE, (skygw_log_write(
|
LOGIF(LE, (skygw_log_write(
|
||||||
LOGFILE_ERROR,
|
LOGFILE_ERROR,
|
||||||
"Unexpected MySQL Command (%d) received from slave",
|
"Unexpected MySQL Command (%d) received from slave",
|
||||||
@ -516,7 +516,7 @@ int query_len;
|
|||||||
LOGIF(LE, (skygw_log_write(
|
LOGIF(LE, (skygw_log_write(
|
||||||
LOGFILE_ERROR, "Unexpected query from slave server %s", query_text)));
|
LOGFILE_ERROR, "Unexpected query from slave server %s", query_text)));
|
||||||
free(query_text);
|
free(query_text);
|
||||||
blr_slave_send_error(router, slave, "Unexpected SQL query received from slave.");
|
blr_slave_send_error(router, slave, "You have an error in your SQL syntax; Check the syntax the MaxScale binlog router accepts.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -572,9 +572,8 @@ int len;
|
|||||||
data[3] = 1; // Sequence id
|
data[3] = 1; // Sequence id
|
||||||
// Payload
|
// Payload
|
||||||
data[4] = 0xff; // Error indicator
|
data[4] = 0xff; // Error indicator
|
||||||
data[5] = 0; // Error Code
|
encode_value(&data[5], 1064, 16);// Error Code
|
||||||
data[6] = 0; // Error Code
|
strncpy((char *)&data[7], "#42000", 6);
|
||||||
strncpy((char *)&data[7], "#00000", 6);
|
|
||||||
memcpy(&data[13], msg, strlen(msg)); // Error Message
|
memcpy(&data[13], msg, strlen(msg)); // Error Message
|
||||||
slave->dcb->func.write(slave->dcb, pkt);
|
slave->dcb->func.write(slave->dcb, pkt);
|
||||||
}
|
}
|
||||||
@ -909,13 +908,19 @@ char *dyn_column=NULL;
|
|||||||
strncpy((char *)ptr, column, col_len); // Result string
|
strncpy((char *)ptr, column, col_len); // Result string
|
||||||
ptr += col_len;
|
ptr += col_len;
|
||||||
|
|
||||||
|
if (router->master_state != BLRM_SLAVE_STOPPED)
|
||||||
strcpy(column, "Yes");
|
strcpy(column, "Yes");
|
||||||
|
else
|
||||||
|
strcpy(column, "No");
|
||||||
col_len = strlen(column);
|
col_len = strlen(column);
|
||||||
*ptr++ = col_len; // Length of result string
|
*ptr++ = col_len; // Length of result string
|
||||||
strncpy((char *)ptr, column, col_len); // Result string
|
strncpy((char *)ptr, column, col_len); // Result string
|
||||||
ptr += col_len;
|
ptr += col_len;
|
||||||
|
|
||||||
|
if (router->master_state != BLRM_SLAVE_STOPPED)
|
||||||
strcpy(column, "Yes");
|
strcpy(column, "Yes");
|
||||||
|
else
|
||||||
|
strcpy(column, "No");
|
||||||
col_len = strlen(column);
|
col_len = strlen(column);
|
||||||
*ptr++ = col_len; // Length of result string
|
*ptr++ = col_len; // Length of result string
|
||||||
strncpy((char *)ptr, column, col_len); // Result string
|
strncpy((char *)ptr, column, col_len); // Result string
|
||||||
@ -1054,7 +1059,16 @@ char *dyn_column=NULL;
|
|||||||
*ptr++ = 0xfb; // NULL value
|
*ptr++ = 0xfb; // NULL value
|
||||||
|
|
||||||
/* Slave_Running_State */
|
/* Slave_Running_State */
|
||||||
|
if (router->master_state == BLRM_SLAVE_STOPPED)
|
||||||
|
strcpy(column, "Slave stopped");
|
||||||
|
else if (!router->m_errno)
|
||||||
strcpy(column, "Slave running");
|
strcpy(column, "Slave running");
|
||||||
|
else {
|
||||||
|
if (router->master_state < BLRM_BINLOGDUMP)
|
||||||
|
strcpy(column, "Registering");
|
||||||
|
else
|
||||||
|
strcpy(column, "Error");
|
||||||
|
}
|
||||||
col_len = strlen(column);
|
col_len = strlen(column);
|
||||||
*ptr++ = col_len; // Length of result string
|
*ptr++ = col_len; // Length of result string
|
||||||
strncpy((char *)ptr, column, col_len); // Result string
|
strncpy((char *)ptr, column, col_len); // Result string
|
||||||
|
|||||||
Reference in New Issue
Block a user