Added extra checks to readwritesplit

Added a check that the master server reference is actually in use before
doing anything with it. Also removed a false assertion.
This commit is contained in:
Markus Makela
2016-01-15 14:10:06 +02:00
parent c5947285cf
commit d41fe5b9c7

View File

@ -1675,6 +1675,8 @@ static qc_query_type_t is_read_tmp_table(
return type;
}
if (BREF_IS_IN_USE(router_cli_ses->rses_master_ref))
{
rses_prop_tmp = router_cli_ses->rses_properties[RSES_PROP_TYPE_TMPTABLES];
master_dcb = router_cli_ses->rses_master_ref->bref_dcb;
@ -1736,6 +1738,7 @@ static qc_query_type_t is_read_tmp_table(
}
free(tbl);
}
}
return qtype;
}
@ -2488,8 +2491,7 @@ static bool route_single_stmt(
#if defined(SS_EXTRA_DEBUG)
MXS_INFO("Found DCB for slave.");
#endif
ss_dassert(get_root_master_bref(rses) ==
rses->rses_master_ref);
atomic_add(&inst->stats.n_slave, 1);
}
else