~percona-toolkit-dev/percona-toolkit/mysql-5.6-test-fixes

« back to all changes in this revision

Viewing changes to bin/pt-deadlock-logger

  • Committer: Brian Fraser
  • Date: 2012-12-19 16:48:24 UTC
  • Revision ID: brian.fraser@percona.com-20121219164824-jphosoi8bttwj0fn
pt-deadlock-logger: InnoDB timestamps have a different format in 5.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
3759
3759
my $n = qr/([^`\s]+)/;                # MySQL object name
3760
3760
my $u = qr/(\S+)/;                    # Username. This is somewhat wrong, but
3761
3761
                                      # usernames with spaces are rare enough.
3762
 
my $s = qr/(\d{6} .\d:\d\d:\d\d)/;    # InnoDB timestamp
 
3762
my $s = qr/((?:\d{6}|\d{4}-\d\d-\d\d) .\d:\d\d:\d\d)(?: \p{Hex}+)?/;    # InnoDB timestamp
3763
3763
 
3764
3764
# A thread's proc_info can be at least 98 different things I've found in the
3765
3765
# source.  Fortunately, most of them begin with a gerunded verb.  These are
4140
4140
 
4141
4141
   # Extract some miscellaneous data from the deadlock.
4142
4142
   my ( $ts ) = $dl_text =~ m/^$s$/m;
4143
 
   my ( $year, $mon, $day, $hour, $min, $sec ) = $ts =~ m/^(\d\d)(\d\d)(\d\d) +(\d+):(\d+):(\d+)$/;
4144
 
   $ts = sprintf('%02d-%02d-%02dT%02d:%02d:%02d', $year + 2000, $mon, $day, $hour, $min, $sec);
 
4143
   my ( $year, $mon, $day, $hour, $min, $sec ) = $ts =~ m/^((?:\d\d)?\d\d)-?(\d\d)-?(\d\d) +(\d+):(\d+):(\d+)$/;
 
4144
   if ( length($year) == 2 ) {
 
4145
      $year += 2000;
 
4146
   }
 
4147
   $ts = sprintf('%02d-%02d-%02dT%02d:%02d:%02d', $year, $mon, $day, $hour, $min, $sec);
4145
4148
   my ( $victim ) = $dl_text =~ m/^\*\*\* WE ROLL BACK TRANSACTION \((\d+)\)$/m;
4146
4149
   $victim ||= 0;
4147
4150