mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-04-17 01:01:39 +08:00
Fixed a bug in Quoter->split_unquote, added several tests for find_renamed_cols
This commit is contained in:
@@ -2335,12 +2335,18 @@ sub quote_val {
|
||||
|
||||
sub split_unquote {
|
||||
my ( $self, $db_tbl, $default_db ) = @_;
|
||||
$db_tbl =~ s/`//g;
|
||||
my ( $db, $tbl ) = split(/[.]/, $db_tbl);
|
||||
if ( !$tbl ) {
|
||||
$tbl = $db;
|
||||
$db = $default_db;
|
||||
}
|
||||
for ($db, $tbl) {
|
||||
next unless $_;
|
||||
s/\A`//;
|
||||
s/`\z//;
|
||||
s/``/`/;
|
||||
}
|
||||
|
||||
return ($db, $tbl);
|
||||
}
|
||||
|
||||
@@ -3437,7 +3443,9 @@ sub is_cluster_node {
|
||||
PTDEBUG && _d($sql);
|
||||
my $row = $self->{dbh}->selectrow_arrayref($sql);
|
||||
PTDEBUG && _d(defined $row ? @$row : 'undef');
|
||||
$self->{is_cluster_node} = $row && $row->[0] ? 1 : 0;
|
||||
$self->{is_cluster_node} = $row && $row->[1]
|
||||
? ($row->[1] eq 'ON' || $row->[1] eq '1')
|
||||
: 0;
|
||||
|
||||
return $self->{is_cluster_node};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user