Merge branch '2.3' into develop

This commit is contained in:
Markus Mäkelä
2019-06-03 13:46:13 +03:00
24 changed files with 357 additions and 57 deletions

View File

@ -735,6 +735,7 @@ public:
Buffer(GWBUF* pBuffer)
: m_pBuffer(pBuffer)
{
mxb_assert(pBuffer);
}
/**

View File

@ -305,11 +305,10 @@ typedef enum
MXS_COM_RESET_CONNECTION = 31,
MXS_COM_STMT_BULK_EXECUTE = 0xfa,
MXS_COM_MULTI = 0xfe,
MXS_COM_END
MXS_COM_END,
MXS_COM_UNDEFINED = -1
} mxs_mysql_cmd_t;
static const mxs_mysql_cmd_t MXS_COM_UNDEFINED = (mxs_mysql_cmd_t) -1;
/**
* A GWBUF property with this name will contain the latest GTID in string form.
* This information is only available in OK packets.
@ -378,6 +377,7 @@ static inline uint32_t MYSQL_GET_PAYLOAD_LEN(const uint8_t* header)
static inline uint32_t MYSQL_GET_PACKET_LEN(const GWBUF* buffer)
{
mxb_assert(buffer);
return MYSQL_GET_PAYLOAD_LEN(GWBUF_DATA(buffer)) + MYSQL_HEADER_LEN;
}
@ -628,6 +628,7 @@ void mxs_mysql_set_current_db(MXS_SESSION* session, const char* db);
*/
static inline uint8_t mxs_mysql_get_command(GWBUF* buffer)
{
mxb_assert(buffer);
if (GWBUF_LENGTH(buffer) > MYSQL_HEADER_LEN)
{
return GWBUF_DATA(buffer)[4];
@ -651,6 +652,7 @@ static inline uint8_t mxs_mysql_get_command(GWBUF* buffer)
*/
static inline uint32_t mxs_mysql_get_packet_len(GWBUF* buffer)
{
mxb_assert(buffer);
// The first three bytes of the packet header contain its length
uint8_t buf[3];
gwbuf_copy_data(buffer, 0, 3, buf);