PT-2465 patch fix for erroneous flavour mismatch in mariadb-10.5.x and above. This patch includes the fixed regex for checking DB flavour to include the case-insensitive marker i on the searches for MariaDB

This commit is contained in:
Nyele93
2025-08-18 17:42:10 +03:00
parent 6c9deb9d66
commit a97c422851
10 changed files with 50 additions and 50 deletions

View File

@@ -340,7 +340,7 @@ sub _find_replicas_by_hosts {
my $vp = VersionParser->new($dbh);
my $sql = 'SHOW REPLICAS';
my $source_name = 'source';
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/i ) {
$sql = 'SHOW SLAVE HOSTS';
$source_name='master';
}
@@ -485,7 +485,7 @@ sub get_source_dsn {
my $vp = VersionParser->new($dbh);
my $source_host = 'source_host';
my $source_port = 'source_port';
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/i ) {
$source_host = 'master_host';
$source_port = 'master_port';
}
@@ -566,7 +566,7 @@ sub get_source_status {
my $vp = VersionParser->new($dbh);
my $source_name = 'binary log';
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/i ) {
$source_name = 'master';
}
@@ -1123,13 +1123,13 @@ sub get_cxn_from_dsn_table {
sub get_source_name {
my ($dbh) = @_;
my $vp = VersionParser->new($dbh);
return ($vp lt '8.1' || $vp->flavor() =~ m/maria/) ? 'master' : 'source';
return ($vp lt '8.1' || $vp->flavor() =~ m/maria/i) ? 'master' : 'source';
}
sub get_replica_name {
my ($dbh) = @_;
my $vp = VersionParser->new($dbh);
return ($vp lt '8.1' || $vp->flavor() =~ m/maria/) ? 'slave' : 'replica';
return ($vp lt '8.1' || $vp->flavor() =~ m/maria/i) ? 'slave' : 'replica';
}
sub _d {