MySQLProtocolParser

Exporter
MySQLProtocolParser

MySQLProtocolParser parses MySQL events from tcpdump files.  The packets come from TcpdumpParser.  MySQLProtocolParse::parse_packet() should be first in the callback chain because it creates events for subsequent callbacks.  So the sequence is: 1. mk-query-digest calls TcpdumpParser::parse_event($fh, ..., @callbacks) 2.  TcpdumpParser::parse_event() extracts raw MySQL packets from $fh and passes them to the callbacks, the first of which is MySQLProtocolParser::parse_packet().  3. MySQLProtocolParser::parse_packet() makes events from the packets and returns them to TcpdumpParser::parse_event().  4. TcpdumpParser::parse_event() passes the newly created events to the subsequent callbacks.  At times MySQLProtocolParser::parse_packet() will not return an event because it usually takes a few packets to create one event.  In such cases, TcpdumpParser::parse_event() will not call the other callbacks.

Variables

%EXPORT_TAGS

our %EXPORT_TAGS

@EXPORT

our @EXPORT

@EXPORT_OK

our @EXPORT_OK

%com_for

my %com_for

%flag_for

my %flag_for

%type_for

my %type_for

%unpack_type

my %unpack_type

Functions

new

sub new

parse_event

sub parse_event

_packet_from_server

sub _packet_from_server

_packet_from_client

sub _packet_from_client

_make_event

sub _make_event

tcp_timestamp

sub tcp_timestamp

timestamp_diff

sub timestamp_diff

to_string

sub to_string

unpack_string

sub unpack_string

decode_len

sub decode_len

to_num

sub to_num

to_double

sub to_double

get_lcb

sub get_lcb

parse_error_packet

sub parse_error_packet

parse_ok_packet

sub parse_ok_packet

parse_ok_prepared_statement_packet

sub parse_ok_prepared_statement_packet

parse_server_handshake_packet

sub parse_server_handshake_packet

parse_client_handshake_packet

sub parse_client_handshake_packet

parse_com_packet

sub parse_com_packet

parse_execute_packet

sub parse_execute_packet

get_sth_id

sub get_sth_id

parse_flags

sub parse_flags

uncompress_data

sub uncompress_data

detect_compression

sub detect_compression

uncompress_packet

sub uncompress_packet

remove_mysql_header

sub remove_mysql_header

_get_errors_fh

sub _get_errors_fh

fail_session

sub fail_session
our %EXPORT_TAGS
our @EXPORT
our @EXPORT_OK
my %com_for
my %flag_for
my %type_for
my %unpack_type
sub new
sub parse_event
sub _packet_from_server
sub _packet_from_client
sub _make_event
sub tcp_timestamp
sub timestamp_diff
sub to_string
sub unpack_string
sub decode_len
sub to_num
sub to_double
sub get_lcb
sub parse_error_packet
sub parse_ok_packet
sub parse_ok_prepared_statement_packet
sub parse_server_handshake_packet
sub parse_client_handshake_packet
sub parse_com_packet
sub parse_execute_packet
sub get_sth_id
sub parse_flags
sub uncompress_data
sub detect_compression
sub uncompress_packet
sub remove_mysql_header
sub _get_errors_fh
sub fail_session
Close