Fixed debug assertion causing a crash in readwritesplit

A debug assertion in the readwritesplit would always fail when the master DCB
was NULL. This was caused by the fact that the debug assertion assumes that the
pointer that is passed to it is a valid pointer.
This commit is contained in:
Markus Makela
2016-01-28 10:46:55 +02:00
parent 087ab202c2
commit e6d18f0b66

View File

@ -2052,7 +2052,6 @@ static bool route_single_stmt(
if ((master_dcb = rses->rses_master_ref->bref_dcb) == NULL)
{
char* query_str = modutil_get_query(querybuf);
CHK_DCB(master_dcb);
MXS_ERROR("Can't route %s:%s:\"%s\" to "
"backend server. Session doesn't have a Master "
"node",
@ -2064,6 +2063,7 @@ static bool route_single_stmt(
goto retblock;
}
CHK_DCB(master_dcb);
packet = GWBUF_DATA(querybuf);
packet_len = gw_mysql_get_byte3(packet);