RWS: Log packet length when logging transaction status

This commit is contained in:
Johan Wikman
2018-02-25 17:09:45 +02:00
parent aab039f783
commit 13c222488e

View File

@ -174,12 +174,13 @@ log_transaction_status(RWSplitSession *rses, GWBUF *querybuf, uint32_t qtype)
MXS_SESSION *ses = rses->client_dcb->session;
const char *autocommit = session_is_autocommit(ses) ? "[enabled]" : "[disabled]";
const char *transaction = session_trx_is_active(ses) ? "[open]" : "[not open]";
uint32_t plen = MYSQL_GET_PACKET_LEN(querybuf);
const char *querytype = qtypestr == NULL ? "N/A" : qtypestr;
const char *hint = querybuf->hint == NULL ? "" : ", Hint:";
const char *hint_type = querybuf->hint == NULL ? "" : STRHINTTYPE(querybuf->hint->type);
MXS_INFO("> Autocommit: %s, trx is %s, cmd: (0x%02x) %s, type: %s, stmt: %.*s%s %s",
autocommit, transaction, command, STRPACKETTYPE(command),
MXS_INFO("> Autocommit: %s, trx is %s, cmd: (0x%02x) %s, plen: %u, type: %s, pastmt: %.*s%s %s",
autocommit, transaction, command, STRPACKETTYPE(command), plen,
querytype, len, sql, hint, hint_type);
MXS_FREE(qtypestr);