From 8905c3aa3437b8c8a9081bf9a285315ded5bd6c2 Mon Sep 17 00:00:00 2001 From: MassimilianoPinto Date: Thu, 14 Sep 2017 15:33:39 +0200 Subject: [PATCH] MXS-1411: fix error message and log priority MXS-1411: fix error message and log priority --- server/modules/filter/maxrows/maxrows.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/server/modules/filter/maxrows/maxrows.c b/server/modules/filter/maxrows/maxrows.c index a13b6c238..06b1fd594 100644 --- a/server/modules/filter/maxrows/maxrows.c +++ b/server/modules/filter/maxrows/maxrows.c @@ -637,8 +637,27 @@ static int handle_expecting_nothing(MAXROWS_SESSION_DATA *csdata) { ss_dassert(csdata->state == MAXROWS_EXPECTING_NOTHING); ss_dassert(csdata->res.data); - MXS_ERROR("Received data from the backend although we were expecting nothing."); - ss_dassert(!true); + unsigned long msg_size = gwbuf_length(csdata->res.data); + + if ((int)MYSQL_GET_COMMAND(GWBUF_DATA(csdata->res.data)) == 0xff) + { + /** + * Error text message is after: + * MYSQL_HEADER_LEN offset + status flag (1) + error code (2) + + * 6 bytes message status = MYSQL_HEADER_LEN + 9 + */ + MXS_INFO("Error packet received from backend " + "(possibly a server shut down ?): [%s].", + GWBUF_DATA(csdata->res.data) + MYSQL_HEADER_LEN + 9); + } + else + { + MXS_WARNING("Received data from the backend although " + "filter is expecting nothing. " + "Packet size is %lu bytes long.", + msg_size); + ss_dassert(!true); + } return send_upstream(csdata); }