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

LP #1542456: pt-query-digest is not escaping the ` char

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: On Hold
    • Priority: High
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None

      Description

      **Reported in Launchpad by Daniel Guzmán Burgos last update 28-03-2017 13:25:13

      pt-query-digest is not escaping the mysql char ` and thus failing to perform some operations like the submodule EXPLAIN

      Example:
      sudo tcpdump -s 65535 -x -nn -q -tttt -i any -c 10000 port 3306 | pt-query-digest --type tcpdump --explain u=root,h=127.0.0.1

      1. EXPLAIN failed: DBD::mysql::db do failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`yp' at line 1 [for Statement "USE `yp at /usr/bin/pt-query-digest line 7687.

      This is the function:

      sub quote {
      my ( $self, @vals ) = @_;
      foreach my $val ( @vals )

      { $val =~ s/`/``/g; }

      return join('.', map

      { '`' . $_ . '`' }

      @vals);
      }

      pt version: 2.2.16
      MySQL: Percona Server 5.6.27-75.0-log

        Smart Checklist

          Attachments

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              lpjirasync lpjirasync (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: