From ea4dfa760508889cc49d551f0f3a78912196f455 Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Fri, 1 Feb 2013 10:58:27 -0700 Subject: [PATCH] Add Error_msg (but no Error_no) when client closes connection during handshake. --- bin/pt-query-digest | 1 + lib/MySQLProtocolParser.pm | 1 + t/lib/MySQLProtocolParser.t | 2 ++ t/pt-query-digest/samples/tcpdump044_report.txt | 1 + 4 files changed, 5 insertions(+) diff --git a/bin/pt-query-digest b/bin/pt-query-digest index f0e88487..a2ad132f 100755 --- a/bin/pt-query-digest +++ b/bin/pt-query-digest @@ -3140,6 +3140,7 @@ sub parse_event { arg => 'administrator command: Connect', ts => $packet->{ts}, }; + $session->{attribs}->{Error_msg} = 'Client closed connection during handshake'; $event = $self->_make_event($event, $packet, $session); delete $self->{sessions}->{$session->{client}}; return $event; diff --git a/lib/MySQLProtocolParser.pm b/lib/MySQLProtocolParser.pm index 2d02a14e..8b896467 100644 --- a/lib/MySQLProtocolParser.pm +++ b/lib/MySQLProtocolParser.pm @@ -348,6 +348,7 @@ sub parse_event { arg => 'administrator command: Connect', ts => $packet->{ts}, }; + $session->{attribs}->{Error_msg} = 'Client closed connection during handshake'; $event = $self->_make_event($event, $packet, $session); delete $self->{sessions}->{$session->{client}}; return $event; diff --git a/t/lib/MySQLProtocolParser.t b/t/lib/MySQLProtocolParser.t index 9d66d535..e63d2647 100644 --- a/t/lib/MySQLProtocolParser.t +++ b/t/lib/MySQLProtocolParser.t @@ -1708,6 +1708,7 @@ test_protocol_parser( pos_in_log => undef, ts => '130124 12:55:48.274417', user => undef, + Error_msg => 'Client closed connection during handshake', } ], ); @@ -1739,6 +1740,7 @@ test_protocol_parser( pos_in_log => undef, ts => '130122 09:55:57.793375', user => undef, + Error_msg => 'Client closed connection during handshake', }, ], ); diff --git a/t/pt-query-digest/samples/tcpdump044_report.txt b/t/pt-query-digest/samples/tcpdump044_report.txt index c96017ea..6bcaf043 100644 --- a/t/pt-query-digest/samples/tcpdump044_report.txt +++ b/t/pt-query-digest/samples/tcpdump044_report.txt @@ -21,6 +21,7 @@ # Query size 100 30 30 30 30 30 0 30 # Warning coun 0 0 0 0 0 0 0 0 # String: +# Error msg Client closed connection during handshake # Hosts 100.0.0.2 # Query_time distribution # 1us