Added missing check for closed master backend reference into readwritesplit
The master DCB was checked for NULL-ness but the proper way is to check if the backend reference is closed. This will fix a debug assertion in addition to possibly preventing crashes.
This commit is contained in:
@ -2049,7 +2049,8 @@ static bool route_single_stmt(
|
|||||||
* Read stored master DCB pointer. If master is not set, routing must
|
* Read stored master DCB pointer. If master is not set, routing must
|
||||||
* be aborted
|
* be aborted
|
||||||
*/
|
*/
|
||||||
if ((master_dcb = rses->rses_master_ref->bref_dcb) == NULL)
|
if ((master_dcb = rses->rses_master_ref->bref_dcb) == NULL ||
|
||||||
|
BREF_IS_CLOSED(rses->rses_master_ref))
|
||||||
{
|
{
|
||||||
char* query_str = modutil_get_query(querybuf);
|
char* query_str = modutil_get_query(querybuf);
|
||||||
MXS_ERROR("Can't route %s:%s:\"%s\" to "
|
MXS_ERROR("Can't route %s:%s:\"%s\" to "
|
||||||
@ -2060,6 +2061,10 @@ static bool route_single_stmt(
|
|||||||
(query_str == NULL ? "(empty)" : query_str));
|
(query_str == NULL ? "(empty)" : query_str));
|
||||||
free(query_str);
|
free(query_str);
|
||||||
succp = false;
|
succp = false;
|
||||||
|
while(querybuf)
|
||||||
|
{
|
||||||
|
querybuf = GWBUF_CONSUME_ALL(querybuf);
|
||||||
|
}
|
||||||
goto retblock;
|
goto retblock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user