~percona-toolkit-dev/percona-toolkit/manual-for-pt-query-digest--type-binlog-is-ambiguous-1377888

« back to all changes in this revision

Viewing changes to bin/pt-query-digest

merged pt-table-checksum-deadlock-1287253

Show diffs side-by-side

added added

removed removed

Lines of Context:
4972
4972
}
4973
4973
 
4974
4974
my $slow_log_ts_line = qr/^# Time: ([0-9: ]{15})/;
4975
 
my $slow_log_uh_line = qr/# User\@Host: ([^\[]+|\[[^[]+\]).*?@ (\S*) \[(.*)\]/;
 
4975
my $slow_log_uh_line = qr/# User\@Host: ([^\[]+|\[[^[]+\]).*?@ (\S*) \[(.*)\]\s*(?:Id:\s*(\d+))?/;
4976
4976
my $slow_log_hd_line = qr{
4977
4977
      ^(?:
4978
4978
      T[cC][pP]\s[pP]ort:\s+\d+ # case differs on windows/unix
5036
5036
               push @properties, 'ts', $time;
5037
5037
               ++$got_ts;
5038
5038
               if ( !$got_uh
5039
 
                  && ( my ( $user, $host, $ip ) = $line =~ m/$slow_log_uh_line/o )
 
5039
                  && ( my ( $user, $host, $ip, $thread_id ) = $line =~ m/$slow_log_uh_line/o )
5040
5040
               ) {
5041
5041
                  PTDEBUG && _d("Got user, host, ip", $user, $host, $ip);
5042
5042
                  push @properties, 'user', $user, 'host', $host, 'ip', $ip;
5043
 
                  ++$got_uh;
 
5043
                  if ( $thread_id ) {  
 
5044
                     push @properties, 'Thread_id', $thread_id;
 
5045
                 }
 
5046
                 ++$got_uh;
5044
5047
               }
5045
5048
            }
5046
5049
 
5047
5050
            elsif ( !$got_uh
5048
 
                  && ( my ( $user, $host, $ip ) = $line =~ m/$slow_log_uh_line/o )
 
5051
                  && ( my ( $user, $host, $ip, $thread_id ) = $line =~ m/$slow_log_uh_line/o )
5049
5052
            ) {
5050
 
               PTDEBUG && _d("Got user, host, ip", $user, $host, $ip);
5051
 
               push @properties, 'user', $user, 'host', $host, 'ip', $ip;
 
5053
                  PTDEBUG && _d("Got user, host, ip", $user, $host, $ip);
 
5054
                  push @properties, 'user', $user, 'host', $host, 'ip', $ip;
 
5055
                  if ( $thread_id ) {       
 
5056
                     push @properties, 'Thread_id', $thread_id;
 
5057
                 }
5052
5058
               ++$got_uh;
5053
5059
            }
5054
5060