Added more error logging and fixed parsing of packets in readwritesplit
Readwritesplit tried to parse COM_PING packets which only have one byte of payload. This would cause the queries to fail to parsed.
This commit is contained in:
@ -195,6 +195,7 @@ static bool parse_query(GWBUF* querybuf)
|
|||||||
|
|
||||||
if (querybuf == NULL || query_is_parsed(querybuf))
|
if (querybuf == NULL || query_is_parsed(querybuf))
|
||||||
{
|
{
|
||||||
|
MXS_ERROR("Query is NULL (%p) or query is already parsed.", querybuf);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,6 +204,7 @@ static bool parse_query(GWBUF* querybuf)
|
|||||||
|
|
||||||
if (pi == NULL)
|
if (pi == NULL)
|
||||||
{
|
{
|
||||||
|
MXS_ERROR("Parsing info initialization failed.");
|
||||||
succp = false;
|
succp = false;
|
||||||
goto retblock;
|
goto retblock;
|
||||||
}
|
}
|
||||||
@ -215,6 +217,8 @@ static bool parse_query(GWBUF* querybuf)
|
|||||||
if (len < 1 || len >= ~((size_t) 0) - 1 || (query_str = (char *) malloc(len + 1)) == NULL)
|
if (len < 1 || len >= ~((size_t) 0) - 1 || (query_str = (char *) malloc(len + 1)) == NULL)
|
||||||
{
|
{
|
||||||
/** Free parsing info data */
|
/** Free parsing info data */
|
||||||
|
MXS_ERROR("Length (%lu) is 0 or query string allocation failed (%p). Buffer is %lu bytes.",
|
||||||
|
len, query_str, GWBUF_LENGTH(querybuf));
|
||||||
parsing_info_done(pi);
|
parsing_info_done(pi);
|
||||||
succp = false;
|
succp = false;
|
||||||
goto retblock;
|
goto retblock;
|
||||||
@ -229,6 +233,7 @@ static bool parse_query(GWBUF* querybuf)
|
|||||||
|
|
||||||
if (thd == NULL)
|
if (thd == NULL)
|
||||||
{
|
{
|
||||||
|
MXS_ERROR("THD creation failed.");
|
||||||
/** Free parsing info data */
|
/** Free parsing info data */
|
||||||
parsing_info_done(pi);
|
parsing_info_done(pi);
|
||||||
succp = false;
|
succp = false;
|
||||||
|
@ -2178,7 +2178,7 @@ static bool route_single_stmt(
|
|||||||
* Check if this is a LOAD DATA LOCAL INFILE query. If so, send all queries
|
* Check if this is a LOAD DATA LOCAL INFILE query. If so, send all queries
|
||||||
* to the master until the last, empty packet arrives.
|
* to the master until the last, empty packet arrives.
|
||||||
*/
|
*/
|
||||||
if (!rses->rses_load_active)
|
if (!rses->rses_load_active && packet_type == MYSQL_COM_QUERY)
|
||||||
{
|
{
|
||||||
qc_query_op_t queryop = qc_get_operation(querybuf);
|
qc_query_op_t queryop = qc_get_operation(querybuf);
|
||||||
if (queryop == QUERY_OP_LOAD)
|
if (queryop == QUERY_OP_LOAD)
|
||||||
|
Reference in New Issue
Block a user