Updated MySQLConfigComparer.pm so now it can honor case insensitivity. cnf1 and cnf2 are test files.

This commit is contained in:
nilnandan
2025-09-08 14:12:12 +00:00
parent 6588510632
commit 4e190a34ef
4 changed files with 36 additions and 16 deletions

View File

@@ -3511,12 +3511,12 @@ use English qw(-no_match_vars);
use constant PTDEBUG => $ENV{PTDEBUG} || 0; use constant PTDEBUG => $ENV{PTDEBUG} || 0;
my %alt_val_for = ( my %alt_val_for = (
ON => 1, ON => 1,
YES => 1, YES => 1,
TRUE => 1, TRUE => 1,
OFF => 0, OFF => 0,
NO => 0, NO => 0,
FALSE => 0, FALSE => 0,
); );
sub new { sub new {
@@ -3633,7 +3633,8 @@ sub diff {
next CONFIG if $val0 == $valN; next CONFIG if $val0 == $valN;
} }
else { else {
next CONFIG if $ignore_case
next CONFIG if $ignore_case
? lc($val0) eq lc($valN) ? lc($val0) eq lc($valN)
: $val0 eq $valN; : $val0 eq $valN;
@@ -3695,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{$val} if exists $alt_val_for{$val}; $val = $alt_val_for{lc($val)} if exists $alt_val_for{lc($val)};
if ( $val ) { if ( $val ) {
if ( $is_dir ) { if ( $is_dir ) {

View File

@@ -31,12 +31,12 @@ use constant PTDEBUG => $ENV{PTDEBUG} || 0;
# in SHOW VARS as var=TRUE. I.e. there's several synonyms for basic # in SHOW VARS as var=TRUE. I.e. there's several synonyms for basic
# true (1) and false (0), so we normalize them to make comparisons easier. # true (1) and false (0), so we normalize them to make comparisons easier.
my %alt_val_for = ( my %alt_val_for = (
ON => 1, ON => 1,
YES => 1, YES => 1,
TRUE => 1, TRUE => 1,
OFF => 0, OFF => 0,
NO => 0, NO => 0,
FALSE => 0, FALSE => 0,
); );
# Sub: new # Sub: new
@@ -202,7 +202,8 @@ sub diff {
next CONFIG if $val0 == $valN; next CONFIG if $val0 == $valN;
} }
else { else {
next CONFIG if $ignore_case
next CONFIG if $ignore_case
? lc($val0) eq lc($valN) ? lc($val0) eq lc($valN)
: $val0 eq $valN; : $val0 eq $valN;
@@ -293,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{$val} if exists $alt_val_for{$val}; $val = $alt_val_for{lc($val)} if exists $alt_val_for{lc($val)};
if ( $val ) { if ( $val ) {
if ( $is_dir ) { if ( $is_dir ) {

View File

@@ -0,0 +1,9 @@
[mysqld]
log_bin=1
gtid_mode=on
read_only=off
autocommit=yes
autocommit=no
binlog_format=mixed
skip_name_resolve=true
skip_name_resolve=false

View File

@@ -0,0 +1,9 @@
[mysqld]
LOGBIN=1
gtid_mode=ON
read_only=OFF
autocommit=YES
autocommit=NO
binlog_format=MIXED
skip_name_resolve=TRUE
skip_name_resolve=FALSE