mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-04-11 01:01:36 +08:00
Implement all MySQL log parsers. Add report sections, and --report.
This commit is contained in:
2830
bin/pt-upgrade
2830
bin/pt-upgrade
File diff suppressed because it is too large
Load Diff
11
lib/Cxn.pm
11
lib/Cxn.pm
@@ -97,15 +97,19 @@ sub new {
|
||||
$dsn = $dp->copy($prev_dsn, $dsn);
|
||||
}
|
||||
|
||||
my $dsn_name = $dp->as_string($dsn, [qw(h P S)])
|
||||
|| $dp->as_string($dsn, [qw(F)])
|
||||
|| '';
|
||||
|
||||
my $self = {
|
||||
dsn => $dsn,
|
||||
dbh => $args{dbh},
|
||||
dsn_name => $dp->as_string($dsn, [qw(h P S)]),
|
||||
dsn_name => $dsn_name,
|
||||
hostname => '',
|
||||
set => $args{set},
|
||||
NAME_lc => defined($args{NAME_lc}) ? $args{NAME_lc} : 1,
|
||||
dbh_set => 0,
|
||||
OptionParser => $o,
|
||||
ask_pass => $o->get('ask-pass'),
|
||||
DSNParser => $dp,
|
||||
is_cluster_node => undef,
|
||||
};
|
||||
@@ -117,12 +121,11 @@ sub connect {
|
||||
my ( $self ) = @_;
|
||||
my $dsn = $self->{dsn};
|
||||
my $dp = $self->{DSNParser};
|
||||
my $o = $self->{OptionParser};
|
||||
|
||||
my $dbh = $self->{dbh};
|
||||
if ( !$dbh || !$dbh->ping() ) {
|
||||
# Ask for password once.
|
||||
if ( $o->get('ask-pass') && !$self->{asked_for_pass} ) {
|
||||
if ( $self->{ask_pass} && !$self->{asked_for_pass} ) {
|
||||
$dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: ");
|
||||
$self->{asked_for_pass} = 1;
|
||||
}
|
||||
|
||||
@@ -322,6 +322,7 @@ sub report_class {
|
||||
# for this header, util/update-modules will remove them from the code.
|
||||
# *facepalm*
|
||||
my $class_header_format = <<'EOF';
|
||||
|
||||
%s
|
||||
%s
|
||||
%s
|
||||
|
||||
@@ -87,7 +87,12 @@ while ( my $sampleno = readdir $dh ) {
|
||||
$output,
|
||||
"$sample/$sampleno/$basename.txt",
|
||||
cmd_output => 1,
|
||||
($sed ? (sed => [ $sed ]) : ()),
|
||||
sed => [
|
||||
q{'s/File: .*/File: .../'},
|
||||
q{'s/ hostname: .*/ hostname: .../'},
|
||||
q{'s/ MySQL: .*/ MySQL: .../'},
|
||||
($sed ? $sed : ()),
|
||||
],
|
||||
),
|
||||
"$sampleno: $basename.txt"
|
||||
) or diag("\n\n---- DIFF ----\n\n", $test_diff,
|
||||
|
||||
Reference in New Issue
Block a user