Skip to content

Commit

Permalink
Merge pull request #2173 from sysown/v2.0.6-2171
Browse files Browse the repository at this point in the history
Query digest uses ? for NULL values #2171
  • Loading branch information
renecannao authored Aug 2, 2019
2 parents 8ee9588 + a55dc82 commit a21627c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions lib/c_tokenizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,33 @@ char *mysql_query_digest_and_first_comment(char *s, int _len, char **first_comme
i++;
continue;
}
if (*s == 'n' || *s == 'N') { // we search for NULL , #2171
if (i && is_token_char(prev_char)) {
if (len>=4) {
if (i<len-3) {
// it is only 4 chars, let's skip strncasecmp
//if (strncasecmp(s,"null",4)==0) {
if (*(s+1) == 'u' || *(s+1) == 'U') {
if (*(s+2) == 'l' || *(s+2) == 'L') {
if (*(s+3) == 'l' || *(s+3) == 'L') {
if (i==len-3) {
*p_r++ = '?';
*p_r = 0;
return r;
} else {
if (is_token_char(*(s+4))){
*p_r++ = '?';
s+=4;
i+=4;
}
}
}
}
}
}
}
}
}
}
}

Expand Down

0 comments on commit a21627c

Please sign in to comment.