MXS-852: Map client PS handle to internal ID

Mapping the handles returned to the client to a session command ID allows
the mapping of client handle to the backend specific handle. Currently,
the mapping is used for diagnostic output only.
This commit is contained in:
Markus Mäkelä
2017-06-21 15:02:26 +03:00
parent 0aa0fa82b7
commit 77f78c4b20
6 changed files with 52 additions and 10 deletions

View File

@ -1636,3 +1636,16 @@ bool mxs_mysql_extract_ps_response(GWBUF* buffer, MXS_PS_RESPONSE* out)
return rval;
}
uint32_t mxs_mysql_extract_execute(GWBUF* buffer)
{
uint32_t rval = 0;
uint8_t id[MYSQL_PS_ID_SIZE];
if (gwbuf_copy_data(buffer, MYSQL_PS_ID_OFFSET, sizeof(id), id) == sizeof(id))
{
rval = gw_mysql_get_byte4(id);
}
return rval;
}