MXS-1808: Only store SQL statements for retrying

Only commands that can contain an SQL statements should be stored for
retrying (COM_QUERY and COM_EXECUTE). Other commands are either session
commands or do not work with query retrying.
This commit is contained in:
Markus Mäkelä
2018-04-17 11:19:37 +03:00
parent dac1b252ff
commit 232f807ef3
3 changed files with 97 additions and 1 deletions

View File

@ -242,7 +242,13 @@ bool route_single_stmt(RWSplit *inst, RWSplitSession *rses, GWBUF *querybuf, con
if ((target = handle_slave_is_target(inst, rses, command, stmt_id)))
{
succp = true;
store_stmt = rses->rses_config.retry_failed_reads;
if (rses->rses_config.retry_failed_reads &&
(command == MXS_COM_QUERY || command == MXS_COM_STMT_EXECUTE))
{
// Only commands that can contain an SQL statement should be stored
store_stmt = true;
}
}
}
else if (TARGET_IS_MASTER(route_target))