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:
Sveta Smirnova
2025-09-09 19:25:13 +03:00
parent 4e190a34ef
commit f550652dbf
6 changed files with 33 additions and 13 deletions

View File

@@ -3696,7 +3696,7 @@ sub _normalize_value {
my ($val, $is_dir, $base_path) = @args{qw(value is_directory base_path)}; my ($val, $is_dir, $base_path) = @args{qw(value is_directory base_path)};
$val = defined $val ? $val : ''; $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 ( $val ) {
if ( $is_dir ) { if ( $is_dir ) {

View File

@@ -294,7 +294,7 @@ sub _normalize_value {
my ($val, $is_dir, $base_path) = @args{qw(value is_directory base_path)}; my ($val, $is_dir, $base_path) = @args{qw(value is_directory base_path)};
$val = defined $val ? $val : ''; $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 ( $val ) {
if ( $is_dir ) { if ( $is_dir ) {

View File

@@ -425,6 +425,30 @@ is_deeply(
"..but can be turned off" "..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. # Done.
# ############################################################################# # #############################################################################

View File

@@ -2,8 +2,6 @@
log_bin=1 log_bin=1
gtid_mode=on gtid_mode=on
read_only=off read_only=off
autocommit=yes
autocommit=no autocommit=no
binlog_format=mixed binlog_format=mixed
skip_name_resolve=true skip_name_resolve=true
skip_name_resolve=false

View File

@@ -0,0 +1,7 @@
[mysqld]
log_bin=on
gtid_mode=True
read_only=FALSE
autocommit=0
binlog_format=MIXED
skip_name_resolve=TRUE

View File

@@ -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