Skip to content

Commit 98d62c2

Browse files
committed
Update comment.
generate_normalized_query() no longer needs to truncate text, but this one comment didn't get the memo. Per Peter Geoghegan.
1 parent c871e8f commit 98d62c2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

contrib/pg_stat_statements/pg_stat_statements.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -2726,14 +2726,15 @@ generate_normalized_query(pgssJumbleState *jstate, const char *query,
27262726
if (tok_len < 0)
27272727
continue; /* ignore any duplicates */
27282728

2729-
/* Copy next chunk, or as much as will fit */
2729+
/* Copy next chunk (what precedes the next constant) */
27302730
len_to_wrt = off - last_off;
27312731
len_to_wrt -= last_tok_len;
27322732

27332733
Assert(len_to_wrt >= 0);
27342734
memcpy(norm_query + n_quer_loc, query + quer_loc, len_to_wrt);
27352735
n_quer_loc += len_to_wrt;
27362736

2737+
/* And insert a '?' in place of the constant token */
27372738
norm_query[n_quer_loc++] = '?';
27382739

27392740
quer_loc = off + tok_len;

0 commit comments

Comments
 (0)