MXS-1734 Add possibility to instruct when to dump statements

With the configuration entry

dump_last_statements=[never|on_close|on_error]

you can now specify when and if to dump the last statements
of of a session.
This commit is contained in:
Johan Wikman
2018-03-26 10:42:11 +03:00
parent 6d599395d4
commit 3d45d452eb
6 changed files with 68 additions and 5 deletions

View File

@ -1410,7 +1410,11 @@ static int gw_client_hangup_event(DCB *dcb)
CHK_SESSION(session);
if (session->state != SESSION_STATE_DUMMY && !session_valid_for_pool(session))
{
session_dump_statements(session);
if (session_get_dump_statements() == SESSION_DUMP_STATEMENTS_ON_ERROR)
{
session_dump_statements(session);
}
// The client did not send a COM_QUIT packet
modutil_send_mysql_err_packet(dcb, 0, 0, 1927, "08S01", "Connection killed by MaxScale");
}