5.6 slow query log Thead_id becomes Id - 1299387

This commit is contained in:
Frank Cizmich
2014-07-15 15:12:45 -03:00
parent ce0a9b0422
commit af185fbc28
8 changed files with 220 additions and 51 deletions

View File

@@ -1349,6 +1349,70 @@ test_log_parser(
],
);
# #############################################################################
# pt-query-digest fails to parse Thread_id on 5.6
# https://bugs.launchpad.net/percona-toolkit/+bug/1299387
# #############################################################################
# first test with a Percona 5.5 slow log (includes an explicit Thread_id line)
# (MySQL 5.5 doesn't include thread id)
test_log_parser(
parser => $p,
file => "$sample/p55-slow.log",
result => [
{
Thread_id => '1', # here's our item
Bytes_sent => '64',
Killed => '0',
Last_errno => '0',
Lock_time => '0.000000',
Query_time => '10.000373',
Rows_affected => '0',
Rows_examined => '0',
Rows_read => '0',
Rows_sent => '1',
arg => 'select sleep(10)',
bytes => 16,
cmd => 'Query',
host => 'localhost',
ip => '127.0.0.1',
pos_in_log => 0,
timestamp => '1405358212',
ts => '140714 14:16:52',
user => 'root'
},
],
);
# now test with a Percona 5.6 slow log. Thread_id is now on the user@host line, and is called 'Id'.
# (this is in line with MySQL 5.6)
test_log_parser(
parser => $p,
file => "$sample/p56-slow.log",
result => [
{
Thread_id => 1, # here's our item
Bytes_sent => '64',
Lock_time => '0.000000',
Query_time => '11.013723',
Rows_affected => '0',
Rows_examined => '0',
Rows_sent => '1',
arg => 'select sleep(11)',
bytes => 16,
cmd => 'Query',
host => 'localhost',
ip => '127.0.0.1',
pos_in_log => 0,
timestamp => '1405360304',
ts => '140714 14:51:44',
user => 'root',
},
],
);
# #############################################################################
# Done.
# #############################################################################

View File

@@ -0,0 +1,10 @@
bin/mysqld, Version: 5.5.38-35.2-log (Percona Server (GPL), Release 35.2, Revision 674). started with:
Tcp port: 3306 Unix socket: (null)
Time Id Command Argument
# Time: 140714 14:16:52
# User@Host: root[root] @ localhost [127.0.0.1]
# Thread_id: 1 Schema: Last_errno: 0 Killed: 0
# Query_time: 10.000373 Lock_time: 0.000000 Rows_sent: 1 Rows_examined: 0 Rows_affected: 0 Rows_read: 0
# Bytes_sent: 64
SET timestamp=1405358212;
select sleep(10);

View File

@@ -0,0 +1,10 @@
bin/mysqld, Version: 5.6.19-67.0-log (Percona Server (GPL), Release 67.0, Revision 618). started with:
Tcp port: 3306 Unix socket: (null)
Time Id Command Argument
# Time: 140714 14:51:44
# User@Host: root[root] @ localhost [127.0.0.1] Id: 1
# Schema: Last_errno: 0 Killed: 0
# Query_time: 11.013723 Lock_time: 0.000000 Rows_sent: 1 Rows_examined: 0 Rows_affected: 0
# Bytes_sent: 64
SET timestamp=1405360304;
select sleep(11);