Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion bin/pt-kill
Original file line number Diff line number Diff line change
Expand Up @@ -7379,6 +7379,17 @@ sub main {
exec_cmd($o->get('execute-command'));
msg('Executed ' . $o->get('execute-command'));
}
if ( $o->get('logdb') ) {
if ( $log ) {
Comment on lines +7382 to +7383
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if someone specifies option --logdb and not --log?

log_to_table(
log => $log,
query => $query,
proclist => $pl,
columns => \@processlist_columns,
eval_error => $EVAL_ERROR,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EVAL_ERROR makes sense only after pt-kill tried to kill the query.

);
}
}
if ( $o->get('kill') || $o->get('kill-query') ) {
if ( $o->get('wait-before-kill') ) {
msg("Sleeping " . $o->get('wait-before-kill')
Expand Down Expand Up @@ -7673,7 +7684,7 @@ with the command.

=head1 OPTIONS

Specify at least one of L<"--kill">, L<"--kill-query">, L<"--print">, L<"--execute-command"> or L<"--stop">.
Specify at least one of L<"--kill">, L<"--kill-query">, L<"--logdb">,L<"--print">, L<"--execute-command"> or L<"--stop">.

L<"--any-busy-time"> and L<"--each-busy-time"> are mutually exclusive.

Expand Down Expand Up @@ -8382,6 +8393,17 @@ This option makes pt-kill kill matching queries. This requires MySQL 5.0 or
newer. Unlike L<"--kill"> which kills the connection for matching queries,
this option only kills the query, not its connection.

=item --logdb
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not very intuitive name for the option.


group: Actions

Logs a KILL statement for matching queries to the database using --log-dsn;
does not actually kill queries.

If you just want to see which queries match and would be killed without
actually killing them, specify L<"--logdb">. To both kill and print
matching queries, specify L<"--kill"> instead.

=item --print

group: Actions
Expand Down