Merge branch '2.2' into develop

This commit is contained in:
Markus Mäkelä
2018-04-13 14:53:00 +03:00
19 changed files with 457 additions and 80 deletions

View File

@ -1071,6 +1071,21 @@ int modutil_count_statements(GWBUF* buffer)
return num;
}
int modutil_count_packets(GWBUF* buffer)
{
int packets = 0;
size_t offset = 0;
uint8_t len[3];
while (gwbuf_copy_data(buffer, offset, 3, len) == 3)
{
++packets;
offset += gw_mysql_get_byte3(len) + MYSQL_HEADER_LEN;
}
return packets;
}
/**
* Initialize the PCRE2 patterns used when converting MySQL wildcards to PCRE syntax.
*/