From fb12e4c0aa5291bcaca4587e4f4acaa42b0adbfb Mon Sep 17 00:00:00 2001 From: MassimilianoPinto Date: Fri, 15 Sep 2017 15:30:39 +0200 Subject: [PATCH] MXS-1411: additional fix to error message MXS-1411: additional fix to error message --- server/modules/filter/maxrows/maxrows.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/modules/filter/maxrows/maxrows.c b/server/modules/filter/maxrows/maxrows.c index 7c82f42e9..c4ac347bb 100644 --- a/server/modules/filter/maxrows/maxrows.c +++ b/server/modules/filter/maxrows/maxrows.c @@ -652,8 +652,14 @@ static int handle_expecting_nothing(MAXROWS_SESSION_DATA *csdata) 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].", + "(possibly a server shut down ?): [%.*s].", + (int)msg_size - (MYSQL_HEADER_LEN + 9), GWBUF_DATA(csdata->res.data) + MYSQL_HEADER_LEN + 9); } else