mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-04 19:37:49 +00:00
Compare commits
5 Commits
PT-1800_PT
...
PT-1900
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c874287220 | ||
![]() |
f8683b76fa | ||
![]() |
b309b23222 | ||
![]() |
3f20158067 | ||
![]() |
af0f6db9f2 |
@@ -1307,11 +1307,6 @@ Include the following information in your bug report:
|
||||
If possible, include debugging output by running the tool with C<PTDEBUG>;
|
||||
see L<"ENVIRONMENT">.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 DOWNLOADING
|
||||
|
||||
Visit L<http://www.percona.com/software/percona-toolkit/> to download the
|
||||
|
@@ -8571,11 +8571,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -5832,11 +5832,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -5624,11 +5624,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -5596,11 +5596,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
This tool requires Perl v5.8.0 or newer and the F</proc> filesystem, unless
|
||||
|
@@ -5685,11 +5685,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -1567,11 +1567,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -5046,11 +5046,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -1565,8 +1565,8 @@ $bal = qr/
|
||||
|
||||
my $olc_re = qr/(?:--|#)[^'"\r\n]*(?=[\r\n]|\Z)/; # One-line comments
|
||||
my $mlc_re = qr#/\*[^!].*?\*/#sm; # But not /*!version */
|
||||
my $vlc_re = qr#/\*.*?[0-9+].*?\*/#sm; # For SHOW + /*!version */
|
||||
my $vlc_rf = qr#^(SHOW).*?/\*![0-9+].*?\*/#sm; # Variation for SHOW
|
||||
my $vlc_re = qr#/\*.*?[0-9]+.*?\*/#sm; # For SHOW + /*!version */
|
||||
my $vlc_rf = qr#^(?:SHOW).*?/\*![0-9]+(.*?)\*/#sm; # Variation for SHOW
|
||||
|
||||
|
||||
sub new {
|
||||
@@ -1581,7 +1581,8 @@ sub strip_comments {
|
||||
$query =~ s/$mlc_re//go;
|
||||
$query =~ s/$olc_re//go;
|
||||
if ( $query =~ m/$vlc_rf/i ) { # contains show + version
|
||||
$query =~ s/$vlc_re//go;
|
||||
my $qualifier = $1 || '';
|
||||
$query =~ s/$vlc_re/$qualifier/go;
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
@@ -1652,9 +1653,15 @@ sub fingerprint {
|
||||
$query =~ s/\Ause \S+\Z/use ?/i # Abstract the DB in USE
|
||||
&& return $query;
|
||||
|
||||
$query =~ s/\\["']//g; # quoted strings
|
||||
$query =~ s/".*?"/?/sg; # quoted strings
|
||||
$query =~ s/'.*?'/?/sg; # quoted strings
|
||||
$query =~ s/([^\\])(\\')/$1/sg;
|
||||
$query =~ s/([^\\])(\\")/$1/sg;
|
||||
$query =~ s/\\\\//sg;
|
||||
$query =~ s/\\'//sg;
|
||||
$query =~ s/\\"//sg;
|
||||
$query =~ s/([^\\])(".*?[^\\]?")/$1?/sg;
|
||||
$query =~ s/([^\\])('.*?[^\\]?')/$1?/sg;
|
||||
|
||||
$query =~ s/\bfalse\b|\btrue\b/?/isg; # boolean values
|
||||
|
||||
if ( $self->{match_md5_checksums} ) {
|
||||
$query =~ s/([._-])[a-f0-9]{32}/$1?/g;
|
||||
@@ -1704,6 +1711,13 @@ sub distill_verbs {
|
||||
$query =~ m/\A\s*UNLOCK TABLES/i && return "UNLOCK";
|
||||
$query =~ m/\A\s*xa\s+(\S+)/i && return "XA_$1";
|
||||
|
||||
if ( $query =~ m/\A\s*LOAD/i ) {
|
||||
my ($tbl) = $query =~ m/INTO TABLE\s+(\S+)/i;
|
||||
$tbl ||= '';
|
||||
$tbl =~ s/`//g;
|
||||
return "LOAD DATA $tbl";
|
||||
}
|
||||
|
||||
if ( $query =~ m/\Aadministrator command:/ ) {
|
||||
$query =~ s/administrator command:/ADMIN/;
|
||||
$query = uc $query;
|
||||
@@ -1716,7 +1730,7 @@ sub distill_verbs {
|
||||
PTDEBUG && _d($query);
|
||||
|
||||
$query = uc $query;
|
||||
$query =~ s/\s+(?:GLOBAL|SESSION|FULL|STORAGE|ENGINE)\b/ /g;
|
||||
$query =~ s/\s+(?:SESSION|FULL|STORAGE|ENGINE)\b/ /g;
|
||||
$query =~ s/\s+COUNT[^)]+\)//g;
|
||||
|
||||
$query =~ s/\s+(?:FOR|FROM|LIKE|WHERE|LIMIT|IN)\b.+//ms;
|
||||
@@ -1731,6 +1745,7 @@ sub distill_verbs {
|
||||
eval $QueryParser::tbl_ident;
|
||||
my ( $dds ) = $query =~ /^\s*($QueryParser::data_def_stmts)\b/i;
|
||||
if ( $dds) {
|
||||
$query =~ s/\s+IF(?:\s+NOT)?\s+EXISTS/ /i;
|
||||
my ( $obj ) = $query =~ m/$dds.+(DATABASE|TABLE)\b/i;
|
||||
$obj = uc $obj if $obj;
|
||||
PTDEBUG && _d('Data def statment:', $dds, 'obj:', $obj);
|
||||
@@ -1797,6 +1812,9 @@ sub distill {
|
||||
map { $verbs =~ s/$_/$alias_for{$_}/ } keys %alias_for;
|
||||
$query = $verbs;
|
||||
}
|
||||
elsif ( $verbs && $verbs =~ m/^LOAD DATA/ ) {
|
||||
return $verbs;
|
||||
}
|
||||
else {
|
||||
my @tables = $self->__distill_tables($query, $table, %args);
|
||||
$query = join(q{ }, $verbs, @tables);
|
||||
@@ -2159,11 +2177,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -4608,11 +4608,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -7306,11 +7306,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -2520,9 +2520,13 @@ sub fingerprint {
|
||||
$query =~ s/\Ause \S+\Z/use ?/i # Abstract the DB in USE
|
||||
&& return $query;
|
||||
|
||||
$query =~ s/\\["']//g; # quoted strings
|
||||
$query =~ s/".*?"/?/sg; # quoted strings
|
||||
$query =~ s/'.*?'/?/sg; # quoted strings
|
||||
$query =~ s/([^\\])(\\')/$1/sg;
|
||||
$query =~ s/([^\\])(\\")/$1/sg;
|
||||
$query =~ s/\\\\//sg;
|
||||
$query =~ s/\\'//sg;
|
||||
$query =~ s/\\"//sg;
|
||||
$query =~ s/([^\\])(".*?[^\\]?")/$1?/sg;
|
||||
$query =~ s/([^\\])('.*?[^\\]?')/$1?/sg;
|
||||
|
||||
$query =~ s/\bfalse\b|\btrue\b/?/isg; # boolean values
|
||||
|
||||
@@ -7615,11 +7619,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -1075,11 +1075,6 @@ Include the following information in your bug report:
|
||||
If possible, include debugging output by running the tool with C<PTDEBUG>;
|
||||
see L<"ENVIRONMENT">.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 DOWNLOADING
|
||||
|
||||
Visit L<http://www.percona.com/software/percona-toolkit/> to download the
|
||||
|
15
bin/pt-kill
15
bin/pt-kill
@@ -4911,9 +4911,13 @@ sub fingerprint {
|
||||
$query =~ s/\Ause \S+\Z/use ?/i # Abstract the DB in USE
|
||||
&& return $query;
|
||||
|
||||
$query =~ s/\\["']//g; # quoted strings
|
||||
$query =~ s/".*?"/?/sg; # quoted strings
|
||||
$query =~ s/'.*?'/?/sg; # quoted strings
|
||||
$query =~ s/([^\\])(\\')/$1/sg;
|
||||
$query =~ s/([^\\])(\\")/$1/sg;
|
||||
$query =~ s/\\\\//sg;
|
||||
$query =~ s/\\'//sg;
|
||||
$query =~ s/\\"//sg;
|
||||
$query =~ s/([^\\])(".*?[^\\]?")/$1?/sg;
|
||||
$query =~ s/([^\\])('.*?[^\\]?')/$1?/sg;
|
||||
|
||||
$query =~ s/\bfalse\b|\btrue\b/?/isg; # boolean values
|
||||
|
||||
@@ -8486,11 +8490,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -752,11 +752,6 @@ Include the following information in your bug report:
|
||||
If possible, include debugging output by running the tool with C<PTDEBUG>;
|
||||
see L<"ENVIRONMENT">.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 DOWNLOADING
|
||||
|
||||
Visit L<http://www.percona.com/software/percona-toolkit/> to download the
|
||||
|
@@ -3237,11 +3237,6 @@ Include the following information in your bug report:
|
||||
If possible, include debugging output by running the tool with C<PTDEBUG>;
|
||||
see L<"ENVIRONMENT">.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 DOWNLOADING
|
||||
|
||||
Visit L<http://www.percona.com/software/percona-toolkit/> to download the
|
||||
|
@@ -13345,11 +13345,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 EXIT STATUS
|
||||
|
||||
INVALID_PARAMETERS = 1
|
||||
|
@@ -844,11 +844,6 @@ Include the following information in your bug report:
|
||||
If possible, include debugging output by running the tool with C<PTDEBUG>;
|
||||
see L<"ENVIRONMENT">.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 DOWNLOADING
|
||||
|
||||
Visit L<http://www.percona.com/software/percona-toolkit/> to download the
|
||||
|
@@ -2945,9 +2945,13 @@ sub fingerprint {
|
||||
$query =~ s/\Ause \S+\Z/use ?/i # Abstract the DB in USE
|
||||
&& return $query;
|
||||
|
||||
$query =~ s/\\["']//g; # quoted strings
|
||||
$query =~ s/".*?"/?/sg; # quoted strings
|
||||
$query =~ s/'.*?'/?/sg; # quoted strings
|
||||
$query =~ s/([^\\])(\\')/$1/sg;
|
||||
$query =~ s/([^\\])(\\")/$1/sg;
|
||||
$query =~ s/\\\\//sg;
|
||||
$query =~ s/\\'//sg;
|
||||
$query =~ s/\\"//sg;
|
||||
$query =~ s/([^\\])(".*?[^\\]?")/$1?/sg;
|
||||
$query =~ s/([^\\])('.*?[^\\]?')/$1?/sg;
|
||||
|
||||
$query =~ s/\bfalse\b|\btrue\b/?/isg; # boolean values
|
||||
|
||||
@@ -16759,11 +16763,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -2532,11 +2532,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -1193,11 +1193,6 @@ Include the following information in your bug report:
|
||||
If possible, include debugging output by running the tool with C<PTDEBUG>;
|
||||
see L<"ENVIRONMENT">.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 DOWNLOADING
|
||||
|
||||
Visit L<http://www.percona.com/software/percona-toolkit/> to download the
|
||||
|
@@ -4907,11 +4907,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -4442,11 +4442,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -6078,11 +6078,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -2367,11 +2367,6 @@ Include the following information in your bug report:
|
||||
If possible, include debugging output by running the tool with C<PTDEBUG>;
|
||||
see L<"ENVIRONMENT">.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 DOWNLOADING
|
||||
|
||||
Visit L<http://www.percona.com/software/percona-toolkit/> to download the
|
||||
|
@@ -2671,11 +2671,6 @@ Include the following information in your bug report:
|
||||
If possible, include debugging output by running the tool with C<PTDEBUG>;
|
||||
see L<"ENVIRONMENT">.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 DOWNLOADING
|
||||
|
||||
Visit L<http://www.percona.com/software/percona-toolkit/> to download the
|
||||
|
@@ -14097,11 +14097,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -12951,11 +12951,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -2946,9 +2946,13 @@ sub fingerprint {
|
||||
$query =~ s/\Ause \S+\Z/use ?/i # Abstract the DB in USE
|
||||
&& return $query;
|
||||
|
||||
$query =~ s/\\["']//g; # quoted strings
|
||||
$query =~ s/".*?"/?/sg; # quoted strings
|
||||
$query =~ s/'.*?'/?/sg; # quoted strings
|
||||
$query =~ s/([^\\])(\\')/$1/sg;
|
||||
$query =~ s/([^\\])(\\")/$1/sg;
|
||||
$query =~ s/\\\\//sg;
|
||||
$query =~ s/\\'//sg;
|
||||
$query =~ s/\\"//sg;
|
||||
$query =~ s/([^\\])(".*?[^\\]?")/$1?/sg;
|
||||
$query =~ s/([^\\])('.*?[^\\]?')/$1?/sg;
|
||||
|
||||
$query =~ s/\bfalse\b|\btrue\b/?/isg; # boolean values
|
||||
|
||||
@@ -8430,11 +8434,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -4818,9 +4818,13 @@ sub fingerprint {
|
||||
$query =~ s/\Ause \S+\Z/use ?/i # Abstract the DB in USE
|
||||
&& return $query;
|
||||
|
||||
$query =~ s/\\["']//g; # quoted strings
|
||||
$query =~ s/".*?"/?/sg; # quoted strings
|
||||
$query =~ s/'.*?'/?/sg; # quoted strings
|
||||
$query =~ s/([^\\])(\\')/$1/sg;
|
||||
$query =~ s/([^\\])(\\")/$1/sg;
|
||||
$query =~ s/\\\\//sg;
|
||||
$query =~ s/\\'//sg;
|
||||
$query =~ s/\\"//sg;
|
||||
$query =~ s/([^\\])(".*?[^\\]?")/$1?/sg;
|
||||
$query =~ s/([^\\])('.*?[^\\]?')/$1?/sg;
|
||||
|
||||
$query =~ s/\bfalse\b|\btrue\b/?/isg; # boolean values
|
||||
|
||||
@@ -11363,11 +11367,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -6177,11 +6177,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -3222,11 +3222,6 @@ To enable debugging and capture all output to a file, run the tool like:
|
||||
Be careful: debugging output is voluminous and can generate several megabytes
|
||||
of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
You need Perl, DBI, DBD::mysql, and some core packages that ought to be
|
||||
|
@@ -173,9 +173,17 @@ sub fingerprint {
|
||||
$query =~ s/\Ause \S+\Z/use ?/i # Abstract the DB in USE
|
||||
&& return $query;
|
||||
|
||||
$query =~ s/\\["']//g; # quoted strings
|
||||
$query =~ s/".*?"/?/sg; # quoted strings
|
||||
$query =~ s/'.*?'/?/sg; # quoted strings
|
||||
# -----------------------------------------------------------
|
||||
# Remove quoted strings
|
||||
# -----------------------------------------------------------
|
||||
$query =~ s/([^\\])(\\')/$1/sg;
|
||||
$query =~ s/([^\\])(\\")/$1/sg;
|
||||
$query =~ s/\\\\//sg;
|
||||
$query =~ s/\\'//sg;
|
||||
$query =~ s/\\"//sg;
|
||||
$query =~ s/([^\\])(".*?[^\\]?")/$1?/sg;
|
||||
$query =~ s/([^\\])('.*?[^\\]?')/$1?/sg;
|
||||
# -----------------------------------------------------------
|
||||
|
||||
$query =~ s/\bfalse\b|\btrue\b/?/isg; # boolean values
|
||||
|
||||
@@ -218,8 +226,8 @@ sub fingerprint {
|
||||
$query =~ s/\blimit \?(?:, ?\?| offset \?)?/limit ?/; # LIMIT
|
||||
# The following are disabled because of speed issues. Should we try to
|
||||
# normalize whitespace between and around operators? My gut feeling is no.
|
||||
# $query =~ s/ , | ,|, /,/g; # Normalize commas
|
||||
# $query =~ s/ = | =|= /=/g; # Normalize equals
|
||||
# $query =~ s/ , | ,|, /,/g; # Normalize commas
|
||||
# $query =~ s/ = | =|= /=/g; # Normalize equals
|
||||
# $query =~ s# [,=+*/-] ?|[,=+*/-] #+#g; # Normalize operators
|
||||
|
||||
# Remove ASC keywords from ORDER BY clause so these queries fingerprint
|
||||
|
@@ -162,7 +162,7 @@ is(
|
||||
# This is a known deficiency, fixes seem to be expensive though.
|
||||
is(
|
||||
$qr->fingerprint("select '\\\\' from foo"),
|
||||
"select '\\ from foo",
|
||||
"select ? from foo",
|
||||
"Does not handle all quoted strings",
|
||||
);
|
||||
|
||||
@@ -1478,6 +1478,19 @@ is(
|
||||
"Fingerprint db.tbl<number>name (preserve number)"
|
||||
);
|
||||
|
||||
is(
|
||||
$qr->fingerprint(
|
||||
"SELECT i FROM d.t WHERE i=\"3\""
|
||||
),
|
||||
"select i from d.t where i=?",
|
||||
"Fingerprint db.tbl<number>name (preserve number)"
|
||||
);
|
||||
|
||||
is(
|
||||
$qr->fingerprint("CALL foo(1, 2, 3)"),
|
||||
"call foo",
|
||||
'Fingerprints stored procedure calls specially',
|
||||
);
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
|
@@ -259,7 +259,7 @@ SELECT `SCHEMA_NAME` FROM `INFORMATION_SCHEMA`.`SCHEMATA`, (SELECT DB_first_leve
|
||||
# EXPLAIN /*!50100 PARTITIONS*/
|
||||
SELECT USER()\G
|
||||
|
||||
# Query 12: 0 QPS, 0x concurrency, ID 0x75A885FE43F31908754B91A2F3BD1E20 at byte 1082
|
||||
# Query 12: 0 QPS, 0x concurrency, ID 0x15BF4DCE0B364CE831C14D6853A472B7 at byte 1082
|
||||
# This item is included in the report because it matches --limit.
|
||||
# Scores: V/M = 0.00
|
||||
# Time range: all events occurred at 2016-06-07T19:07:02.565999Z
|
||||
@@ -303,4 +303,4 @@ SELECT 1 FROM (SELECT `GRANTEE`, `IS_GRANTABLE` FROM `INFORMATION_SCHEMA`.`COLUM
|
||||
# 9 0xDDABDE67AC3044CAED549F59FFFA541B 0.0000 0.0% 1 0.0000 0.00 SELECT phpmyadmin.pma__navigationhiding
|
||||
# 10 0x35CCC630581DCD5AA46100310F18DEB9 0.0000 0.0% 1 0.0000 0.00 SELECT INFORMATION_SCHEMA.SCHEMATA
|
||||
# 11 0x7B48FAA9C951DD8A389FF9DA2DF3DF62 0.0000 0.0% 1 0.0000 0.00 SELECT
|
||||
# 12 0x75A885FE43F31908754B91A2F3BD1E20 0.0000 0.0% 1 0.0000 0.00 SELECT UNION INFORMATION_SCHEMA.COLUMN_PRIVILEGES INFORMATION_SCHEMA.TABLE_PRIVILEGES INFORMATION_SCHEMA.SCHEMA_PRIVILEGES INFORMATION_SCHEMA.USER_PRIVILEGES
|
||||
# 12 0x15BF4DCE0B364CE831C14D6853A472B7 0.0000 0.0% 1 0.0000 0.00 SELECT UNION INFORMATION_SCHEMA.COLUMN_PRIVILEGES INFORMATION_SCHEMA.TABLE_PRIVILEGES INFORMATION_SCHEMA.SCHEMA_PRIVILEGES INFORMATION_SCHEMA.USER_PRIVILEGES
|
||||
|
@@ -1 +1 @@
|
||||
# Exec time 100 10s 1s 3s 2s 3s 896ms 2s
|
||||
# Exec time 100 9s 2s 4s 3s 4s 786ms 3s
|
Reference in New Issue
Block a user