mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-10-19 08:56:34 +00:00
Some changes as per Daniel's review
This commit is contained in:
@@ -35,6 +35,8 @@ use overload (
|
|||||||
fallback => 1,
|
fallback => 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
use Carp ();
|
||||||
|
|
||||||
our $VERSION = 0.01;
|
our $VERSION = 0.01;
|
||||||
|
|
||||||
has major => (
|
has major => (
|
||||||
@@ -112,6 +114,8 @@ sub comment {
|
|||||||
my @methods = qw(major minor revision);
|
my @methods = qw(major minor revision);
|
||||||
sub cmp {
|
sub cmp {
|
||||||
my ($left, $right) = @_;
|
my ($left, $right) = @_;
|
||||||
|
# If the first object is blessed and ->isa( self's class ), then
|
||||||
|
# just use that; Otherwise, contruct a new VP object from it.
|
||||||
my $right_obj = (blessed($right) && $right->isa(ref($left)))
|
my $right_obj = (blessed($right) && $right->isa(ref($left)))
|
||||||
? $right
|
? $right
|
||||||
: ref($left)->new($right);
|
: ref($left)->new($right);
|
||||||
@@ -146,9 +150,8 @@ sub BUILDARGS {
|
|||||||
@args{@methods} = $self->_split_version($query);
|
@args{@methods} = $self->_split_version($query);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PTDEBUG && _d("Couldn't get the version from the dbh: $@");
|
Carp::confess("Couldn't get the version from the dbh while "
|
||||||
# No need to die here; ->new will die on it's own since the version
|
. "creating a VersionParser object: $@");
|
||||||
# is missing
|
|
||||||
}
|
}
|
||||||
$args{innodb_version} = eval { $self->_innodb_version($dbh) };
|
$args{innodb_version} = eval { $self->_innodb_version($dbh) };
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user