pt-query-digest --group-by db may crash profile report

Bug #924950 reported by Daniel Nichter
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to
Fix Released
Daniel Nichter

Bug Description

Jay encountered a bug when using pt-query-digest and --group-by db: the profile report crashed,

sub metrics {
   my ( $self, %args ) = @_;
   foreach my $arg ( qw(attrib where) ) {
      die "I need a $arg argument" unless $args{$arg};

because where was "" (blank string). This was probably due to queries with no default db (e.g. admin commands). Jay was using pt-query-digest 2.0.2, but the bug probably exists in all older versions too.

Changing the die line to "unless defined" fixed the problem in the field.

Because this bug crashes a report, it causes this infinite loop:

Related branches

tags: added: infinite-loop pt-query-digest risk
Changed in percona-toolkit:
status: New → Confirmed
description: updated
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

I think I fixed this--the infinite loop--already for another bug. Need to verify.

Changed in percona-toolkit:
assignee: nobody → Daniel Nichter (daniel-nichter)
milestone: none → 2.1.3
Changed in percona-toolkit:
importance: Undecided → Medium
status: Confirmed → In Progress
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

No, there were a couple places in QueryReportFormatter where this needed to be fixed, and in EventAggregator::metrics() too. Tested and fixed.

Changed in percona-toolkit:
status: In Progress → Fix Committed
Changed in percona-toolkit:
status: Fix Committed → Fix Released
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to:

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.