Something like the following could do the trick. However, I'm not sure how it would impact the tool in general (quick ugly diff on the binary, but location should be clear).
*** /usr/local/bin/pt-query-digest 2013-02-15 13:13:10.000000000 +0100 --- /tmp/patched 2013-02-15 13:12:37.000000000 +0100 *************** *** 4907,4912 **** --- 4907,4915 ---- else { PTDEBUG && _d("Got the query/arg line"); my $arg = substr($stmt, $pos - length($line)); + # Strip C-style comments + $arg =~ s#/\*[^*]*\*+([^/*][^*]*\*+)*/|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)#defined $2 ? $2 : ""#gse; + PTDEBUG && _d('Clean query = ', $arg); push @properties, 'arg', $arg, 'bytes', length($arg); if ( $args{misc} && $args{misc}->{embed} && ( my ($e) = $arg =~ m/($args{misc}->{embed})/)
Something like the following could do the trick. However, I'm not sure how it would impact the tool in general (quick ugly diff on the binary, but location should be clear).
*** /usr/local/ bin/pt- query-digest 2013-02-15 13:13:10.000000000 +0100
PTDEBUG && _d("Got the query/arg line"); *]*\*+( [^/*][^ *]*\*+) */|("(\ \.|[^"\ \])*"|' (\\.|[^ '\\])*' |.[^/"' \\]*)#defined $2 ? $2 : ""#gse; ->{embed} misc}-> {embed} )/)
--- /tmp/patched 2013-02-15 13:12:37.000000000 +0100
***************
*** 4907,4912 ****
--- 4907,4915 ----
else {
my $arg = substr($stmt, $pos - length($line));
+ # Strip C-style comments
+ $arg =~ s#/\*[^
+ PTDEBUG && _d('Clean query = ', $arg);
push @properties, 'arg', $arg, 'bytes', length($arg);
if ( $args{misc} && $args{misc}
&& ( my ($e) = $arg =~ m/($args{