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

pt-upgrade fails when query including format strings and SQL errors is given

Details

    • 0

    Description

      pt-upgrade fails when a query including format strings and SQL errors is given.

      Assume that, for example, we have a raw log file including a single line

      SELECT '%s', A
      

      and then execute the following:

      pt-upgrade $RAW_LOG_FILE h=$HOST1,u=$USER1,p=$PASS1 h=$HOST2,u=$USER2,p=$PASS2 --type rawlog
      

      Then, we will get the following error:

      > pt-upgrade debug.sql h=127.0.0.1,p=root,u=mysql h=127.0.0.1,p=root,u=mysql --type rawlog
      
      #-----------------------------------------------------------------------
      # Logs
      #-----------------------------------------------------------------------
      
      File: debug.sql
      Size: 15
      
      #-----------------------------------------------------------------------
      # Hosts
      #-----------------------------------------------------------------------
      
      host1:
      
        DSN:       h=127.0.0.1
        hostname:  09919a165973
        MySQL:     MySQL Community Server (GPL) 5.7.28
      
      host2:
      
        DSN:       h=127.0.0.1
        hostname:  09919a165973
        MySQL:     MySQL Community Server (GPL) 5.7.28
      
      ########################################################################
      # Query class 56A6741F24C4C3EF
      ########################################################################
      
      Reporting class because it has SQL errors, but hasn't been reported yet.
      
      Total queries      1
      Unique queries     1
      Discarded queries  0
      
      select ?, a
      
      ##
      ## SQL errors: 1
      ##
      
      -- 1.
      $VAR1 = {
        discarded => 0,
        errors => [],
        failures => [
          [
            'SELECT \'%s\', A',
            'DBD::mysql::st execute failed: Unknown column \'A\' in \'field list\' [for Statement "SELECT \'%s\', A"]',
            'DBD::mysql::st execute failed: Unknown column \'A\' in \'field list\' [for Statement "SELECT \'%s\', A"]'
          ]
        ],
        fingerprint => 'select ?, a',
        id => '56A6741F24C4C3EF',
        query_time_diffs => [],
        row_diffs => [],
        total_queries => 1,
        unique_queries => {
          'SELECT \'%s\', A' => 1
        },
        warning_diffs => []
      };
      Error reporting query class 56A6741F24C4C3EF: Missing argument in printf at /usr/local/Cellar/percona-toolkit/3.2.0/libexec/bin/pt-upgrade line 6162.
      
      #-----------------------------------------------------------------------
      # Stats
      #-----------------------------------------------------------------------
      
      failed_queries        1
      not_select            0
      queries_filtered      0
      queries_no_diffs      0
      queries_read          1
      queries_with_diffs    0
      queries_with_errors   0
      

      I think that this bug is independent from MySQL server versions.

      Attachments

        Issue Links

          Activity

            People

              carlos.salguero Carlos Salguero (Inactive)
              nayuta-yanagisawa Nayuta Yanagisawa
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Smart Checklist