Add missing readwritesplit initialization

The wait_gtid_state variable was not initialized. In addition to that, the
routing would continue with a NULL buffer in some cases.
This commit is contained in:
Markus Mäkelä 2018-03-14 14:27:07 +02:00
parent 9f5d2244ea
commit 8d7bff932b
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -734,6 +734,8 @@ RWSplitSession::RWSplitSession(RWSplit* instance, MXS_SESSION* session,
sent_sescmd(0),
recv_sescmd(0),
gtid_pos(""),
wait_gtid_state(EXPECTING_NOTHING),
next_seq(0),
rses_chk_tail(CHK_NUM_ROUTER_SES)
{
if (rses_config.rw_max_slave_conn_percent)
@ -1223,7 +1225,12 @@ static void clientReply(MXS_ROUTER *instance,
if (rses->wait_gtid_state == EXPECTING_WAIT_GTID_RESULT)
{
writebuf = discard_master_wait_gtid_result(writebuf, rses);
ss_dassert(rses->rses_config.enable_causal_read);
if ((writebuf = discard_master_wait_gtid_result(writebuf, rses)) == NULL)
{
// Nothing to route, return
return;
}
}
if (rses->wait_gtid_state == EXPECTING_REAL_RESULT)
{