Uploaded image for project: 'Percona Toolkit'
  1. Percona Toolkit
  2. PT-1793

``pt-query-digest`` was unable to handle the year 2020 because of wrong ``tcpdump`` parsing.

Details

    • Bug
    • Status: Done
    • Medium
    • Resolution: Fixed
    • 3.0.13
    • 3.2.0
    • None
    • None

    Description

      pt-query-digest --type tcpdump --limit 100 $tcpdump_result 

      If we execute this command for the result of tcpdump which ran in 2020, we cannot get correct data because of the warning below:

      Pipeline process 4 (MySQLProtocolParser) caused an error: Argument “” isn’t numeric in multiplication (*) at pt-query-digest line 4551 

      This script parses tcpdump result by \n20.
      For example,

      2020-01-09 12:17:18.690344 IP 10.127.88.228.52034 > 10.228.144.92.mysql: tcp 10         0x0000: 0123 4567 89ab cdef 2020-01-09 12:17:18.690370 IP 10.228.144.92.mysql > 10.127.88.228.52034: tcp 11 0x0000: 0123 4567 89ab cdef 

      this data is separated into

      2020-01-09 12:17:18.690344 IP 10.127.88.228.52034 > 10.228.144.92.mysql: tcp 10         0x0000: 0123 4567 89ab cdef 20 

      and

      20-01-09 12:17:18.690370 IP 10.228.144.92.mysql > 10.127.88.228.52034: tcp 11 0x0000: 0123 4567 89ab cdef 

      Then, 20 is added as a prefix by:

       $raw_packet = "20$raw_packet" unless $raw_packet =~ m/\A20/;

      But if year is 2020, this code doesn't work.

      Attachments

        Activity

          People

            carlos.salguero Carlos Salguero (Inactive)
            carlos.salguero Carlos Salguero (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Smart Checklist