mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-02 10:36:28 +00:00
Add final newlines and remove trailing spaces (#672)
* Add final newlines and remove trailing spaces * Replace TAB characters with spaces * Fix indent
This commit is contained in:
@@ -187,4 +187,4 @@ Run `make test`
|
||||
|
||||
#### Stopping the Sandbox
|
||||
|
||||
Run `make env-down`
|
||||
Run `make env-down`
|
||||
|
@@ -1309,7 +1309,7 @@ see L<"ENVIRONMENT">.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 DOWNLOADING
|
||||
|
@@ -6630,9 +6630,9 @@ sub main {
|
||||
. ($o->get('replace') ? ' REPLACE' : '')
|
||||
. ($o->get('ignore') ? ' IGNORE' : '')
|
||||
. " INTO TABLE $dst->{db_tbl}"
|
||||
. ($got_charset ? "CHARACTER SET $got_charset" :
|
||||
( $src->{info}->{charset} && $src->{info}->{charset} =~ /utf/ ?
|
||||
"CHARACTER SET utf8mb4" : "" ))
|
||||
. ($got_charset ? "CHARACTER SET $got_charset" :
|
||||
( $src->{info}->{charset} && $src->{info}->{charset} =~ /utf/ ?
|
||||
"CHARACTER SET utf8mb4" : "" ))
|
||||
. "("
|
||||
. join(",", map { $q->quote($_) } @{$ins_stmt->{cols}} )
|
||||
. ")";
|
||||
@@ -6809,10 +6809,10 @@ sub main {
|
||||
require File::Temp;
|
||||
$bulkins_file = File::Temp->new( SUFFIX => 'pt-archiver' )
|
||||
or die "Cannot open temp file: $OS_ERROR\n";
|
||||
if ( !$charset && $src->{info}->{charset}
|
||||
&& $src->{info}->{charset} =~ /utf/ ) {
|
||||
binmode($bulkins_file, ':utf8')
|
||||
}
|
||||
if ( !$charset && $src->{info}->{charset}
|
||||
&& $src->{info}->{charset} =~ /utf/ ) {
|
||||
binmode($bulkins_file, ':utf8')
|
||||
}
|
||||
binmode($bulkins_file, $charset)
|
||||
or die "Cannot set $charset as an encoding for the bulk-insert "
|
||||
. "file: $OS_ERROR";
|
||||
@@ -6899,12 +6899,12 @@ sub main {
|
||||
# We have to make exception for BIT column, see PT-2114
|
||||
for my $i (0 .. $#del_slice) {
|
||||
if ($src->{info}->{type_for}->{$del_stmt->{cols}[$del_slice[$i]]} eq 'bit') {
|
||||
$del_row->bind_param($i + 1, oct('0b' . unpack('B*', @{$row}[$del_slice[$i]])), SQL_INTEGER);
|
||||
} else {
|
||||
$del_row->bind_param($i + 1, @{$row}[$del_slice[$i]]);
|
||||
}
|
||||
}
|
||||
$del_row->execute();
|
||||
$del_row->bind_param($i + 1, oct('0b' . unpack('B*', @{$row}[$del_slice[$i]])), SQL_INTEGER);
|
||||
} else {
|
||||
$del_row->bind_param($i + 1, @{$row}[$del_slice[$i]]);
|
||||
}
|
||||
}
|
||||
$del_row->execute();
|
||||
PTDEBUG && _d('Deleted', $del_row->rows, 'rows');
|
||||
$statistics{DELETE} += $del_row->rows;
|
||||
});
|
||||
@@ -7010,13 +7010,13 @@ sub main {
|
||||
# We have to make exception for BIT column, see PT-2114
|
||||
for my $i (0 .. $#bulkdel_slice) {
|
||||
if ($src->{info}->{type_for}->{$del_stmt->{cols}[$bulkdel_slice[$i]]} eq 'bit') {
|
||||
$del_row->bind_param($i + 1, oct('0b' . unpack('B*', @{$first_row}[$bulkdel_slice[$i]])), SQL_INTEGER);
|
||||
$del_row->bind_param($i + $#bulkdel_slice + 2, oct('0b' . unpack('B*', @{$lastrow}[$bulkdel_slice[$i]])), SQL_INTEGER);
|
||||
} else {
|
||||
$del_row->bind_param($i + 1, @{$first_row}[$bulkdel_slice[$i]]);
|
||||
$del_row->bind_param($i + $#bulkdel_slice + 2, @{$lastrow}[$bulkdel_slice[$i]]);
|
||||
}
|
||||
}
|
||||
$del_row->bind_param($i + 1, oct('0b' . unpack('B*', @{$first_row}[$bulkdel_slice[$i]])), SQL_INTEGER);
|
||||
$del_row->bind_param($i + $#bulkdel_slice + 2, oct('0b' . unpack('B*', @{$lastrow}[$bulkdel_slice[$i]])), SQL_INTEGER);
|
||||
} else {
|
||||
$del_row->bind_param($i + 1, @{$first_row}[$bulkdel_slice[$i]]);
|
||||
$del_row->bind_param($i + $#bulkdel_slice + 2, @{$lastrow}[$bulkdel_slice[$i]]);
|
||||
}
|
||||
}
|
||||
$del_row->execute();
|
||||
PTDEBUG && _d('Bulk deleted', $del_row->rows, 'rows');
|
||||
$statistics{DELETE} += $del_row->rows;
|
||||
@@ -8692,7 +8692,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -5928,7 +5928,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -4754,7 +4754,7 @@ sub main {
|
||||
$dst->dbh->do($sql);
|
||||
if ( $EVAL_ERROR ) {
|
||||
_die("Cannot connect to MySQL: $EVAL_ERROR", 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5704,7 +5704,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -5608,7 +5608,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -5704,7 +5704,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -1624,7 +1624,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -5119,7 +5119,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -2188,7 +2188,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -4692,7 +4692,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -7389,7 +7389,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -7649,7 +7649,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -319,7 +319,7 @@ _parse_config_files() {
|
||||
|
||||
echo "$config_opt" | grep '^[ ]*[^#]' >/dev/null 2>&1 || continue
|
||||
|
||||
config_opt="$(echo "$config_opt" | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/[ ]*=[ ]*/=/' -e 's/\s[ ]*#.*$//')"
|
||||
config_opt="$(echo "$config_opt" | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/[ ]*=[ ]*/=/' -e 's/\s[ ]*#.*$//')"
|
||||
|
||||
[ "$config_opt" = "" ] && continue
|
||||
|
||||
@@ -1088,7 +1088,7 @@ see L<"ENVIRONMENT">.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 DOWNLOADING
|
||||
|
@@ -8595,7 +8595,7 @@ matching queries, specify both L<"--kill"> and L<"--print">.
|
||||
|
||||
group: Actions
|
||||
|
||||
Modifies the L<"--print"> behaviour and forces the query fingerprint to be
|
||||
Modifies the L<"--print"> behaviour and forces the query fingerprint to be
|
||||
displayed instead of an original query.
|
||||
|
||||
=back
|
||||
@@ -8677,7 +8677,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -360,7 +360,7 @@ _parse_config_files() {
|
||||
|
||||
echo "$config_opt" | grep '^[ ]*[^#]' >/dev/null 2>&1 || continue
|
||||
|
||||
config_opt="$(echo "$config_opt" | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/[ ]*=[ ]*/=/' -e 's/\s[ ]*#.*$//')"
|
||||
config_opt="$(echo "$config_opt" | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/[ ]*=[ ]*/=/' -e 's/\s[ ]*#.*$//')"
|
||||
|
||||
[ "$config_opt" = "" ] && continue
|
||||
|
||||
@@ -764,7 +764,7 @@ see L<"ENVIRONMENT">.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 DOWNLOADING
|
||||
|
@@ -321,7 +321,7 @@ _parse_config_files() {
|
||||
|
||||
echo "$config_opt" | grep '^[ ]*[^#]' >/dev/null 2>&1 || continue
|
||||
|
||||
config_opt="$(echo "$config_opt" | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/[ ]*=[ ]*/=/' -e 's/\s[ ]*#.*$//')"
|
||||
config_opt="$(echo "$config_opt" | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/[ ]*=[ ]*/=/' -e 's/\s[ ]*#.*$//')"
|
||||
|
||||
[ "$config_opt" = "" ] && continue
|
||||
|
||||
@@ -2353,14 +2353,14 @@ report_jemalloc_enabled() {
|
||||
echo "jemalloc is not enabled in mysql config for process with id ${pid}"
|
||||
else
|
||||
echo "jemalloc enabled in mysql config for process with id ${pid}"
|
||||
GENERAL_JEMALLOC_STATUS=1
|
||||
GENERAL_JEMALLOC_STATUS=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $GENERAL_JEMALLOC_STATUS -eq 1 ]; then
|
||||
local jemalloc_location="$(get_var "pt-summary-internal-jemalloc_location" "${variables_file}")"
|
||||
if [ -n "$jemalloc_location" ]; then
|
||||
echo "Using jemalloc from $jemalloc_location"
|
||||
echo "Using jemalloc from $jemalloc_location"
|
||||
else
|
||||
echo "Jemalloc library not found"
|
||||
fi
|
||||
@@ -2600,7 +2600,7 @@ report_mysql_summary () {
|
||||
local encrypted_tables=""
|
||||
local encrypted_tablespaces=""
|
||||
if [ -s "$dir/keyring-plugins" ]; then
|
||||
keyring_plugins="$(cat $dir/keyring-plugins)"
|
||||
keyring_plugins="$(cat $dir/keyring-plugins)"
|
||||
fi
|
||||
if [ -s "$dir/encrypted-tables" ]; then
|
||||
encrypted_tables="$(cat $dir/encrypted-tables)"
|
||||
@@ -3323,7 +3323,7 @@ see L<"ENVIRONMENT">.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 DOWNLOADING
|
||||
|
@@ -8852,7 +8852,7 @@ sub main {
|
||||
my $slaves =$ms->get_slaves(
|
||||
dbh => $cxn->dbh(),
|
||||
dsn => $cxn->dsn(),
|
||||
slaves => $slaves,
|
||||
slaves => $slaves,
|
||||
make_cxn => sub {
|
||||
return $make_cxn->(
|
||||
@_,
|
||||
@@ -8871,7 +8871,7 @@ sub main {
|
||||
print "Skipping slave " . $slave->description() . "\n";
|
||||
$is_skip = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$is_skip) {
|
||||
push @$filtered_slaves, $slave;
|
||||
@@ -11243,9 +11243,9 @@ sub rebuild_constraints {
|
||||
code => sub {
|
||||
PTDEBUG && _d("SET foreign_key_checks=0");
|
||||
$cxn->dbh()->do("SET foreign_key_checks=0");
|
||||
PTDEBUG && _d($sql);
|
||||
PTDEBUG && _d($sql);
|
||||
$cxn->dbh()->do($sql);
|
||||
PTDEBUG && _d("SET foreign_key_checks=1");
|
||||
PTDEBUG && _d("SET foreign_key_checks=1");
|
||||
$cxn->dbh()->do("SET foreign_key_checks=1");
|
||||
$stats->{rebuilt_constraint}++;
|
||||
},
|
||||
@@ -13368,7 +13368,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 EXIT STATUS
|
||||
|
@@ -362,7 +362,7 @@ _parse_config_files() {
|
||||
|
||||
echo "$config_opt" | grep '^[ ]*[^#]' >/dev/null 2>&1 || continue
|
||||
|
||||
config_opt="$(echo "$config_opt" | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/[ ]*=[ ]*/=/' -e 's/\s[ ]*#.*$//')"
|
||||
config_opt="$(echo "$config_opt" | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/[ ]*=[ ]*/=/' -e 's/\s[ ]*#.*$//')"
|
||||
|
||||
[ "$config_opt" = "" ] && continue
|
||||
|
||||
@@ -857,7 +857,7 @@ see L<"ENVIRONMENT">.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 DOWNLOADING
|
||||
|
@@ -5892,8 +5892,8 @@ sub top_events {
|
||||
my ( $self, %args ) = @_;
|
||||
my $classes = $self->{result_classes};
|
||||
my @sorted = reverse sort { # Sorted list of $groupby values
|
||||
($classes->{$a}->{$args{attrib}}->{$args{orderby}}
|
||||
== $classes->{$b}->{$args{attrib}}->{$args{orderby}})
|
||||
($classes->{$a}->{$args{attrib}}->{$args{orderby}}
|
||||
== $classes->{$b}->{$args{attrib}}->{$args{orderby}})
|
||||
? $a cmp $b
|
||||
: $classes->{$a}->{$args{attrib}}->{$args{orderby}}
|
||||
<=> $classes->{$b}->{$args{attrib}}->{$args{orderby}}
|
||||
@@ -13212,7 +13212,7 @@ sub main {
|
||||
$aux_dsn = $dp->parse(splice(@ARGV, $i, 1));
|
||||
last;
|
||||
}
|
||||
|
||||
|
||||
# Frequently used options.
|
||||
my $review_dsn = handle_special_defaults($o, 'review');
|
||||
my $history_dsn = handle_special_defaults($o, 'history');
|
||||
@@ -13223,7 +13223,7 @@ sub main {
|
||||
&& !$o->got('order-by') ) {
|
||||
@orderby = 'Query_time:cnt';
|
||||
}
|
||||
else {
|
||||
else {
|
||||
@orderby = @{$o->get('order-by')};
|
||||
}
|
||||
|
||||
@@ -13264,7 +13264,7 @@ sub main {
|
||||
$o->set('order-by', \@orderby);
|
||||
|
||||
my $run_time_mode = lc $o->get('run-time-mode');
|
||||
my $run_time_interval;
|
||||
my $run_time_interval;
|
||||
eval {
|
||||
$run_time_interval = verify_run_time(
|
||||
run_mode => $run_time_mode,
|
||||
@@ -13320,7 +13320,7 @@ sub main {
|
||||
my %dsn_without_Dt = %$review_dsn;
|
||||
delete $dsn_without_Dt{D};
|
||||
delete $dsn_without_Dt{t};
|
||||
|
||||
|
||||
$qv_dbh = get_cxn(
|
||||
for => '--review',
|
||||
dsn => \%dsn_without_Dt,
|
||||
@@ -13336,11 +13336,11 @@ sub main {
|
||||
|
||||
my @db_tbl = @{$review_dsn}{qw(D t)};
|
||||
my $db_tbl = $q->quote(@db_tbl);
|
||||
|
||||
|
||||
my $create_review_sql = $o->read_para_after(
|
||||
__FILE__, qr/\bMAGIC_create_review_table\b/);
|
||||
$create_review_sql =~ s/\bquery_review\b/$db_tbl/;
|
||||
|
||||
|
||||
create_review_tables(
|
||||
type => 'review',
|
||||
dbh => $qv_dbh,
|
||||
@@ -13383,7 +13383,7 @@ sub main {
|
||||
|
||||
my @hdb_tbl = @{$history_dsn}{qw(D t)};
|
||||
my $hdb_tbl = $q->quote(@hdb_tbl);
|
||||
|
||||
|
||||
my $create_history_sql = $o->read_para_after(
|
||||
__FILE__, qr/\bMAGIC_create_history_table\b/);
|
||||
$create_history_sql =~ s/\bquery_history\b/$hdb_tbl/;
|
||||
@@ -13396,7 +13396,7 @@ sub main {
|
||||
create_table => $o->get('create-history-table'),
|
||||
TableParser => $tp,
|
||||
);
|
||||
|
||||
|
||||
my $tbl = $tp->parse($tp->get_create_table($qh_dbh, @hdb_tbl));
|
||||
my $pat = $o->read_para_after(__FILE__, qr/\bMAGIC_history_columns\b/);
|
||||
$pat =~ s/\s+//g;
|
||||
@@ -13955,7 +13955,7 @@ sub main {
|
||||
my $iter_start = $args->{iter_start} = time;
|
||||
PTDEBUG && _d('Iteration', $args->{iter},
|
||||
'started at', ts($iter_start));
|
||||
|
||||
|
||||
if ( PTDEBUG ) {
|
||||
_d("\n# Iteration $args->{iter} started at ",
|
||||
ts($iter_start), "\n");
|
||||
@@ -14267,7 +14267,7 @@ sub main {
|
||||
},
|
||||
);
|
||||
# zero admin
|
||||
|
||||
|
||||
# Filter after special attributes, like fingerprint, tables,
|
||||
# distill, etc., have been created.
|
||||
if ( $o->get('filter') ) {
|
||||
@@ -14515,7 +14515,7 @@ sub create_review_tables {
|
||||
. "created automatically. You need to create the database.\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# USE the correct db
|
||||
my $sql = "USE " . Quoter->quote($db);
|
||||
PTDEBUG && _d($sql);
|
||||
@@ -14653,7 +14653,7 @@ sub print_reports {
|
||||
ea => $eas->[$i],
|
||||
worst => $worst,
|
||||
QueryHistory => $qh,
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
if ( $o->get('timeline') ) { # --timeline
|
||||
@@ -14726,7 +14726,7 @@ sub handle_special_defaults {
|
||||
my ($D, $t) = Quoter->split_unquote($default_table);
|
||||
$dsn->{D} ||= $D;
|
||||
$dsn->{t} ||= $t;
|
||||
|
||||
|
||||
return $dsn;
|
||||
}
|
||||
|
||||
@@ -14741,7 +14741,7 @@ sub make_alt_attrib {
|
||||
'my $event = $args->{event}; ',
|
||||
"if ( exists \$event->{'$attrib'} ) { ",
|
||||
(map { "delete \$event->{'$_'}; "; } @alts),
|
||||
'return $args; }',
|
||||
'return $args; }',
|
||||
# Primary attrib doesn't exist; look for alts
|
||||
(map {
|
||||
"if ( exists \$event->{'$_'} ) { "
|
||||
@@ -14876,7 +14876,7 @@ sub update_query_review_table {
|
||||
|
||||
my $attribs = $ea->get_attributes();
|
||||
|
||||
PTDEBUG && _d('Updating query review tables');
|
||||
PTDEBUG && _d('Updating query review tables');
|
||||
|
||||
foreach my $worst_info ( @$worst ) {
|
||||
my $item = $worst_info->[0];
|
||||
@@ -14905,7 +14905,7 @@ sub update_query_history_table {
|
||||
|
||||
my $attribs = $ea->get_attributes();
|
||||
|
||||
PTDEBUG && _d('Updating query review tables');
|
||||
PTDEBUG && _d('Updating query review tables');
|
||||
|
||||
foreach my $worst_info ( @$worst ) {
|
||||
my $item = $worst_info->[0];
|
||||
@@ -15048,8 +15048,8 @@ sub sanitize_event {
|
||||
# (i.e. was not converted to text using mysqlbinlog)
|
||||
sub is_raw_binlog {
|
||||
my $filename = shift;
|
||||
|
||||
return -B $filename;
|
||||
|
||||
return -B $filename;
|
||||
}
|
||||
|
||||
sub _d {
|
||||
@@ -15236,7 +15236,7 @@ approximate concurrency for this query (calculated as a function of the timespan
|
||||
and total Query_time). Next there's a query ID. This ID is a hex version of
|
||||
the query's checksum in the database, if you're using L<"--review">. You can
|
||||
select the reviewed query's details from the database with a query like C<SELECT
|
||||
.... WHERE checksum=0xFDEA8D2993C9CAF3>.
|
||||
.... WHERE checksum=0xFDEA8D2993C9CAF3>.
|
||||
|
||||
If you are investigating the report and want to print out every sample of a
|
||||
particular query, then the following L<"--filter"> may be helpful:
|
||||
@@ -15335,7 +15335,7 @@ See also L<"--report-format">.
|
||||
|
||||
=head1 QUERY REVIEW
|
||||
|
||||
A query L<"--review"> is the process of storing all the query fingerprints
|
||||
A query L<"--review"> is the process of storing all the query fingerprints
|
||||
analyzed. This has several benefits:
|
||||
|
||||
=over
|
||||
@@ -15441,7 +15441,7 @@ Query fingerprinting accommodates many special cases, which have proven
|
||||
necessary in the real world. For example, an C<IN> list with 5 literals
|
||||
is really equivalent to one with 4 literals, so lists of literals are
|
||||
collapsed to a single one. If you find something that is not fingerprinted
|
||||
properly, please submit a bug report with a reproducible test case.
|
||||
properly, please submit a bug report with a reproducible test case.
|
||||
|
||||
Here is a list of transformations during fingerprinting, which might not
|
||||
be exhaustive:
|
||||
@@ -15523,7 +15523,7 @@ be report lines for both db and Schema.
|
||||
|
||||
=item --attribute-value-limit
|
||||
|
||||
type: int; default: 0
|
||||
type: int; default: 0
|
||||
|
||||
A sanity limit for attribute values.
|
||||
|
||||
@@ -15666,7 +15666,7 @@ file and uses its contents as the code. The file should not contain
|
||||
a shebang (#!/usr/bin/perl) line.
|
||||
|
||||
If the code returns true, the chain of callbacks continues; otherwise it ends.
|
||||
The code is the last statement in the subroutine other than C<return $event>.
|
||||
The code is the last statement in the subroutine other than C<return $event>.
|
||||
The subroutine template is:
|
||||
|
||||
sub { $event = shift; filter && return $event; }
|
||||
@@ -15871,7 +15871,7 @@ MAGIC_create_history_table
|
||||
Rows_examined_pct_95 FLOAT,
|
||||
Rows_examined_stddev FLOAT,
|
||||
Rows_examined_median FLOAT,
|
||||
-- Percona extended slowlog attributes
|
||||
-- Percona extended slowlog attributes
|
||||
-- http://www.percona.com/docs/wiki/patches:slow_extended
|
||||
Rows_affected_sum FLOAT,
|
||||
Rows_affected_min FLOAT,
|
||||
@@ -16135,7 +16135,7 @@ Port number to use for connection.
|
||||
Preserve numbers in database/table names when fingerprinting queries.
|
||||
The standard fingerprint method replaces numbers in db/tables names, making
|
||||
a query like 'SELECT * FROM db1.table2' to be fingerprinted as 'SELECT * FROM db?.table?'.
|
||||
This option changes that behaviour and the fingerprint will become
|
||||
This option changes that behaviour and the fingerprint will become
|
||||
'SELECT * FROM db1.table2'.
|
||||
|
||||
=item --processlist
|
||||
@@ -16509,7 +16509,7 @@ The type of input to parse. The permitted types are
|
||||
|
||||
Parse a binary log file that has first been converted to text using mysqlbinlog.
|
||||
|
||||
For example:
|
||||
For example:
|
||||
|
||||
mysqlbinlog mysql-bin.000441 > mysql-bin.000441.txt
|
||||
|
||||
@@ -16674,7 +16674,7 @@ done for the first time.
|
||||
|
||||
Any updates or known problems are printed to STDOUT before the tool's normal
|
||||
output. This feature should never interfere with the normal operation of the
|
||||
tool.
|
||||
tool.
|
||||
|
||||
For more information, visit L<https://www.percona.com/doc/percona-toolkit/LATEST/version-check.html>.
|
||||
|
||||
@@ -16783,7 +16783,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
@@ -16889,11 +16889,11 @@ The byte length of the C<arg>.
|
||||
|
||||
=item db
|
||||
|
||||
The current database. The value comes from USE database statements.
|
||||
The current database. The value comes from USE database statements.
|
||||
By default, C<Schema> is an alias which is automatically
|
||||
changed to C<db>; see L<"--attribute-aliases">.
|
||||
|
||||
=item fingerprint
|
||||
=item fingerprint
|
||||
|
||||
An abstracted form of the query. See L<"FINGERPRINTS">.
|
||||
|
||||
|
@@ -2589,7 +2589,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -360,7 +360,7 @@ _parse_config_files() {
|
||||
|
||||
echo "$config_opt" | grep '^[ ]*[^#]' >/dev/null 2>&1 || continue
|
||||
|
||||
config_opt="$(echo "$config_opt" | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/[ ]*=[ ]*/=/' -e 's/\s[ ]*#.*$//')"
|
||||
config_opt="$(echo "$config_opt" | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/[ ]*=[ ]*/=/' -e 's/\s[ ]*#.*$//')"
|
||||
|
||||
[ "$config_opt" = "" ] && continue
|
||||
|
||||
@@ -1205,7 +1205,7 @@ see L<"ENVIRONMENT">.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 DOWNLOADING
|
||||
|
@@ -4371,7 +4371,7 @@ sub main {
|
||||
log_file => $o->get('log'),
|
||||
pid_file => $o->get('pid'),
|
||||
daemonize => $o->get('daemonize'),
|
||||
);
|
||||
);
|
||||
$daemon->run();
|
||||
PTDEBUG && $o->get('daemonize') && _d('I am a daemon now');
|
||||
}
|
||||
@@ -4977,7 +4977,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -3974,7 +3974,7 @@ sub main {
|
||||
node => $root,
|
||||
print_node => $print_node,
|
||||
MasterSlave => $ms,
|
||||
resolve_address => $o->get('resolve-address'),
|
||||
resolve_address => $o->get('resolve-address'),
|
||||
);
|
||||
|
||||
return 0;
|
||||
@@ -4132,14 +4132,14 @@ sub print_host {
|
||||
$without_port =~ s/:\d*$//; # strip port from ip address
|
||||
my $packed = inet_aton($without_port);
|
||||
if ($packed) {
|
||||
$hostname = gethostbyaddr($packed, AF_INET);
|
||||
$hostname = gethostbyaddr($packed, AF_INET);
|
||||
}
|
||||
}
|
||||
if ($hostname) {
|
||||
print "$prefix$host ($hostname)\n";
|
||||
print "$prefix$host ($hostname)\n";
|
||||
}
|
||||
else {
|
||||
print "$prefix$host\n";
|
||||
print "$prefix$host\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4511,7 +4511,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -5141,7 +5141,7 @@ sub main {
|
||||
log_file => $o->get('log'),
|
||||
pid_file => $o->get('pid'),
|
||||
daemonize => $o->get('daemonize'),
|
||||
);
|
||||
);
|
||||
$daemon->run();
|
||||
PTDEBUG && $o->get('daemonize') && _d('I am a daemon now');
|
||||
}
|
||||
@@ -6162,7 +6162,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -373,7 +373,7 @@ _parse_config_files() {
|
||||
|
||||
echo "$config_opt" | grep '^[ ]*[^#]' >/dev/null 2>&1 || continue
|
||||
|
||||
config_opt="$(echo "$config_opt" | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/[ ]*=[ ]*/=/' -e 's/\s[ ]*#.*$//')"
|
||||
config_opt="$(echo "$config_opt" | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/[ ]*=[ ]*/=/' -e 's/\s[ ]*#.*$//')"
|
||||
|
||||
[ "$config_opt" = "" ] && continue
|
||||
|
||||
@@ -2519,7 +2519,7 @@ see L<"ENVIRONMENT">.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 DOWNLOADING
|
||||
|
@@ -328,7 +328,7 @@ _parse_config_files() {
|
||||
|
||||
echo "$config_opt" | grep '^[ ]*[^#]' >/dev/null 2>&1 || continue
|
||||
|
||||
config_opt="$(echo "$config_opt" | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/[ ]*=[ ]*/=/' -e 's/\s[ ]*#.*$//')"
|
||||
config_opt="$(echo "$config_opt" | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/[ ]*=[ ]*/=/' -e 's/\s[ ]*#.*$//')"
|
||||
|
||||
[ "$config_opt" = "" ] && continue
|
||||
|
||||
@@ -2725,7 +2725,7 @@ see L<"ENVIRONMENT">.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 DOWNLOADING
|
||||
|
@@ -13085,7 +13085,7 @@ See "Replicas using row-based replication" under L<"LIMITATIONS">.
|
||||
This option modifies the behavior of L<"--create-replicate-table"> such that the
|
||||
replicate table's upper and lower boundary columns are created with the BLOB
|
||||
data type.
|
||||
This is useful in cases where you have trouble checksumming tables with keys that
|
||||
This is useful in cases where you have trouble checksumming tables with keys that
|
||||
include a binary data type or that have non-standard character sets.
|
||||
See L<"--replicate">.
|
||||
|
||||
@@ -14068,7 +14068,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -13044,7 +13044,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -129,7 +129,7 @@ sub parse {
|
||||
foreach my $key ( keys %$opts ) {
|
||||
PTDEBUG && _d('Finding value for', $key);
|
||||
$final_props{$key} = $given_props{$key};
|
||||
if ( !defined $final_props{$key}
|
||||
if ( !defined $final_props{$key}
|
||||
&& defined $prev->{$key} && $opts->{$key}->{copy} )
|
||||
{
|
||||
$final_props{$key} = $prev->{$key};
|
||||
@@ -269,7 +269,7 @@ sub get_dbh {
|
||||
my $dbh;
|
||||
my $tries = 2;
|
||||
while ( !$dbh && $tries-- ) {
|
||||
PTDEBUG && _d($cxn_string, ' ', $user, ' ', $pass,
|
||||
PTDEBUG && _d($cxn_string, ' ', $user, ' ', $pass,
|
||||
join(', ', map { "$_=>$defaults->{$_}" } keys %$defaults ));
|
||||
|
||||
$dbh = eval { DBI->connect($cxn_string, $user, $pass, $defaults) };
|
||||
@@ -467,7 +467,7 @@ sub set_vars {
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
sub _d {
|
||||
@@ -862,7 +862,7 @@ sub extends {
|
||||
|
||||
sub _load_module {
|
||||
my ($class) = @_;
|
||||
|
||||
|
||||
(my $file = $class) =~ s{::|'}{/}g;
|
||||
$file .= '.pm';
|
||||
{ local $@; eval { require "$file" } } # or warn $@;
|
||||
@@ -893,7 +893,7 @@ sub has {
|
||||
my $caller = scalar caller();
|
||||
|
||||
my $class_metadata = Lmo::Meta->metadata_for($caller);
|
||||
|
||||
|
||||
for my $attribute ( ref $names ? @$names : $names ) {
|
||||
my %args = @_;
|
||||
my $method = ($args{is} || '') eq 'ro'
|
||||
@@ -912,16 +912,16 @@ sub has {
|
||||
|
||||
if ( my $type_check = $args{isa} ) {
|
||||
my $check_name = $type_check;
|
||||
|
||||
|
||||
if ( my ($aggregate_type, $inner_type) = $type_check =~ /\A(ArrayRef|Maybe)\[(.*)\]\z/ ) {
|
||||
$type_check = Lmo::Types::_nested_constraints($attribute, $aggregate_type, $inner_type);
|
||||
}
|
||||
|
||||
|
||||
my $check_sub = sub {
|
||||
my ($new_val) = @_;
|
||||
Lmo::Types::check_type_constraints($attribute, $type_check, $check_name, $new_val);
|
||||
};
|
||||
|
||||
|
||||
$class_metadata->{$attribute}{isa} = [$check_name, $check_sub];
|
||||
my $orig_method = $method;
|
||||
$method = sub {
|
||||
@@ -1198,7 +1198,7 @@ sub new {
|
||||
rules => [], # desc of rules for --help
|
||||
mutex => [], # rule: opts are mutually exclusive
|
||||
atleast1 => [], # rule: at least one opt is required
|
||||
disables => {}, # rule: opt disables other opts
|
||||
disables => {}, # rule: opt disables other opts
|
||||
defaults_to => {}, # rule: opt defaults to value of other opt
|
||||
DSNParser => undef,
|
||||
default_files => [
|
||||
@@ -1361,7 +1361,7 @@ sub _pod_to_specs {
|
||||
}
|
||||
|
||||
push @specs, {
|
||||
spec => $self->{parse_attributes}->($self, $option, \%attribs),
|
||||
spec => $self->{parse_attributes}->($self, $option, \%attribs),
|
||||
desc => $para
|
||||
. (defined $attribs{default} ? " (default $attribs{default})" : ''),
|
||||
group => ($attribs{'group'} ? $attribs{'group'} : 'default'),
|
||||
@@ -1452,7 +1452,7 @@ sub _parse_specs {
|
||||
$self->{opts}->{$long} = $opt;
|
||||
}
|
||||
else { # It's an option rule, not a spec.
|
||||
PTDEBUG && _d('Parsing rule:', $opt);
|
||||
PTDEBUG && _d('Parsing rule:', $opt);
|
||||
push @{$self->{rules}}, $opt;
|
||||
my @participants = $self->_get_participants($opt);
|
||||
my $rule_ok = 0;
|
||||
@@ -1497,7 +1497,7 @@ sub _parse_specs {
|
||||
PTDEBUG && _d('Option', $long, 'disables', @participants);
|
||||
}
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
sub _get_participants {
|
||||
@@ -1584,7 +1584,7 @@ sub _set_option {
|
||||
}
|
||||
|
||||
sub get_opts {
|
||||
my ( $self ) = @_;
|
||||
my ( $self ) = @_;
|
||||
|
||||
foreach my $long ( keys %{$self->{opts}} ) {
|
||||
$self->{opts}->{$long}->{got} = 0;
|
||||
@@ -1715,7 +1715,7 @@ sub _check_opts {
|
||||
else {
|
||||
$err = join(', ',
|
||||
map { "--$self->{opts}->{$_}->{long}" }
|
||||
grep { $_ }
|
||||
grep { $_ }
|
||||
@restricted_opts[0..scalar(@restricted_opts) - 2]
|
||||
)
|
||||
. ' or --'.$self->{opts}->{$restricted_opts[-1]}->{long};
|
||||
@@ -1725,7 +1725,7 @@ sub _check_opts {
|
||||
}
|
||||
|
||||
}
|
||||
elsif ( $opt->{is_required} ) {
|
||||
elsif ( $opt->{is_required} ) {
|
||||
$self->save_error("Required option --$long must be specified");
|
||||
}
|
||||
|
||||
@@ -2109,7 +2109,7 @@ sub clone {
|
||||
$clone{$scalar} = $self->{$scalar};
|
||||
}
|
||||
|
||||
return bless \%clone;
|
||||
return bless \%clone;
|
||||
}
|
||||
|
||||
sub _parse_size {
|
||||
@@ -2345,7 +2345,7 @@ sub parse_event {
|
||||
PTDEBUG && _d("Got user, host, ip", $user, $host, $ip);
|
||||
$host ||= $ip; # sometimes host is missing when using skip-name-resolve (LP #issue 1262456)
|
||||
push @properties, 'user', $user, 'host', $host, 'ip', $ip;
|
||||
if ( $thread_id ) {
|
||||
if ( $thread_id ) {
|
||||
push @properties, 'Thread_id', $thread_id;
|
||||
}
|
||||
++$got_uh;
|
||||
@@ -2358,7 +2358,7 @@ sub parse_event {
|
||||
PTDEBUG && _d("Got user, host, ip", $user, $host, $ip);
|
||||
$host ||= $ip; # sometimes host is missing when using skip-name-resolve (LP #issue 1262456)
|
||||
push @properties, 'user', $user, 'host', $host, 'ip', $ip;
|
||||
if ( $thread_id ) {
|
||||
if ( $thread_id ) {
|
||||
push @properties, 'Thread_id', $thread_id;
|
||||
}
|
||||
++$got_uh;
|
||||
@@ -2774,7 +2774,7 @@ sub value_to_json {
|
||||
|
||||
my $b_obj = B::svref_2object(\$value); # for round trip problem
|
||||
my $flags = $b_obj->FLAGS;
|
||||
return $value # as is
|
||||
return $value # as is
|
||||
if $flags & ( B::SVp_IOK | B::SVp_NOK ) and !( $flags & B::SVp_POK ); # SvTYPE is IV or NV?
|
||||
|
||||
my $type = ref($value);
|
||||
@@ -2946,17 +2946,17 @@ sub fingerprint {
|
||||
$query =~ s/\Ause \S+\Z/use ?/i # Abstract the DB in USE
|
||||
&& return $query;
|
||||
|
||||
$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/([^\\])(\\')/$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
|
||||
$query =~ s/\bfalse\b|\btrue\b/?/isg; # boolean values
|
||||
|
||||
if ( $self->{match_md5_checksums} ) {
|
||||
if ( $self->{match_md5_checksums} ) {
|
||||
$query =~ s/([._-])[a-f0-9]{32}/$1?/g;
|
||||
}
|
||||
|
||||
@@ -2968,7 +2968,7 @@ sub fingerprint {
|
||||
}
|
||||
|
||||
if ( $self->{match_md5_checksums} ) {
|
||||
$query =~ s/[xb+-]\?/?/g;
|
||||
$query =~ s/[xb+-]\?/?/g;
|
||||
}
|
||||
else {
|
||||
$query =~ s/[xb.+-]\?/?/g;
|
||||
@@ -3110,8 +3110,8 @@ sub distill {
|
||||
}
|
||||
else {
|
||||
my @tables = $self->__distill_tables($query, $table, %args);
|
||||
$query = join(q{ }, $verbs, @tables);
|
||||
}
|
||||
$query = join(q{ }, $verbs, @tables);
|
||||
}
|
||||
}
|
||||
|
||||
if ( $args{trf} ) {
|
||||
@@ -4181,7 +4181,7 @@ sub parse_select {
|
||||
my ( $self, $query ) = @_;
|
||||
|
||||
my @keywords;
|
||||
my $final_keywords = qr/(FOR UPDATE|LOCK IN SHARE MODE)/i;
|
||||
my $final_keywords = qr/(FOR UPDATE|LOCK IN SHARE MODE)/i;
|
||||
1 while $query =~ s/\s+$final_keywords/(push @keywords, $1), ''/gie;
|
||||
|
||||
my $keywords = qr/(
|
||||
@@ -4459,7 +4459,7 @@ sub parse_where {
|
||||
$op =~ s/\s+$//;
|
||||
}
|
||||
$val =~ s/^\s+//;
|
||||
|
||||
|
||||
if ( ($op || '') !~ m/IN/i && $val !~ m/^\w+\([^\)]+\)$/ ) {
|
||||
$val =~ s/\)+$//;
|
||||
}
|
||||
@@ -4844,7 +4844,7 @@ sub parse_identifier {
|
||||
else {
|
||||
die "Invalid number of parts in $type reference: $ident";
|
||||
}
|
||||
|
||||
|
||||
if ( $self->{SchemaQualifier} ) {
|
||||
if ( $type eq 'column' && !$ident_struct{tbl} ) {
|
||||
my $qcol = $self->{SchemaQualifier}->qualify_column(
|
||||
@@ -5087,7 +5087,7 @@ sub _get_tables_used_from_query_struct {
|
||||
PTDEBUG && _d("Using EXPLAIN EXTENDED to disambiguate columns");
|
||||
if ( $self->_reparse_query(%args) ) {
|
||||
return $self->_get_tables_used_from_query_struct(%args);
|
||||
}
|
||||
}
|
||||
PTDEBUG && _d('Failed to disambiguate columns');
|
||||
}
|
||||
}
|
||||
@@ -5171,7 +5171,7 @@ sub _get_tables_used_from_query_struct {
|
||||
PTDEBUG && _d("Using EXPLAIN EXTENDED to disambiguate columns");
|
||||
if ( $self->_reparse_query(%args) ) {
|
||||
return $self->_get_tables_used_from_query_struct(%args);
|
||||
}
|
||||
}
|
||||
PTDEBUG && _d('Failed to disambiguate columns');
|
||||
}
|
||||
|
||||
@@ -5228,8 +5228,8 @@ sub _get_tables_used_from_query_struct {
|
||||
"to disambiguate columns");
|
||||
if ( $self->_reparse_query(%args) ) {
|
||||
return $self->_get_tables_used_from_query_struct(%args);
|
||||
}
|
||||
PTDEBUG && _d('Failed to disambiguate columns');
|
||||
}
|
||||
PTDEBUG && _d('Failed to disambiguate columns');
|
||||
}
|
||||
|
||||
foreach my $joined_table ( @{$on_tables->{joined_tables}} ) {
|
||||
@@ -5622,7 +5622,7 @@ sub _qualify_table_name {
|
||||
}
|
||||
}
|
||||
|
||||
if ( !$db_tbl && $args{default_db} ) {
|
||||
if ( !$db_tbl && $args{default_db} ) {
|
||||
$db_tbl = "$args{default_db}.$tbl";
|
||||
}
|
||||
|
||||
@@ -5666,9 +5666,9 @@ sub _explain_query {
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
$dbh->do($sql);
|
||||
}
|
||||
|
||||
|
||||
$self->{db_version} ||= VersionParser->new($dbh);
|
||||
if ( $self->{db_version} < '5.7.3' ) {
|
||||
if ( $self->{db_version} < '5.7.3' ) {
|
||||
$sql = "EXPLAIN EXTENDED $query";
|
||||
}
|
||||
else {
|
||||
@@ -5964,7 +5964,7 @@ sub daemonize {
|
||||
|
||||
close STDERR;
|
||||
open STDERR, ">&STDOUT"
|
||||
or die "Cannot dupe STDERR to STDOUT: $OS_ERROR";
|
||||
or die "Cannot dupe STDERR to STDOUT: $OS_ERROR";
|
||||
}
|
||||
else {
|
||||
if ( -t STDOUT ) {
|
||||
@@ -6619,7 +6619,7 @@ sub split_unquote {
|
||||
s/`\z//;
|
||||
s/``/`/g;
|
||||
}
|
||||
|
||||
|
||||
return ($db, $tbl);
|
||||
}
|
||||
|
||||
@@ -6873,9 +6873,9 @@ sub parse {
|
||||
sub remove_quoted_text {
|
||||
my ($string) = @_;
|
||||
$string =~ s/\\['"]//g;
|
||||
$string =~ s/`[^`]*?`//g;
|
||||
$string =~ s/"[^"]*?"//g;
|
||||
$string =~ s/'[^']*?'//g;
|
||||
$string =~ s/`[^`]*?`//g;
|
||||
$string =~ s/"[^"]*?"//g;
|
||||
$string =~ s/'[^']*?'//g;
|
||||
return $string;
|
||||
}
|
||||
|
||||
@@ -7412,7 +7412,7 @@ sub get_database_for_table {
|
||||
}
|
||||
my ($tbl) = @args{@required_args};
|
||||
PTDEBUG && _d('Getting database for table', $tbl);
|
||||
|
||||
|
||||
if ( $self->{duplicate_table_name}->{$tbl} ) {
|
||||
PTDEBUG && _d('Table name is duplicate, cannot qualify it');
|
||||
return;
|
||||
@@ -7530,7 +7530,7 @@ sub main {
|
||||
warn "No CREATE TABLE statements were found in $file";
|
||||
next FILE;
|
||||
}
|
||||
$sq->set_schema_from_mysqldump(dump => $dump);
|
||||
$sq->set_schema_from_mysqldump(dump => $dump);
|
||||
}
|
||||
$sp->set_SchemaQualifier($sq);
|
||||
}
|
||||
@@ -7667,7 +7667,7 @@ sub main {
|
||||
if ( $EVAL_ERROR ) {
|
||||
die "Failed to load $module module: $EVAL_ERROR";
|
||||
}
|
||||
|
||||
|
||||
$pipeline->add(
|
||||
name => ref $parser,
|
||||
process => sub {
|
||||
@@ -7812,7 +7812,7 @@ sub main {
|
||||
query_id => $query_id,
|
||||
TableUsage => $tu,
|
||||
%common_modules,
|
||||
);
|
||||
);
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
if ( $EVAL_ERROR =~ m/Table .+? doesn't exist/ ) {
|
||||
@@ -8063,7 +8063,7 @@ Possible contexts are as follows:
|
||||
SELECT means that the query retrieves data from the table for one of two
|
||||
reasons. The first is to be returned to the user as part of a result set. Only
|
||||
SELECT queries return result sets, so the report always shows a SELECT context
|
||||
for SELECT queries.
|
||||
for SELECT queries.
|
||||
|
||||
The second case is when data flows to another table as part of an INSERT or
|
||||
UPDATE. For example, the UPDATE query in the example above has the usage:
|
||||
@@ -8434,7 +8434,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -9466,7 +9466,7 @@ binmode(STDOUT, "encoding(UTF-8)");
|
||||
my $oktorun = 1;
|
||||
my $exit_status = 0;
|
||||
my $stats = {};
|
||||
|
||||
|
||||
my %modules_for_log_type = (
|
||||
slowlog => ['SlowLogParser'],
|
||||
binlog => ['BinaryLogParser'],
|
||||
@@ -9696,9 +9696,9 @@ sub main {
|
||||
);
|
||||
}
|
||||
|
||||
# ########################################################################
|
||||
# ########################################################################
|
||||
# Preprocess the log files.
|
||||
# ########################################################################
|
||||
# ########################################################################
|
||||
my $parser = make_parser(
|
||||
type => $o->get('type'),
|
||||
watch_server => $o->get('watch-server'),
|
||||
@@ -9820,7 +9820,7 @@ sub make_parser {
|
||||
}
|
||||
|
||||
if ( @parsers == 1 ) {
|
||||
return sub {
|
||||
return sub {
|
||||
my (%args) = @_;
|
||||
return $parsers[0]->parse_event(%args);
|
||||
};
|
||||
@@ -9913,7 +9913,7 @@ sub check_upgrade_table {
|
||||
# was given; see https://bugs.launchpad.net/percona-toolkit/+bug/950294
|
||||
if ( $o->get('create-upgrade-table') ) {
|
||||
eval {
|
||||
PTDEBUG && _d('Creating --upgrade-table table', $upgrade_table);
|
||||
PTDEBUG && _d('Creating --upgrade-table table', $upgrade_table);
|
||||
my $sql = $o->read_para_after(__FILE__, qr/MAGIC_upgrade_table/);
|
||||
$sql =~ s/CREATE TABLE pt_upgrade/CREATE TABLE IF NOT EXISTS $upgrade_table/;
|
||||
$sql =~ s/;$//;
|
||||
@@ -9987,7 +9987,7 @@ sub compare_host_to_host {
|
||||
my $host1 = $args{host1};
|
||||
my $host2 = $args{host2};
|
||||
my $max_class_size = $args{max_class_size};
|
||||
my $max_examples = $args{max_examples};
|
||||
my $max_examples = $args{max_examples};
|
||||
my $upgrade_table = $args{upgrade_table};
|
||||
my $run_time = $args{run_time};
|
||||
|
||||
@@ -10196,7 +10196,7 @@ sub compare_results_to_host {
|
||||
my $results_dir = $args{results_dir};
|
||||
my $host = $args{host};
|
||||
my $max_class_size = $args{max_class_size};
|
||||
my $max_examples = $args{max_examples};
|
||||
my $max_examples = $args{max_examples};
|
||||
my $upgrade_table = $args{upgrade_table};
|
||||
my $run_time = $args{run_time};
|
||||
PTDEBUG && _d('Compare', $results_dir, 'to', $host->name);
|
||||
@@ -10336,10 +10336,10 @@ sub save_and_report_results {
|
||||
ignore_warnings => $ignore_warnings,
|
||||
);
|
||||
|
||||
# Only SELECT statements return rows, *except* when they are directed
|
||||
# Only SELECT statements return rows, *except* when they are directed
|
||||
# INTO a file or a variable.
|
||||
my $row_diffs;
|
||||
if ( $event->{arg} =~ m/(?:^\s*SELECT|(?:\*\/\s*SELECT))/i
|
||||
if ( $event->{arg} =~ m/(?:^\s*SELECT|(?:\*\/\s*SELECT))/i
|
||||
&& $event->{arg} !~ m/INTO\s*(?:OUTFILE|DUMPFILE|@)/i ) {
|
||||
$row_diffs = diff_rows(
|
||||
sth1 => $results1->{sth},
|
||||
@@ -10564,7 +10564,7 @@ sub identical_rows {
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
sub report_logs {
|
||||
my (%args) = @_;
|
||||
@@ -11027,7 +11027,7 @@ Then C<tail -f err> while the tool is running to track its L<"--progress">.
|
||||
|
||||
In general, the tool exits zero if it finishes normally and there were
|
||||
no internal warnings or errors, and no L<"QUERY DIFFERENCES"> were found.
|
||||
Else the tool exits non-zero with one or more of the following codes:
|
||||
Else the tool exits non-zero with one or more of the following codes:
|
||||
|
||||
=over
|
||||
|
||||
@@ -11329,7 +11329,7 @@ done for the first time.
|
||||
|
||||
Any updates or known problems are printed to STDOUT before the tool's normal
|
||||
output. This feature should never interfere with the normal operation of the
|
||||
tool.
|
||||
tool.
|
||||
|
||||
For more information, visit L<https://www.percona.com/version-check>.
|
||||
|
||||
@@ -11393,7 +11393,7 @@ Explicitly enable LOAD DATA LOCAL INFILE.
|
||||
|
||||
For some reason, some vendors compile libmysql without the
|
||||
--enable-local-infile option, which disables the statement. This can
|
||||
lead to weird situations, like the server allowing LOCAL INFILE, but
|
||||
lead to weird situations, like the server allowing LOCAL INFILE, but
|
||||
the client throwing exceptions if it's used.
|
||||
|
||||
However, as long as the server allows LOAD DATA, clients can easily
|
||||
@@ -11444,7 +11444,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -5533,7 +5533,7 @@ reused.
|
||||
|
||||
=item connect_timeout
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
A large value of this setting can create a denial of service
|
||||
vulnerability.
|
||||
@@ -5555,19 +5555,19 @@ usual.
|
||||
|
||||
=item flush
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
This option might decrease performance greatly.
|
||||
|
||||
=item flush_time
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
This option might decrease performance greatly.
|
||||
|
||||
=item have_bdb
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
The BDB engine is deprecated. If you aren't using it, you should
|
||||
disable it with the skip_bdb option.
|
||||
@@ -5580,7 +5580,7 @@ The init_connect option is enabled on this server.
|
||||
|
||||
=item init_file
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
The init_file option is enabled on this server.
|
||||
|
||||
@@ -5598,7 +5598,7 @@ This variable generally doesn't need to be larger than 20MB.
|
||||
|
||||
=item innodb_buffer_pool_size
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
The InnoDB buffer pool size is unconfigured. In a production
|
||||
environment it should always be configured explicitly, and the default
|
||||
@@ -5606,14 +5606,14 @@ environment it should always be configured explicitly, and the default
|
||||
|
||||
=item innodb_checksums
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
InnoDB checksums are disabled. Your data is not protected from
|
||||
hardware corruption or other errors!
|
||||
|
||||
=item innodb_doublewrite
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
InnoDB doublewrite is disabled. Unless you use a filesystem that
|
||||
protects against partial page writes, your data is not safe!
|
||||
@@ -5627,7 +5627,7 @@ poor performance, or the need to perform crash recovery upon startup.
|
||||
|
||||
=item innodb_flush_log_at_trx_commit-1
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
InnoDB is not configured in strictly ACID mode. If there
|
||||
is a crash, some transactions can be lost.
|
||||
@@ -5643,7 +5643,7 @@ set it to 2 instead of 0.
|
||||
|
||||
=item innodb_force_recovery
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
InnoDB is in forced recovery mode! This should be used only
|
||||
temporarily when recovering from data corruption or other bugs, not for
|
||||
@@ -5651,14 +5651,14 @@ normal usage.
|
||||
|
||||
=item innodb_lock_wait_timeout
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
This option has an unusually long value, which can cause
|
||||
system overload if locks are not being released.
|
||||
|
||||
=item innodb_log_buffer_size
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
The InnoDB log buffer size generally should not be set larger than
|
||||
16MB. If you are doing large BLOB operations, InnoDB is not really a good
|
||||
@@ -5666,42 +5666,42 @@ choice of engines anyway.
|
||||
|
||||
=item innodb_log_file_size
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
The InnoDB log file size is set to its default value, which is not
|
||||
usable on production systems.
|
||||
|
||||
=item innodb_max_dirty_pages_pct
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
The innodb_max_dirty_pages_pct is lower than the default. This can
|
||||
cause overly aggressive flushing and add load to the I/O system.
|
||||
|
||||
=item flush_time
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
This setting is likely to cause very bad performance every
|
||||
flush_time seconds.
|
||||
|
||||
=item key_buffer_size
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
The key buffer size is set to its default value, which is not good
|
||||
The key buffer size is set to its default value, which is not good
|
||||
for most production systems. In a production environment, key_buffer_size
|
||||
should be larger than the default 8MB size.
|
||||
|
||||
=item large_pages
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
Large pages are enabled.
|
||||
|
||||
=item locked_in_memory
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
The server is locked in memory with --memlock.
|
||||
|
||||
@@ -5722,27 +5722,27 @@ as aborted connections.
|
||||
|
||||
=item low_priority_updates
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
The server is running with non-default lock priority for updates.
|
||||
This could cause update queries to wait unexpectedly for read queries.
|
||||
|
||||
=item max_binlog_size
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
The max_binlog_size is smaller than the default of 1GB.
|
||||
|
||||
=item max_connect_errors
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
max_connect_errors should probably be set as large as your platform
|
||||
allows.
|
||||
|
||||
=item max_connections
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
If the server ever really has more than a thousand threads running,
|
||||
then the system is likely to spend more time scheduling threads than
|
||||
@@ -5751,7 +5751,7 @@ light of your workload.
|
||||
|
||||
=item myisam_repair_threads
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
myisam_repair_threads > 1 enables multi-threaded repair, which is
|
||||
relatively untested and is still listed as beta-quality code in the
|
||||
@@ -5759,48 +5759,48 @@ official documentation.
|
||||
|
||||
=item old_passwords
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
Old-style passwords are insecure. They are sent in plain text
|
||||
across the wire.
|
||||
|
||||
=item optimizer_prune_level
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
The optimizer will use an exhaustive search when planning complex
|
||||
queries, which can cause the planning process to take a long time.
|
||||
|
||||
=item port
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
The server is listening on a non-default port.
|
||||
|
||||
=item query_cache_size-1
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
The query cache does not scale to large sizes and can cause unstable
|
||||
performance when larger than 128MB, especially on multi-core machines.
|
||||
|
||||
=item query_cache_size-2
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
The query cache can cause severe performance problems when it is
|
||||
larger than 256MB, especially on multi-core machines.
|
||||
|
||||
=item read_buffer_size-1
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
The read_buffer_size variable should generally be left at its
|
||||
default unless an expert determines it is necessary to change it.
|
||||
|
||||
=item read_buffer_size-2
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
The read_buffer_size variable should not be larger than 8MB. It
|
||||
should generally be left at its default unless an expert determines it is
|
||||
@@ -5810,14 +5810,14 @@ become extremely unstable.
|
||||
|
||||
=item read_rnd_buffer_size-1
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
The read_rnd_buffer_size variable should generally be left at its
|
||||
default unless an expert determines it is necessary to change it.
|
||||
|
||||
=item read_rnd_buffer_size-2
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
The read_rnd_buffer_size variable should not be larger than 4M. It
|
||||
should generally be left at its default unless an expert determines it is
|
||||
@@ -5825,7 +5825,7 @@ necessary to change it.
|
||||
|
||||
=item relay_log_space_limit
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
Setting relay_log_space_limit can cause replicas to stop fetching binary logs
|
||||
from their master immediately. This could increase the risk that your data will
|
||||
@@ -5835,7 +5835,7 @@ master and no replica has retrieved them.
|
||||
|
||||
=item slave_net_timeout
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
This variable is set too high. This is too long to wait before
|
||||
noticing that the connection to the master has failed and retrying. This
|
||||
@@ -5845,7 +5845,7 @@ when the master is simply idle.
|
||||
|
||||
=item slave_skip_errors
|
||||
|
||||
severity: crit
|
||||
severity: crit
|
||||
|
||||
You should not set this option. If replication is having errors,
|
||||
you need to find and resolve the cause of that; it is likely that your
|
||||
@@ -5854,14 +5854,14 @@ pt-table-checksum.
|
||||
|
||||
=item sort_buffer_size-1
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
The sort_buffer_size variable should generally be left at its
|
||||
default unless an expert determines it is necessary to change it.
|
||||
|
||||
=item sort_buffer_size-2
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
The sort_buffer_size variable should generally be left at its
|
||||
default unless an expert determines it is necessary to change it. Making
|
||||
@@ -5870,27 +5870,27 @@ the server crash, swap to death, or just become extremely unstable.
|
||||
|
||||
=item sql_notes
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
This server is configured not to log Note level warnings to the
|
||||
error log.
|
||||
|
||||
=item sync_frm
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
It is best to set sync_frm so that .frm files are flushed safely to
|
||||
disk in case of a server crash.
|
||||
|
||||
=item tx_isolation-1
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
This server's transaction isolation level is non-default.
|
||||
|
||||
=item tx_isolation-2
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
Most applications should use the default REPEATABLE-READ transaction
|
||||
isolation level, or in a few cases READ-COMMITTED.
|
||||
@@ -5906,13 +5906,13 @@ Always ask MySQL to purge obsolete logs, never delete them externally.
|
||||
|
||||
=item innodb_file_io_threads
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
This option is useless except on Windows.
|
||||
|
||||
=item innodb_data_file_path
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
Auto-extending InnoDB files can consume a lot of disk space that is
|
||||
very difficult to reclaim later. Some people prefer to set
|
||||
@@ -5920,7 +5920,7 @@ innodb_file_per_table and allocate a fixed-size file for ibdata1.
|
||||
|
||||
=item innodb_flush_method
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
Most production database servers that use InnoDB should set
|
||||
innodb_flush_method to O_DIRECT to avoid double-buffering, unless the I/O
|
||||
@@ -5928,14 +5928,14 @@ system is very low performance.
|
||||
|
||||
=item innodb_locks_unsafe_for_binlog
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
This option makes point-in-time recovery from binary logs, and
|
||||
replication, untrustworthy if statement-based logging is used.
|
||||
|
||||
=item innodb_support_xa
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
MySQL's internal XA transaction support between InnoDB and the
|
||||
binary log is disabled. The binary log might not match InnoDB's state
|
||||
@@ -5944,46 +5944,46 @@ out-of-order statements in the binary log.
|
||||
|
||||
=item log_bin
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
Binary logging is disabled, so point-in-time recovery and
|
||||
replication are not possible.
|
||||
|
||||
=item log_output
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
Directing log output to tables has a high performance impact.
|
||||
|
||||
=item max_relay_log_size
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
A custom max_relay_log_size is defined.
|
||||
|
||||
=item myisam_recover_options
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
myisam_recover_options should be set to some value such as
|
||||
BACKUP,FORCE to ensure that table corruption is noticed.
|
||||
|
||||
=item storage_engine
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
The server is using a non-standard storage engine as default.
|
||||
|
||||
=item sync_binlog
|
||||
|
||||
severity: warn
|
||||
severity: warn
|
||||
|
||||
Binary logging is enabled, but sync_binlog isn't configured so that
|
||||
every transaction is flushed to the binary log for durability.
|
||||
|
||||
=item tmp_table_size
|
||||
|
||||
severity: note
|
||||
severity: note
|
||||
|
||||
The effective minimum size of in-memory implicit temporary tables
|
||||
used internally during query execution is min(tmp_table_size,
|
||||
@@ -5994,7 +5994,7 @@ as tmp_table_size.
|
||||
|
||||
severity: warn
|
||||
|
||||
These are the recommended minimum version for each major release: 3.23, 4.1.20, 5.0.37, 5.1.30.
|
||||
These are the recommended minimum version for each major release: 3.23, 4.1.20, 5.0.37, 5.1.30.
|
||||
|
||||
=item end-of-life mysql version
|
||||
|
||||
@@ -6243,7 +6243,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -757,7 +757,7 @@ sub new {
|
||||
rules => [], # desc of rules for --help
|
||||
mutex => [], # rule: opts are mutually exclusive
|
||||
atleast1 => [], # rule: at least one opt is required
|
||||
disables => {}, # rule: opt disables other opts
|
||||
disables => {}, # rule: opt disables other opts
|
||||
defaults_to => {}, # rule: opt defaults to value of other opt
|
||||
DSNParser => undef,
|
||||
default_files => [
|
||||
@@ -920,7 +920,7 @@ sub _pod_to_specs {
|
||||
}
|
||||
|
||||
push @specs, {
|
||||
spec => $self->{parse_attributes}->($self, $option, \%attribs),
|
||||
spec => $self->{parse_attributes}->($self, $option, \%attribs),
|
||||
desc => $para
|
||||
. (defined $attribs{default} ? " (default $attribs{default})" : ''),
|
||||
group => ($attribs{'group'} ? $attribs{'group'} : 'default'),
|
||||
@@ -1011,7 +1011,7 @@ sub _parse_specs {
|
||||
$self->{opts}->{$long} = $opt;
|
||||
}
|
||||
else { # It's an option rule, not a spec.
|
||||
PTDEBUG && _d('Parsing rule:', $opt);
|
||||
PTDEBUG && _d('Parsing rule:', $opt);
|
||||
push @{$self->{rules}}, $opt;
|
||||
my @participants = $self->_get_participants($opt);
|
||||
my $rule_ok = 0;
|
||||
@@ -1056,7 +1056,7 @@ sub _parse_specs {
|
||||
PTDEBUG && _d('Option', $long, 'disables', @participants);
|
||||
}
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
sub _get_participants {
|
||||
@@ -1143,7 +1143,7 @@ sub _set_option {
|
||||
}
|
||||
|
||||
sub get_opts {
|
||||
my ( $self ) = @_;
|
||||
my ( $self ) = @_;
|
||||
|
||||
foreach my $long ( keys %{$self->{opts}} ) {
|
||||
$self->{opts}->{$long}->{got} = 0;
|
||||
@@ -1274,7 +1274,7 @@ sub _check_opts {
|
||||
else {
|
||||
$err = join(', ',
|
||||
map { "--$self->{opts}->{$_}->{long}" }
|
||||
grep { $_ }
|
||||
grep { $_ }
|
||||
@restricted_opts[0..scalar(@restricted_opts) - 2]
|
||||
)
|
||||
. ' or --'.$self->{opts}->{$restricted_opts[-1]}->{long};
|
||||
@@ -1284,7 +1284,7 @@ sub _check_opts {
|
||||
}
|
||||
|
||||
}
|
||||
elsif ( $opt->{is_required} ) {
|
||||
elsif ( $opt->{is_required} ) {
|
||||
$self->save_error("Required option --$long must be specified");
|
||||
}
|
||||
|
||||
@@ -1668,7 +1668,7 @@ sub clone {
|
||||
$clone{$scalar} = $self->{$scalar};
|
||||
}
|
||||
|
||||
return bless \%clone;
|
||||
return bless \%clone;
|
||||
}
|
||||
|
||||
sub _parse_size {
|
||||
@@ -3224,7 +3224,7 @@ of output.
|
||||
|
||||
=head1 ATTENTION
|
||||
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line
|
||||
parameters are shown in the output.
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
@@ -80,7 +80,7 @@ add_percona_yum_repo(){
|
||||
yum -y install https://repo.percona.com/yum/percona-release-latest.noarch.rpm
|
||||
percona-release disable all
|
||||
percona-release enable ppg-11.19 testing
|
||||
return
|
||||
return
|
||||
}
|
||||
|
||||
get_sources(){
|
||||
@@ -118,7 +118,7 @@ get_sources(){
|
||||
cd ../
|
||||
if [ -z "${DESTINATION}" ]; then
|
||||
export DESTINATION=experimental
|
||||
fi
|
||||
fi
|
||||
echo "REVISION=${REVISION}" >> ${WORKDIR}/percona-toolkit.properties
|
||||
echo "DESTINATION=${DESTINATION}" >> percona-toolkit.properties
|
||||
echo "UPLOAD=UPLOAD/${DESTINATION}/BUILDS/${PRODUCT}/${PRODUCT_FULL}/${BRANCH_NAME}/${REVISION}/${BUILD_ID}" >> percona-toolkit.properties
|
||||
@@ -130,7 +130,7 @@ get_sources(){
|
||||
#
|
||||
source percona-toolkit.properties
|
||||
#
|
||||
|
||||
|
||||
tar --owner=0 --group=0 -czf ${PRODUCT}-${VERSION}.tar.gz ${PRODUCT_FULL}
|
||||
mkdir $WORKDIR/source_tarball
|
||||
mkdir $CURDIR/source_tarball
|
||||
@@ -167,7 +167,7 @@ install_go() {
|
||||
update-alternatives --set go /usr/local/go/bin/go
|
||||
update-alternatives --install "/usr/bin/gofmt" "gofmt" "/usr/local/go/bin/gofmt" 0
|
||||
update-alternatives --set gofmt /usr/local/go/bin/gofmt
|
||||
rm /tmp/golang.tar.gz
|
||||
rm /tmp/golang.tar.gz
|
||||
}
|
||||
|
||||
update_go() {
|
||||
@@ -179,7 +179,7 @@ update_go() {
|
||||
export PATH="/usr/local/go/bin:$PATH:$GOPATH"
|
||||
export GOBINPATH="/usr/local/go/bin"
|
||||
cd src/github.com/percona
|
||||
cp -r $WORKDIR/$PRODUCT_FULL .
|
||||
cp -r $WORKDIR/$PRODUCT_FULL .
|
||||
mv ${PRODUCT_FULL} ${PRODUCT}
|
||||
cd ${PRODUCT}
|
||||
go get -u github.com/golang/dep/cmd/dep
|
||||
@@ -243,7 +243,7 @@ install_deps() {
|
||||
echo "waiting"
|
||||
sleep 1
|
||||
done
|
||||
fi
|
||||
fi
|
||||
install_go
|
||||
#update_pat
|
||||
fi
|
||||
@@ -321,7 +321,7 @@ build_srpm(){
|
||||
rm -rf bin/glide
|
||||
cd ../
|
||||
tar czf ${TARFILE} ${PRODUCT_FULL}
|
||||
|
||||
|
||||
# wget --no-check-certificate https://download.osgeo.org/postgis/docs/postgis-3.3.1.pdf
|
||||
#wget --no-check-certificate https://www.postgresql.org/files/documentation/pdf/12/postgresql-12-A4.pdf
|
||||
cd ${WORKDIR}
|
||||
@@ -381,7 +381,7 @@ build_rpm(){
|
||||
ARCH=$(echo $(uname -m) | sed -e 's:i686:i386:g')
|
||||
echo "RHEL=${RHEL}" >> percona-toolkit.properties
|
||||
echo "ARCH=${ARCH}" >> percona-toolkit.properties
|
||||
rpmbuild --target=x86_64 --define "version $VERSION" --define "dist .el${RHEL}" --define "release $RPM_RELEASE.el${RHEL}" --define "_topdir ${WORKDIR}/rpmbuild" --rebuild rpmbuild/SRPMS/${SRC_RPM}
|
||||
rpmbuild --target=x86_64 --define "version $VERSION" --define "dist .el${RHEL}" --define "release $RPM_RELEASE.el${RHEL}" --define "_topdir ${WORKDIR}/rpmbuild" --rebuild rpmbuild/SRPMS/${SRC_RPM}
|
||||
|
||||
return_code=$?
|
||||
if [ $return_code != 0 ]; then
|
||||
@@ -421,7 +421,7 @@ build_source_deb(){
|
||||
echo " * Initial Release." >> changelog
|
||||
echo " -- Percona Toolkit Developers <toolkit-dev@percona.com> $(date -R)" >> changelog
|
||||
echo "override_dh_builddeb:" >> rules
|
||||
echo " dh_builddeb -- -Zgzip" >> rules
|
||||
echo " dh_builddeb -- -Zgzip" >> rules
|
||||
cd ../
|
||||
dch -D unstable --force-distribution -v "${VERSION}-${DEB_RELEASE}" "Update to new upstream release Percona-Toolkit ${VERSION}-${DEB_RELEASE}"
|
||||
dpkg-buildpackage -S
|
||||
@@ -450,7 +450,7 @@ build_tarball(){
|
||||
export UPDATE=0
|
||||
export CHECK=0
|
||||
cd $WORKDIR
|
||||
mkdir TARGET
|
||||
mkdir TARGET
|
||||
get_tar "source_tarball"
|
||||
TARBALL=$(find . -type f -name 'percona-toolkit*.tar.gz')
|
||||
#VERSION_TMP=$(echo ${TARBALL}| awk -F '-' '{print $2}')
|
||||
|
@@ -12,4 +12,4 @@
|
||||
{%- endif %}
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -30,4 +30,4 @@ body,input{
|
||||
-webkit-font-feature-settings:"kern","liga";
|
||||
font-feature-settings:"kern","liga";
|
||||
font-family:"Chivo", "Colfax", "Franziska", Helvetica, Arial, sans-serif;
|
||||
}
|
||||
}
|
||||
|
@@ -795,8 +795,8 @@ sub top_events {
|
||||
my ( $self, %args ) = @_;
|
||||
my $classes = $self->{result_classes};
|
||||
my @sorted = reverse sort { # Sorted list of $groupby values
|
||||
($classes->{$a}->{$args{attrib}}->{$args{orderby}}
|
||||
== $classes->{$b}->{$args{attrib}}->{$args{orderby}})
|
||||
($classes->{$a}->{$args{attrib}}->{$args{orderby}}
|
||||
== $classes->{$b}->{$args{attrib}}->{$args{orderby}})
|
||||
? $a cmp $b
|
||||
: $classes->{$a}->{$args{attrib}}->{$args{orderby}}
|
||||
<=> $classes->{$b}->{$args{attrib}}->{$args{orderby}}
|
||||
|
@@ -356,7 +356,7 @@ _parse_config_files() {
|
||||
|
||||
# Strip leading and trailing spaces, and spaces around the first =,
|
||||
# and end-of-line # comments.
|
||||
config_opt="$(echo "$config_opt" | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/[ ]*=[ ]*/=/' -e 's/\s[ ]*#.*$//')"
|
||||
config_opt="$(echo "$config_opt" | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/[ ]*=[ ]*/=/' -e 's/\s[ ]*#.*$//')"
|
||||
|
||||
# Skip blank lines.
|
||||
[ "$config_opt" = "" ] && continue
|
||||
|
@@ -1284,14 +1284,14 @@ report_jemalloc_enabled() {
|
||||
echo "jemalloc is not enabled in mysql config for process with id ${pid}"
|
||||
else
|
||||
echo "jemalloc enabled in mysql config for process with id ${pid}"
|
||||
GENERAL_JEMALLOC_STATUS=1
|
||||
GENERAL_JEMALLOC_STATUS=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $GENERAL_JEMALLOC_STATUS -eq 1 ]; then
|
||||
local jemalloc_location="$(get_var "pt-summary-internal-jemalloc_location" "${variables_file}")"
|
||||
if [ -n "$jemalloc_location" ]; then
|
||||
echo "Using jemalloc from $jemalloc_location"
|
||||
echo "Using jemalloc from $jemalloc_location"
|
||||
else
|
||||
echo "Jemalloc library not found"
|
||||
fi
|
||||
@@ -1585,7 +1585,7 @@ report_mysql_summary () {
|
||||
local encrypted_tables=""
|
||||
local encrypted_tablespaces=""
|
||||
if [ -s "$dir/keyring-plugins" ]; then
|
||||
keyring_plugins="$(cat $dir/keyring-plugins)"
|
||||
keyring_plugins="$(cat $dir/keyring-plugins)"
|
||||
fi
|
||||
if [ -s "$dir/encrypted-tables" ]; then
|
||||
encrypted_tables="$(cat $dir/encrypted-tables)"
|
||||
|
@@ -1,14 +1,14 @@
|
||||
#pt-mongodb-query-digest
|
||||
|
||||
This program reports query usage statistics by aggregating queries from MongoDB query profiler.
|
||||
This program reports query usage statistics by aggregating queries from MongoDB query profiler.
|
||||
The queries are the result of running:
|
||||
```javascript
|
||||
db.getSiblingDB("samples").system.profile.find({"op":{"$nin":["getmore", "delete"]}});
|
||||
```
|
||||
and then, the results are grouped by fingerprint and namespace (database.collection).
|
||||
|
||||
The fingerprint is calculated as the **sorted list** of the keys in the document. The max depth level is 10.
|
||||
The last step is sorting the results. The default sort order is by ascending query count.
|
||||
The fingerprint is calculated as the **sorted list** of the keys in the document. The max depth level is 10.
|
||||
The last step is sorting the results. The default sort order is by ascending query count.
|
||||
|
||||
##Sample output
|
||||
```
|
||||
@@ -29,9 +29,9 @@ The last step is sorting the results. The default sort order is by ascending que
|
||||
# Query {"find":"col1","shardVersion":[0,"000000000000000000000000"]}
|
||||
|
||||
```
|
||||
|
||||
##Command line parameters
|
||||
|
||||
|
||||
##Command line parameters
|
||||
|
||||
|Short|Long|Help|
|
||||
|-----|----|----|
|
||||
|-?|--help|Show help|
|
||||
|
Reference in New Issue
Block a user