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:
parent
e7fb2640d3
commit
d9eeb72198
@ -2049,7 +2049,8 @@ static bool route_single_stmt(
|
||||
* Read stored master DCB pointer. If master is not set, routing must
|
||||
* 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);
|
||||
MXS_ERROR("Can't route %s:%s:\"%s\" to "
|
||||
@ -2060,6 +2061,10 @@ static bool route_single_stmt(
|
||||
(query_str == NULL ? "(empty)" : query_str));
|
||||
free(query_str);
|
||||
succp = false;
|
||||
while(querybuf)
|
||||
{
|
||||
querybuf = GWBUF_CONSUME_ALL(querybuf);
|
||||
}
|
||||
goto retblock;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user