MXS-1625 Move internal/external id map to QueryClassifier
This commit is contained in:
@ -613,7 +613,7 @@ route_target_t get_target_type(RWSplitSession *rses, GWBUF *buffer,
|
||||
}
|
||||
else if (mxs_mysql_is_ps_command(*command))
|
||||
{
|
||||
*stmt_id = get_internal_ps_id(rses, buffer);
|
||||
*stmt_id = rses->qc().ps_id_internal_get(buffer);
|
||||
*type = rses->qc().ps_get_type(*stmt_id);
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ void RWSplitSession::process_sescmd_response(SRWBackend& backend, GWBUF** ppPack
|
||||
{
|
||||
/** Map the returned response to the internal ID */
|
||||
MXS_INFO("PS ID %u maps to internal ID %lu", resp.id, id);
|
||||
m_ps_handles[resp.id] = id;
|
||||
m_qc.ps_id_internal_put(resp.id, id);
|
||||
}
|
||||
|
||||
// Discard any slave connections that did not return the same result
|
||||
|
@ -737,24 +737,3 @@ void RWSplitSession::handle_error_reply_client(DCB *backend_dcb, GWBUF *errmsg)
|
||||
m_client->func.write(m_client, gwbuf_clone(errmsg));
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t get_internal_ps_id(RWSplitSession* rses, GWBUF* buffer)
|
||||
{
|
||||
uint32_t rval = 0;
|
||||
|
||||
// All COM_STMT type statements store the ID in the same place
|
||||
uint32_t id = mxs_mysql_extract_ps_id(buffer);
|
||||
ClientHandleMap::iterator it = rses->m_ps_handles.find(id);
|
||||
|
||||
if (it != rses->m_ps_handles.end())
|
||||
{
|
||||
rval = it->second;
|
||||
}
|
||||
else
|
||||
{
|
||||
MXS_WARNING("Client requests unknown prepared statement ID '%u' that "
|
||||
"does not map to an internal ID", id);
|
||||
}
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
Reference in New Issue
Block a user