Fix sending of unknown PS error

The error was only generated for COM_STMT_EXECUTE commands when all PS
commands should trigger it. In addition, large packets would get sent two
errors upon the arrival of the trailing end.
This commit is contained in:
Markus Mäkelä 2019-07-01 10:25:41 +03:00
parent 0f7c1aa418
commit 4954c7f6b7
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -202,12 +202,7 @@ bool RWSplitSession::route_single_stmt(GWBUF* querybuf)
SRWBackend target;
if (command == MXS_COM_STMT_EXECUTE && stmt_id == 0)
{
// Unknown prepared statement ID
succp = send_unknown_ps_error(extract_binary_ps_id(querybuf));
}
else if (TARGET_IS_ALL(route_target))
if (TARGET_IS_ALL(route_target))
{
succp = handle_target_is_all(route_target, querybuf, command, qtype);
}
@ -249,6 +244,11 @@ bool RWSplitSession::route_single_stmt(GWBUF* querybuf)
target = m_prev_target;
succp = true;
}
else if (mxs_mysql_is_ps_command(command) && stmt_id == 0)
{
// Unknown prepared statement ID
succp = send_unknown_ps_error(extract_binary_ps_id(querybuf));
}
else if (TARGET_IS_NAMED_SERVER(route_target) || TARGET_IS_RLAG_MAX(route_target))
{
if ((target = handle_hinted_target(querybuf, route_target)))