PG-1674: Fix query hash calculation comment removal logic
The previous conditions only removed the first few starting characters of the comment, and leaved everything else there. This modification fixes this and correctly removes everything.pull/542/head
parent
61662cc58f
commit
a7908de4a2
|
@ -2715,12 +2715,19 @@ get_pgsm_query_id_hash(const char *norm_query, int norm_len)
|
|||
*/
|
||||
if (*norm_q_iter == '/' && *(norm_q_iter + 1) == '*')
|
||||
{
|
||||
while (*norm_q_iter && *norm_q_iter != '*' && *(norm_q_iter + 1) != '/')
|
||||
while (*norm_q_iter && *(norm_q_iter + 1) && (*norm_q_iter != '*' || *(norm_q_iter + 1) != '/'))
|
||||
norm_q_iter++;
|
||||
|
||||
/* Skip the '/' if the current character is valid. */
|
||||
/*
|
||||
* Skip the end if the current character is valid. norm_q_iter
|
||||
* points to the *, we have to skip 2 characters
|
||||
*/
|
||||
if (*norm_q_iter)
|
||||
norm_q_iter++;
|
||||
if (*norm_q_iter)
|
||||
norm_q_iter++;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue