bug-1402776 WIP. Still need to write a test

This commit is contained in:
Carlos Salguero
2016-06-08 22:43:42 -03:00
parent fa2c208754
commit 3b72a02761

View File

@@ -4706,11 +4706,14 @@ sub parse_client_handshake_packet {
return;
}
my $code_len = hex($buff_len);
my $code_len = hex($buff_len);
# The (.*?)00.?\Z part in the regex, is to remove an erroneous
# null char + mysql_native_password after the db name
# https://bugs.launchpad.net/percona-toolkit/+bug/1402776
my ( $db ) = $data =~ m!
^.{64}${user}00.. # Everything matched before
(?:..){$code_len} # The scramble buffer
(.*)00\Z # The database name
(.*?)00.*\Z # The database name
!x;
my $pkt = {
user => to_string($user),