diff --git a/bin/pt-kill b/bin/pt-kill index 04f72b01..6cf4097c 100755 --- a/bin/pt-kill +++ b/bin/pt-kill @@ -7102,10 +7102,10 @@ sub main { $query->{Id}, ($query->{Command} || 'NULL'), $query->{Time}, ($query->{Info} || 'NULL'); } - if ( $o->get('fingerprint') ) { + if ( $o->get('query-id') ) { my $fp = $qr->fingerprint($query->{'Info'}); - my $chksm = uc substr(md5_hex($fp), -16); - print "Fingerprint: 0x$chksm\n"; + my $chksm = Transformers::make_checksum($fp); + print "Query ID: 0x$chksm\n"; } if ( $o->get('execute-command') ) { exec_cmd($o->get('execute-command')); @@ -7493,11 +7493,6 @@ pt-kill does not provide any safeguards so code carefully! It is permissible for the code to have side effects (to alter C<$event>). -=item --fingerprint - -Prints a fingerprint (checksum) of the query that was just killed. This is -equivalent to the fingerprint output of pt-query-digest. This allows -cross-referencing the output of both tools. =item --group-by @@ -7602,6 +7597,20 @@ short form: -P; type: int Port number to use for connection. +=item --query-id + +Prints an ID of the query that was just killed. This is +equivalent to the "ID" output of pt-query-digest. This allows +cross-referencing the output of both tools. + +Example: + + Query ID 0xE9800998ECF8427E + +Note that this is a digest (or hash) of the query's "fingerprint", +so queries of the same form but with different values will have the same ID. +See pt-query-digest for more information. + =item --run-time type: time diff --git a/t/pt-kill/match.t b/t/pt-kill/match.t index 597b7fa3..47be0382 100644 --- a/t/pt-kill/match.t +++ b/t/pt-kill/match.t @@ -137,14 +137,14 @@ like( "--match-all" ); -# --fingerprint option +# --query-id option $output = output( - sub { pt_kill::main(@args, "$trunk/t/lib/samples/pl/recset011.txt", qw(--match-all --print --fingerprint)); } + sub { pt_kill::main(@args, "$trunk/t/lib/samples/pl/recset011.txt", qw(--match-all --print --query-id)); } ); like( $output, qr/0x69962191E64980E6/, - '--fingerprint' + '--query-id' ); # #############################################################################