LP #1082599: pt-query-digest fails to parse timestamp with no query

Description

**Reported in Launchpad by Ovais Tariq last update 14-01-2013 22:16:08

Brian I am reporting this as a bug in relation to what we talked about the problem I was facing with getting pt-query-digest to parse the slow log.

  1. pt-query-digest --version
    pt-query-digest 2.1.5

The tool pt-query-digest fails to parse the slow log for queries if the queries are prefixed by SET timestamp=xxx. Removing the "SET timestamp=xxx" statements from the slow log fixes the issue and pt-query-digest then works as expected.

Environment

None

Smart Checklist

Activity

Show:

lpjirasync January 24, 2018 at 2:17 PM

**Comment from Launchpad by: Ovais Tariq on: 07-12-2012 18:47:25

Daniel,

I have attached the log file that pt-query-digest is failing to parse. Note that removing "set timestamp = xxx" from the log fixes the issue.

For example use the attached slow.log file as follows and pt-query-digest will not parse it correctly:
cat slow.log | pt-query-digest

However, remove the SET TIMESTAMP = xx line and everything works fine:
cat slow.log | sed '/SET timestamp/d' | pt-query-digest

lpjirasync January 24, 2018 at 2:17 PM

**Comment from Launchpad by: Daniel Nichter on: 07-12-2012 17:55:11

This should work already: SlowLogParser.pm knows about SET statements. Maybe the format of those statements has changed. If you could provide a sample log that causes the problem, Ovais, that would be great. Else I'll try to reproduce it.

lpjirasync January 24, 2018 at 2:17 PM

**Comment from Launchpad by: Brian Fraser on: 03-12-2012 05:01:19

Related bug: https://bugs.launchpad.net/percona-toolkit/+bug/1082599

lpjirasync January 24, 2018 at 2:17 PM

**Comment from Launchpad by: Ovais Tariq on: 24-11-2012 13:58:14

I would like to add that this bug affects those who use this feature of Percona Server: http://www.percona.com/doc/percona-server/5.5/diagnostics/slow_extended_55.html#slow_query_log_timestamp_always

Done

Details

Assignee

Reporter

Priority

Smart Checklist

Created January 24, 2018 at 2:17 PM
Updated January 24, 2018 at 2:17 PM
Resolved January 24, 2018 at 2:17 PM