Don't crash if group by attrib is empty string.

This commit is contained in:
Daniel Nichter
2012-07-11 15:46:58 -06:00
parent 6269b196a3
commit d8b0192495
7 changed files with 84 additions and 12 deletions

View File

@@ -0,0 +1,30 @@
# ########################################################################
# Report grouped by db
# ########################################################################
# Item 1: 0 QPS, 0x concurrency, ID 0xE9800998ECF8427E at byte 420 _______
# This item is included in the report because it matches --limit.
# Scores: Apdex = 1.00 [1.0]*, V/M = 0.01
# Query_time sparkline: |^ ^ ^ |
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count 100 3
# Exec time 100 20ms 2us 19ms 7ms 18ms 8ms 881us
# Lock time 100 9ms 0 9ms 3ms 9ms 4ms 0
# Rows sent 0 0 0 0 0 0 0 0
# Rows examine 0 0 0 0 0 0 0 0
# Query size 100 72 14 31 24 30.19 6.95 26.08
# String:
# Hosts
# Users meow
# Query_time distribution
# 1us ################################################################
# 10us
# 100us ################################################################
# 1ms
# 10ms ################################################################
# 100ms
# 1s
# 10s+

View File

@@ -9,7 +9,7 @@ BEGIN {
use strict;
use warnings FATAL => 'all';
use English qw(-no_match_vars);
use Test::More tests => 43;
use Test::More tests => 44;
use PerconaTest;
@@ -433,6 +433,18 @@ ok(
'Analysis for slow054 (InnoDB_trx_id bug 821694)'
);
# #############################################################################
# Bug 924950: pt-query-digest --group-by db may crash profile report
# #############################################################################
ok(
no_diff(
sub { pt_query_digest::main(@args, $sample.'slow055.txt',
qw(--group-by db)) },
"t/pt-query-digest/samples/slow055.txt",
),
'Analysis for slow055 (group by blank db bug 924950)'
);
# #############################################################################
# Done.
# #############################################################################