Fix crash in cat

The router used the wrong capabilities and results weren't delivered as
complete and contiguous packets.
This commit is contained in:
Markus Mäkelä
2018-11-09 15:42:20 +02:00
parent 1108132cbd
commit 7e54cb8132
2 changed files with 2 additions and 1 deletions

View File

@ -55,7 +55,7 @@ json_t* Cat::diagnostics_json() const
return NULL; return NULL;
} }
const uint64_t caps = RCAP_TYPE_STMT_OUTPUT | RCAP_TYPE_STMT_INPUT; const uint64_t caps = RCAP_TYPE_PACKET_OUTPUT | RCAP_TYPE_CONTIGUOUS_OUTPUT | RCAP_TYPE_STMT_INPUT;
uint64_t Cat::getCapabilities() uint64_t Cat::getCapabilities()
{ {

View File

@ -104,6 +104,7 @@ void CatSession::clientReply(GWBUF* pPacket, DCB* pDcb)
if (send) if (send)
{ {
// Increment the packet sequence number and send it to the client // Increment the packet sequence number and send it to the client
mxb_assert(modutil_count_packets(pPacket) > 0);
GWBUF_DATA(pPacket)[3] = m_packet_num++; GWBUF_DATA(pPacket)[3] = m_packet_num++;
MXS_SESSION_ROUTE_REPLY(pDcb->session, pPacket); MXS_SESSION_ROUTE_REPLY(pDcb->session, pPacket);
} }