MXS-2196: Fix dcb error flag assignment

The error flag was set before the function was called which caused the
function to never be used. As the core should handle the filtering of
multiple errors on the same DCB, the protocol modules should not check it.
This commit is contained in:
Markus Mäkelä
2018-12-05 14:24:13 +02:00
parent 01ba8bf886
commit 7aaadfc550
2 changed files with 17 additions and 20 deletions

View File

@ -577,22 +577,16 @@ static void do_handle_error(DCB* dcb, mxs_error_action_t action, const char* err
bool succp = true;
MXS_SESSION* session = dcb->session;
if (!dcb->dcb_errhandle_called)
{
GWBUF* errbuf = mysql_create_custom_error(1, 0, errmsg);
MXS_ROUTER_SESSION* rsession = static_cast<MXS_ROUTER_SESSION*>(session->router_session);
MXS_ROUTER_OBJECT* router = session->service->router;
MXS_ROUTER* router_instance = session->service->router_instance;
mxb_assert(!dcb->dcb_errhandle_called);
router->handleError(router_instance,
rsession,
errbuf,
dcb,
action,
&succp);
GWBUF* errbuf = mysql_create_custom_error(1, 0, errmsg);
MXS_ROUTER_SESSION* rsession = static_cast<MXS_ROUTER_SESSION*>(session->router_session);
MXS_ROUTER_OBJECT* router = session->service->router;
MXS_ROUTER* router_instance = session->service->router_instance;
gwbuf_free(errbuf);
}
router->handleError(router_instance, rsession, errbuf, dcb, action, &succp);
gwbuf_free(errbuf);
/**
* If error handler fails it means that routing session can't continue
* and it must be closed. In success, only this DCB is closed.