mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-17 08:57:24 +00:00
PT-2014 - pt-config-diff does not honor case insensitivity flag
- Fixed the proposed fix - Fixed proposed configuration files - Added test case
This commit is contained in:
@@ -3696,7 +3696,7 @@ sub _normalize_value {
|
||||
my ($val, $is_dir, $base_path) = @args{qw(value is_directory base_path)};
|
||||
|
||||
$val = defined $val ? $val : '';
|
||||
$val = $alt_val_for{lc($val)} if exists $alt_val_for{lc($val)};
|
||||
$val = $alt_val_for{uc($val)} if exists $alt_val_for{uc($val)};
|
||||
|
||||
if ( $val ) {
|
||||
if ( $is_dir ) {
|
||||
|
@@ -294,7 +294,7 @@ sub _normalize_value {
|
||||
my ($val, $is_dir, $base_path) = @args{qw(value is_directory base_path)};
|
||||
|
||||
$val = defined $val ? $val : '';
|
||||
$val = $alt_val_for{lc($val)} if exists $alt_val_for{lc($val)};
|
||||
$val = $alt_val_for{uc($val)} if exists $alt_val_for{uc($val)};
|
||||
|
||||
if ( $val ) {
|
||||
if ( $is_dir ) {
|
||||
|
@@ -425,6 +425,30 @@ is_deeply(
|
||||
"..but can be turned off"
|
||||
);
|
||||
|
||||
# ############################################################################
|
||||
# https://perconadev.atlassian.net/browse/PT-2014
|
||||
# pt-config-diff does not honor case insensitivity flag for boolean values
|
||||
# ############################################################################
|
||||
$c1 = new MySQLConfig(
|
||||
file => "$trunk/$sample/pt-2014-1.txt",
|
||||
TextResultSetParser => $trp,
|
||||
);
|
||||
$c2 = new MySQLConfig(
|
||||
file => "$trunk/$sample/pt-2014-2.txt",
|
||||
TextResultSetParser => $trp,
|
||||
);
|
||||
{
|
||||
my $diff = $cc->diff(
|
||||
configs => [$c1, $c2],
|
||||
);
|
||||
|
||||
is_deeply(
|
||||
$diff,
|
||||
undef,
|
||||
"Boolean values are the same regardless of the case"
|
||||
) or diag(Dumper($diff));
|
||||
}
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
|
@@ -2,8 +2,6 @@
|
||||
log_bin=1
|
||||
gtid_mode=on
|
||||
read_only=off
|
||||
autocommit=yes
|
||||
autocommit=no
|
||||
binlog_format=mixed
|
||||
skip_name_resolve=true
|
||||
skip_name_resolve=false
|
7
t/lib/samples/configs/pt-2014-2.txt
Normal file
7
t/lib/samples/configs/pt-2014-2.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
[mysqld]
|
||||
log_bin=on
|
||||
gtid_mode=True
|
||||
read_only=FALSE
|
||||
autocommit=0
|
||||
binlog_format=MIXED
|
||||
skip_name_resolve=TRUE
|
@@ -1,9 +0,0 @@
|
||||
[mysqld]
|
||||
LOGBIN=1
|
||||
gtid_mode=ON
|
||||
read_only=OFF
|
||||
autocommit=YES
|
||||
autocommit=NO
|
||||
binlog_format=MIXED
|
||||
skip_name_resolve=TRUE
|
||||
skip_name_resolve=FALSE
|
Reference in New Issue
Block a user