Merge branch '2.3' into 2.4

This commit is contained in:
Markus Mäkelä
2019-07-02 08:38:15 +03:00
16 changed files with 75 additions and 29 deletions

View File

@ -235,12 +235,7 @@ bool RWSplitSession::route_single_stmt(GWBUF* querybuf)
RWBackend* target = nullptr;
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);
}
@ -282,6 +277,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)))

View File

@ -985,6 +985,18 @@ void RWSplitSession::handleError(GWBUF* errmsgbuf,
RWBackend* backend = get_backend_from_dcb(problem_dcb);
mxb_assert(backend->in_use());
if (backend->reply_has_started())
{
MXS_ERROR("Server '%s' was lost in the middle of a resultset, cannot continue the session: %s",
backend->name(), extract_error(errmsgbuf).c_str());
// This effectively causes an instant termination of the client connection and prevents any errors
// from being sent to the client (MXS-2562).
dcb_close(m_client);
*succp = true;
return;
}
switch (action)
{
case ERRACT_NEW_CONNECTION: