Added removal of MySQL style comments to query canonicalization.

Also fixed minor issues with the canonicalization regular expressions.
This commit is contained in:
Markus Makela
2016-01-08 10:43:38 +02:00
parent c067bbe34a
commit e0c84e0fe3
3 changed files with 122 additions and 39 deletions

View File

@ -1443,6 +1443,11 @@ char* qc_get_canonical(GWBUF* querybuf)
memcpy(buffer, (uint8_t*) GWBUF_DATA(querybuf) + 5, bufsize);
buffer[bufsize] = '\0';
char* replaced = replace_quoted(buffer);
if (replaced == NULL || (querystr = remove_mysql_comments(replaced)) == NULL)
{
querystr = NULL;
}
replaced = querystr;
if (replaced == NULL || (querystr = replace_values(replaced)) == NULL)
{
querystr = NULL;