Allow collection of prepared statement responses

The backend MySQL protocol can now collect prepared statement preparation
responses as well as result sets. This removes the need to parse and
collect the preparation responses at the router level.
This commit is contained in:
Markus Mäkelä
2017-04-09 04:19:01 +03:00
parent a88e98035f
commit 73dd9bd025
3 changed files with 97 additions and 11 deletions

View File

@ -1558,6 +1558,20 @@ bool mxs_mysql_is_result_set(GWBUF *buffer)
return rval;
}
bool mxs_mysql_is_prep_stmt_ok(GWBUF *buffer)
{
bool rval = false;
uint8_t cmd;
if (gwbuf_copy_data(buffer, MYSQL_HEADER_LEN, 1, &cmd) &&
cmd == MYSQL_REPLY_OK)
{
rval = true;
}
return rval;
}
bool mxs_mysql_more_results_after_ok(GWBUF *buffer)
{
bool rval = false;