MXS-1203: Better handling of batch queries

When batched queries are done through readwritesplit, it will now handle
them one by one. This allows batched queries to be used with
readwritesplit but it does impose a performance penalty when compared to
direct execution on the backend.
This commit is contained in:
Markus Mäkelä
2017-03-31 14:00:20 +03:00
parent a8b42d24b7
commit 66cf571412
9 changed files with 266 additions and 108 deletions

View File

@ -756,7 +756,7 @@ gw_read_and_write(DCB *dcb)
* If protocol has session command set, concatenate whole
* response into one buffer.
*/
if (protocol_get_srv_command((MySQLProtocol *)dcb->protocol, false) != MYSQL_COM_UNDEFINED)
if (protocol_get_srv_command((MySQLProtocol *)dcb->protocol, true) != MYSQL_COM_UNDEFINED)
{
stmt = process_response_data(dcb, &read_buffer, gwbuf_length(read_buffer));
/**

View File

@ -1562,3 +1562,9 @@ bool mxs_mysql_is_result_set(GWBUF *buffer)
return rval;
}
mysql_server_cmd_t mxs_mysql_current_command(MXS_SESSION* session)
{
MySQLProtocol* proto = (MySQLProtocol*)session->client_dcb->protocol;
return proto->current_command;
}