Skip to content
Closed
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
10 changes: 9 additions & 1 deletion bin/pt-query-digest
Original file line number Diff line number Diff line change
Expand Up @@ -5234,6 +5234,10 @@ sub parse_event {
}

PTDEBUG && _d('Properties of event:', Dumper(\@properties));
if ( @properties % 2 ) {
PTDEBUG && _d('Skipping malformed event (odd properties):', Dumper(\@properties));
next EVENT;
}
my $event = { @properties };
if ( !$event->{arg} ) {
PTDEBUG && _d('Partial event, no arg');
Expand Down Expand Up @@ -5625,6 +5629,10 @@ sub make_handler {
);
}

if ( $type =~ m/^(?:num|bool)$/ ) {
push @lines, q{$val = 0 if defined $val && $val eq '';};
}

if ( $type eq 'num' && $self->{attrib_limit} ) {
push @lines, (
"if ( \$val > $self->{attrib_limit} ) {",
Expand Down Expand Up @@ -5654,7 +5662,7 @@ sub make_handler {
. $gt . ' PLACE->{max};',
);
if ( $track{sum} ) {
push @tmp, 'PLACE->{sum} += $val;';
push @tmp, 'PLACE->{sum} += (defined $val && $val ne q{} ? $val : 0);';
}

if ( $track{all} ) {
Expand Down
Loading