MXS-2365: Fix classification of queued queries
Queries in the query queue need to be explicitly parsed since they are stored in a single buffer and thus share the query classification information. In the next major version this should be changed into an array of individual buffers instead of a shared buffer.
This commit is contained in:
@ -223,7 +223,7 @@ bool RWSplitSession::route_stored_query()
|
|||||||
* to wait for a response before attempting another reroute */
|
* to wait for a response before attempting another reroute */
|
||||||
while (m_query_queue)
|
while (m_query_queue)
|
||||||
{
|
{
|
||||||
MXS_INFO("Routing stored queries");
|
MXS_INFO(">>> Routing stored queries");
|
||||||
GWBUF* query_queue = modutil_get_next_MySQL_packet(&m_query_queue);
|
GWBUF* query_queue = modutil_get_next_MySQL_packet(&m_query_queue);
|
||||||
query_queue = gwbuf_make_contiguous(query_queue);
|
query_queue = gwbuf_make_contiguous(query_queue);
|
||||||
mxb_assert(query_queue);
|
mxb_assert(query_queue);
|
||||||
@ -241,6 +241,9 @@ bool RWSplitSession::route_stored_query()
|
|||||||
GWBUF* temp_storage = m_query_queue;
|
GWBUF* temp_storage = m_query_queue;
|
||||||
m_query_queue = NULL;
|
m_query_queue = NULL;
|
||||||
|
|
||||||
|
// The query needs to be explicitly parsed as it was processed multiple times
|
||||||
|
qc_parse(query_queue, QC_COLLECT_ALL);
|
||||||
|
|
||||||
// TODO: Move the handling of queued queries to the client protocol
|
// TODO: Move the handling of queued queries to the client protocol
|
||||||
// TODO: module where the command tracking is done automatically.
|
// TODO: module where the command tracking is done automatically.
|
||||||
uint8_t cmd = mxs_mysql_get_command(query_queue);
|
uint8_t cmd = mxs_mysql_get_command(query_queue);
|
||||||
@ -252,6 +255,8 @@ bool RWSplitSession::route_stored_query()
|
|||||||
MXS_ERROR("Failed to route queued query.");
|
MXS_ERROR("Failed to route queued query.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MXS_INFO("<<< Stored queries routed");
|
||||||
|
|
||||||
if (m_query_queue == NULL)
|
if (m_query_queue == NULL)
|
||||||
{
|
{
|
||||||
/** Query successfully routed and no responses are expected */
|
/** Query successfully routed and no responses are expected */
|
||||||
|
|||||||
Reference in New Issue
Block a user