Parse InnoDB_trx_id as a string.

This commit is contained in:
Daniel Nichter
2012-02-23 09:34:17 -07:00
parent bb7890d78d
commit a83e97a821
5 changed files with 103 additions and 10 deletions

View File

@@ -9,7 +9,7 @@ BEGIN {
use strict;
use warnings FATAL => 'all';
use English qw(-no_match_vars);
use Test::More tests => 80;
use Test::More tests => 81;
use QueryRewriter;
use EventAggregator;
@@ -1906,6 +1906,24 @@ cmp_ok(
"Saved no more than 1_000 CRCs"
);
# #############################################################################
# Bug 821694: pt-query-digest doesn't recognize hex InnoDB txn IDs
# #############################################################################
$ea = new EventAggregator(
groupby => 'arg',
worst => 'Query_time',
unroll_limit => 5,
type_for => {
'InnoDB_trx_id' => 'string',
},
);
parse_file('t/lib/samples/slowlogs/slow054.txt', $p, $ea);
is(
$ea->{result_classes}->{'SELECT * FROM foo WHERE id=1'}->{InnoDB_trx_id}->{cnt},
8,
"Parse InnoDB_trx_id as string"
);
# #############################################################################
# Done.
# #############################################################################

View File

@@ -0,0 +1,32 @@
# Time: 110208 12:00:01
# Query_time: 0.000012 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
# InnoDB_trx_id: 101
SELECT * FROM foo WHERE id=1;
# Time: 110208 12:00:01
# Query_time: 0.000012 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
# InnoDB_trx_id: 102
SELECT * FROM foo WHERE id=1;
# Time: 110208 12:00:01
# Query_time: 0.000012 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
# InnoDB_trx_id: 103
SELECT * FROM foo WHERE id=1;
# Time: 110208 12:00:01
# Query_time: 0.000012 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
# InnoDB_trx_id: 104
SELECT * FROM foo WHERE id=1;
# Time: 110208 12:00:01
# Query_time: 0.000012 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
# InnoDB_trx_id: 105
SELECT * FROM foo WHERE id=1;
# Time: 110208 12:00:01
# Query_time: 0.000012 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
# InnoDB_trx_id: 106
SELECT * FROM foo WHERE id=1;
# Time: 110208 12:00:01
# Query_time: 0.000012 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
# InnoDB_trx_id: A07
SELECT * FROM foo WHERE id=1;
# Time: 110208 12:00:01
# Query_time: 0.000012 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
# InnoDB_trx_id: A08
SELECT * FROM foo WHERE id=1;