Skip to content

Instantly share code, notes, and snippets.

View kf6nux's full-sized avatar

Jen Zarzycka kf6nux

View GitHub Profile
#!/usr/bin/python
#
# Convert a Row-Based-Replication binary log to Statement-Based-Replication format, cheating a little.
# This script exists since Percona Toolkit's pt-query-digest cannot digest RBR format. The script
# generates enough for it to work with.
# Expecting standard input
# Expected input is the output of "mysqlbinlog --verbose --base64-output=DECODE-ROWS <binlog_file_name>"
# For example:
# $ mysqlbinlog --verbose --base64-output=DECODE-ROWS mysql-bin.000006 | python binlog-rbr-to-sbr.py | pt-query-digest --type=binlog --order-by Query_time:cnt --group-by fingerprint
#

Keybase proof

I hereby claim:

  • I am KF6NUX on github.
  • I am benz (https://keybase.io/benz) on keybase.
  • I have a public key whose fingerprint is 348B F5EE 9246 D4FD EE48 B2E1 323A 6A85 C71F 5415

To claim this, I am signing this object: