Skip to content
/ unhex Public

Converts binary strings in MySQL slow log into hex values for easier post-processing

License

Notifications You must be signed in to change notification settings

dbnski/unhex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unhex

A minimal C utility that transforms binary strings in MySQL log files into their hexadecimal representation.

Features

  • Detects 'binstring', binary 'binstring', and _binary 'binstring' patterns and replaces them with 0x<hex> format
  • Handles escape sequences (\\, \', \", \0, etc.)

Notes

  • Aborts conversion if a string exceeds 256 bytes leaving the original version (adjustable through defines)
  • Full-line comments are preserved unchanged regardless their content

Build

make

Usage

$ echo "SELECT * FROM table WHERE id = _binary 'abcdefghijklmnop';" | ./unhex
SELECT * FROM table WHERE id = 0x6162636465666768696a6b6c6d6e6f70;

About

Converts binary strings in MySQL slow log into hex values for easier post-processing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published