# pt-query-digest and 5.6 binlog

**URL:** <https://forums.percona.com/t/pt-query-digest-and-5-6-binlog/3330>\
**Category:** Percona Toolkit\
**Created:** [March 12, 2014, 8:18am UTC](https://forums.percona.com/t/pt-query-digest-and-5-6-binlog/3330 "2014-03-12T08:18:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ancient\_tech](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@ancient\_tech](https://forums.percona.com/u/ancient_tech)\
**Post date:** [March 12, 2014, 8:18am UTC](https://forums.percona.com/t/pt-query-digest-and-5-6-binlog/3330/1 "2014-03-12T08:18:24Z")

</div>

Hi

We are trying to use pt-query-digest on a binlog from MySQL 5.6.16 but it looks like it can’t parse the binlog file. We have converted the binlog with “mysqlbinlog \*\*\*.bin \> kglabb.sql” and when we run pt-query-digest this is what we get:

pt-query-digest --type binlog kglabb.sql  
kglabb.sql: 100% 00:00 remain

# 155.9s user time, 4s system time, 24.41M rss, 205.23M vsz

# Current date: Wed Mar 12 14:33:11 2014

# Hostname: SEGUM-MGMT-01.host.core.intra

# Files: kglabb.sql

# Overall: 0 total, 1 unique, 0 QPS, 0x concurrency \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

# Time range: unknown

# Attribute total min max avg 95% stddev median

# ============ ======= ======= ======= ======= ======= ======= =======

# Query size 132 132 132 132 132 0 132

# Profile

# Rank Query ID Response time Calls R/Call V/M Item

# =========== =========== =========== =========== =========== ===== ======

When we run it with PTDEBUG=1 we get a “Unknown event type: CRC32” for each event in the logfile.

We are running: pt-query-digest 2.2.5

What are we doing wrong? Or is this expected behavior to not be able to use 5.6 binlogs with pt-query-digest?

Brgds  
Olof Mattsson

---

<div class="post-metadata">

**Author:** ![niljoshi](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/niljoshi/32/16889_2.png) [@niljoshi](https://forums.percona.com/u/niljoshi)\
**Post date:** [March 31, 2014, 7:30am UTC](https://forums.percona.com/t/pt-query-digest-and-5-6-binlog/3330/2 "2014-03-31T07:30:38Z")

</div>

Hi,

Can you provide output of “mysqlbinlog --version” and “show variables” ? I think that event type CRC32 is new for 5.6 binlog, it was not in 5.5.

---

<div class="post-metadata">

**Author:** ![olliiiver](https://avatars.discourse-cdn.com/v4/letter/o/b19c9b/32.png) [@olliiiver](https://forums.percona.com/u/olliiiver)\
**Post date:** [April 3, 2014, 5:06pm UTC](https://forums.percona.com/t/pt-query-digest-and-5-6-binlog/3330/3 "2014-04-03T17:06:03Z")

</div>

It seems the CRC32 checksum was added in MySQL 5.6. The following change works for me:

```auto

--- pt-query-digest.old 2014-04-03 11:41:04.000000000 +0200
+++ pt-query-digest 2014-04-03 23:55:46.000000000 +0200
&#64;&#64; -9580,7 +9580,7 &#64;&#64;
$Data::Dumper::Quotekeys = 0;

my $binlog_line_1 = qr/at (\d+)$/m;
-my $binlog_line_2 = qr/^#(\d{6}\s+\d{1,2}:\d\d:\d\d)\s+server\s+id\s+(\d+)\s+end_log_pos\s+(\d+)\s+(\S+)\s*([^\n]*)$/m;
+my $binlog_line_2 = qr/^#(\d{6}\s+\d{1,2}:\d\d:\d\d)\s+server\s+id\s+(\d+)\s+end_log_pos\s+(\d+)\s+CRC32\s+[0-9a-fx]{10}\s+(\S+)\s*([^\n]*)$/m;
my $binlog_line_2_rest = qr/thread_id=(\d+)\s+exec_time=(\d+)\s+error_code=(\d+)/m;

sub new {

```

---

<div class="post-metadata">

**Author:** ![ancient\_tech](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@ancient\_tech](https://forums.percona.com/u/ancient_tech)\
**Post date:** [April 4, 2014, 7:04am UTC](https://forums.percona.com/t/pt-query-digest-and-5-6-binlog/3330/4 "2014-04-04T07:04:54Z")

</div>

HI,  
Yes its new in 5.6. We run 5.6.16 at the moment.

mysqlbinlog --version  
mysqlbinlog Ver 3.4 for Linux at x86\_64

Brgds
