QC: Parse statements in COM_STMT_PREPARE packets
This commit is contained in:
@ -507,7 +507,9 @@ static bool parse_query(GWBUF* query)
|
||||
if ((GWBUF_LENGTH(query) >= MYSQL_HEADER_LEN + 1) &&
|
||||
(GWBUF_LENGTH(query) == MYSQL_HEADER_LEN + MYSQL_GET_PAYLOAD_LEN(data)))
|
||||
{
|
||||
if (MYSQL_GET_COMMAND(data) == MYSQL_COM_QUERY)
|
||||
uint8_t command = MYSQL_GET_COMMAND(data);
|
||||
|
||||
if ((command == MYSQL_COM_QUERY) || (command == MYSQL_COM_STMT_PREPARE))
|
||||
{
|
||||
QC_SQLITE_INFO* info = info_alloc();
|
||||
|
||||
@ -525,6 +527,11 @@ static bool parse_query(GWBUF* query)
|
||||
this_thread.info->query = NULL;
|
||||
this_thread.info->query_len = 0;
|
||||
|
||||
if (command == MYSQL_COM_STMT_PREPARE)
|
||||
{
|
||||
info->types |= QUERY_TYPE_PREPARE_STMT;
|
||||
}
|
||||
|
||||
// TODO: Add return value to gwbuf_add_buffer_object.
|
||||
// Always added; also when it was not recognized. If it was not recognized now,
|
||||
// it won't be if we try a second time.
|
||||
|
Reference in New Issue
Block a user