diff --git a/lib/c_tokenizer.c b/lib/c_tokenizer.c index 3897c01fc..485f8f698 100644 --- a/lib/c_tokenizer.c +++ b/lib/c_tokenizer.c @@ -162,6 +162,11 @@ static char is_digit_string(char *f, char *t) char *mysql_query_digest_and_first_comment(char *s, int _len, char *first_comment){ int i = 0; + char cur_comment[FIRST_COMMENT_MAX_LENGTH]; + cur_comment[0]=0; + int ccl=0; + int cmd=0; + int len = _len; if (_len > QUERY_DIGEST_MAX_LENGTH) { len = QUERY_DIGEST_MAX_LENGTH; @@ -193,7 +198,10 @@ char *mysql_query_digest_and_first_comment(char *s, int _len, char *first_commen // comment type 1 - start with '/*' if(prev_char == '/' && *s == '*') { + ccl=0; flag = 1; + if (*(s+1)=='!') + cmd=1; } // comment type 2 - start with '#' @@ -246,6 +254,12 @@ char *mysql_query_digest_and_first_comment(char *s, int _len, char *first_commen // comment // -------- if (flag == 1) { + if (cmd) { + if (ccl=2) { + ccl-=2; + cur_comment[ccl]=0; + char el=0; + int fcc=0; + while (el==0 && fcc