Dump queue contents on unexpectedly NULL buffer

When the query queue does not contain a complete packet
(i.e. modutil_get_next_MySQL_packet return NULL), an informative dump of
how many bytes and what is stored is logged.
This commit is contained in:
Markus Mäkelä
2018-07-23 13:00:02 +03:00
parent ea5c5f3a07
commit 4b7cd7a281
3 changed files with 14 additions and 5 deletions

View File

@ -892,7 +892,7 @@ static std::string dump_one_buffer(GWBUF* buffer)
return rval;
}
void gwbuf_hexdump(GWBUF* buffer)
void gwbuf_hexdump(GWBUF* buffer, int log_level)
{
std::stringstream ss;
@ -910,5 +910,5 @@ void gwbuf_hexdump(GWBUF* buffer)
n = 1024;
}
MXS_INFO("%.*s", n, ss.str().c_str());
MXS_LOG_MESSAGE(log_level, "%.*s", n, ss.str().c_str());
}