PT-2340 - Support MySQL 8.4

- Fixed comparison operators for VersionCheck calls
This commit is contained in:
Sveta Smirnova
2024-08-27 13:45:37 +03:00
parent 42486a80a5
commit e3e352d1d6
21 changed files with 165 additions and 165 deletions

View File

@@ -3923,7 +3923,7 @@ sub _find_replicas_by_hosts {
my $vp = VersionParser->new($dbh);
my $sql = 'SHOW REPLICAS';
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$sql = 'SHOW SLAVE HOSTS';
$source_name='master';
}
@@ -4002,7 +4002,7 @@ sub is_source_of {
my $replica_version = VersionParser->new($replica);
my $source_name = 'source';
my $source_port = 'source_port';
if ( $replica_version < '8.1' || $replica_version->flavor() =~ m/maria/ ) {
if ( $replica_version lt '8.1' || $replica_version->flavor() =~ m/maria/ ) {
$source_name = 'master';
$source_port = 'master_port';
}
@@ -4049,7 +4049,7 @@ sub get_source_dsn {
my $vp = VersionParser->new($dbh);
my $source_host = 'source_host';
my $source_port = 'source_port';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_host = 'master_host';
$source_port = 'master_port';
}
@@ -4064,7 +4064,7 @@ sub get_replica_status {
my $server_version = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $server_version < '8.1' || $server_version->flavor() =~ m/maria/ ) {
if ( $server_version lt '8.1' || $server_version->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -4127,7 +4127,7 @@ sub get_source_status {
my $vp = VersionParser->new($dbh);
my $source_name = 'binary log';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -4179,7 +4179,7 @@ sub wait_for_source {
}
my $vp = VersionParser->new($replica_dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
my $channel_sql = $vp > '5.6' && $self->{channel} ? ", '$self->{channel}'" : '';
@@ -4207,7 +4207,7 @@ sub stop_replica {
my ( $self, $dbh ) = @_;
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
my $sth = $self->{sths}->{$dbh}->{STOP_REPLICA}
@@ -4222,7 +4222,7 @@ sub start_replica {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
$replica_name = 'slave';
}
@@ -4271,7 +4271,7 @@ sub catchup_to_source {
my $vp = VersionParser->new($replica);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -4320,13 +4320,13 @@ sub catchup_to_same_pos {
my $vp1 = VersionParser->new($s1_dbh);
my $replica1_name = 'replica';
if ( $vp1 < '8.1' || $vp1->flavor() =~ m/maria/ ) {
if ( $vp1 lt '8.1' || $vp1->flavor() =~ m/maria/ ) {
$replica1_name = 'slave';
}
my $vp2 = VersionParser->new($s2_dbh);
my $replica2_name = 'replica';
if ( $vp2 < '8.1' || $vp2->flavor() =~ m/maria/ ) {
if ( $vp2 lt '8.1' || $vp2->flavor() =~ m/maria/ ) {
$replica2_name = 'slave';
}
@@ -4349,7 +4349,7 @@ sub has_replica_updates {
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -4386,7 +4386,7 @@ sub get_replica_lag {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -4490,7 +4490,7 @@ sub get_replication_filters {
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}

View File

@@ -384,7 +384,7 @@ sub _find_replicas_by_hosts {
my $vp = VersionParser->new($dbh);
my $sql = 'SHOW REPLICAS';
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$sql = 'SHOW SLAVE HOSTS';
$source_name='master';
}
@@ -463,7 +463,7 @@ sub is_source_of {
my $replica_version = VersionParser->new($replica);
my $source_name = 'source';
my $source_port = 'source_port';
if ( $replica_version < '8.1' || $replica_version->flavor() =~ m/maria/ ) {
if ( $replica_version lt '8.1' || $replica_version->flavor() =~ m/maria/ ) {
$source_name = 'master';
$source_port = 'master_port';
}
@@ -510,7 +510,7 @@ sub get_source_dsn {
my $vp = VersionParser->new($dbh);
my $source_host = 'source_host';
my $source_port = 'source_port';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_host = 'master_host';
$source_port = 'master_port';
}
@@ -525,7 +525,7 @@ sub get_replica_status {
my $server_version = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $server_version < '8.1' || $server_version->flavor() =~ m/maria/ ) {
if ( $server_version lt '8.1' || $server_version->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -588,7 +588,7 @@ sub get_source_status {
my $vp = VersionParser->new($dbh);
my $source_name = 'binary log';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -640,7 +640,7 @@ sub wait_for_source {
}
my $vp = VersionParser->new($replica_dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
my $channel_sql = $vp > '5.6' && $self->{channel} ? ", '$self->{channel}'" : '';
@@ -668,7 +668,7 @@ sub stop_replica {
my ( $self, $dbh ) = @_;
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
my $sth = $self->{sths}->{$dbh}->{STOP_REPLICA}
@@ -683,7 +683,7 @@ sub start_replica {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
$replica_name = 'slave';
}
@@ -732,7 +732,7 @@ sub catchup_to_source {
my $vp = VersionParser->new($replica);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -781,13 +781,13 @@ sub catchup_to_same_pos {
my $vp1 = VersionParser->new($s1_dbh);
my $replica1_name = 'replica';
if ( $vp1 < '8.1' || $vp1->flavor() =~ m/maria/ ) {
if ( $vp1 lt '8.1' || $vp1->flavor() =~ m/maria/ ) {
$replica1_name = 'slave';
}
my $vp2 = VersionParser->new($s2_dbh);
my $replica2_name = 'replica';
if ( $vp2 < '8.1' || $vp2->flavor() =~ m/maria/ ) {
if ( $vp2 lt '8.1' || $vp2->flavor() =~ m/maria/ ) {
$replica2_name = 'slave';
}
@@ -810,7 +810,7 @@ sub has_replica_updates {
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -847,7 +847,7 @@ sub get_replica_lag {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -951,7 +951,7 @@ sub get_replication_filters {
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -6435,7 +6435,7 @@ sub main {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -6478,7 +6478,7 @@ sub main {
my $sql;
if ( @master_status_cols ) {
if ( $vp >= '8.1' && $vp->flavor() !~ m/maria/ ) {
if ( $vp ge '8.1' && $vp->flavor() !~ m/maria/ ) {
$sql = 'SHOW BINARY LOG STATUS';
}
else {
@@ -6496,7 +6496,7 @@ sub main {
}
if ( @slave_status_cols ) {
if ( $vp >= '8.1' && $vp->flavor() !~ m/maria/ ) {
if ( $vp ge '8.1' && $vp->flavor() !~ m/maria/ ) {
$sql = 'SHOW REPLICA STATUS';
}
else {

View File

@@ -4200,7 +4200,7 @@ sub _find_replicas_by_hosts {
my $vp = VersionParser->new($dbh);
my $sql = 'SHOW REPLICAS';
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$sql = 'SHOW SLAVE HOSTS';
$source_name='master';
}
@@ -4279,7 +4279,7 @@ sub is_source_of {
my $replica_version = VersionParser->new($replica);
my $source_name = 'source';
my $source_port = 'source_port';
if ( $replica_version < '8.1' || $replica_version->flavor() =~ m/maria/ ) {
if ( $replica_version lt '8.1' || $replica_version->flavor() =~ m/maria/ ) {
$source_name = 'master';
$source_port = 'master_port';
}
@@ -4326,7 +4326,7 @@ sub get_source_dsn {
my $vp = VersionParser->new($dbh);
my $source_host = 'source_host';
my $source_port = 'source_port';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_host = 'master_host';
$source_port = 'master_port';
}
@@ -4341,7 +4341,7 @@ sub get_replica_status {
my $server_version = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $server_version < '8.1' || $server_version->flavor() =~ m/maria/ ) {
if ( $server_version lt '8.1' || $server_version->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -4404,7 +4404,7 @@ sub get_source_status {
my $vp = VersionParser->new($dbh);
my $source_name = 'binary log';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -4456,7 +4456,7 @@ sub wait_for_source {
}
my $vp = VersionParser->new($replica_dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
my $channel_sql = $vp > '5.6' && $self->{channel} ? ", '$self->{channel}'" : '';
@@ -4484,7 +4484,7 @@ sub stop_replica {
my ( $self, $dbh ) = @_;
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
my $sth = $self->{sths}->{$dbh}->{STOP_REPLICA}
@@ -4499,7 +4499,7 @@ sub start_replica {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
$replica_name = 'slave';
}
@@ -4548,7 +4548,7 @@ sub catchup_to_source {
my $vp = VersionParser->new($replica);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -4597,13 +4597,13 @@ sub catchup_to_same_pos {
my $vp1 = VersionParser->new($s1_dbh);
my $replica1_name = 'replica';
if ( $vp1 < '8.1' || $vp1->flavor() =~ m/maria/ ) {
if ( $vp1 lt '8.1' || $vp1->flavor() =~ m/maria/ ) {
$replica1_name = 'slave';
}
my $vp2 = VersionParser->new($s2_dbh);
my $replica2_name = 'replica';
if ( $vp2 < '8.1' || $vp2->flavor() =~ m/maria/ ) {
if ( $vp2 lt '8.1' || $vp2->flavor() =~ m/maria/ ) {
$replica2_name = 'slave';
}
@@ -4626,7 +4626,7 @@ sub has_replica_updates {
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -4663,7 +4663,7 @@ sub get_replica_lag {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -4767,7 +4767,7 @@ sub get_replication_filters {
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}

View File

@@ -4488,7 +4488,7 @@ sub _find_replicas_by_hosts {
my $vp = VersionParser->new($dbh);
my $sql = 'SHOW REPLICAS';
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$sql = 'SHOW SLAVE HOSTS';
$source_name='master';
}
@@ -4567,7 +4567,7 @@ sub is_source_of {
my $replica_version = VersionParser->new($replica);
my $source_name = 'source';
my $source_port = 'source_port';
if ( $replica_version < '8.1' || $replica_version->flavor() =~ m/maria/ ) {
if ( $replica_version lt '8.1' || $replica_version->flavor() =~ m/maria/ ) {
$source_name = 'master';
$source_port = 'master_port';
}
@@ -4614,7 +4614,7 @@ sub get_source_dsn {
my $vp = VersionParser->new($dbh);
my $source_host = 'source_host';
my $source_port = 'source_port';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_host = 'master_host';
$source_port = 'master_port';
}
@@ -4629,7 +4629,7 @@ sub get_replica_status {
my $server_version = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $server_version < '8.1' || $server_version->flavor() =~ m/maria/ ) {
if ( $server_version lt '8.1' || $server_version->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -4692,7 +4692,7 @@ sub get_source_status {
my $vp = VersionParser->new($dbh);
my $source_name = 'binary log';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -4744,7 +4744,7 @@ sub wait_for_source {
}
my $vp = VersionParser->new($replica_dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
my $channel_sql = $vp > '5.6' && $self->{channel} ? ", '$self->{channel}'" : '';
@@ -4772,7 +4772,7 @@ sub stop_replica {
my ( $self, $dbh ) = @_;
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
my $sth = $self->{sths}->{$dbh}->{STOP_REPLICA}
@@ -4787,7 +4787,7 @@ sub start_replica {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
$replica_name = 'slave';
}
@@ -4836,7 +4836,7 @@ sub catchup_to_source {
my $vp = VersionParser->new($replica);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -4885,13 +4885,13 @@ sub catchup_to_same_pos {
my $vp1 = VersionParser->new($s1_dbh);
my $replica1_name = 'replica';
if ( $vp1 < '8.1' || $vp1->flavor() =~ m/maria/ ) {
if ( $vp1 lt '8.1' || $vp1->flavor() =~ m/maria/ ) {
$replica1_name = 'slave';
}
my $vp2 = VersionParser->new($s2_dbh);
my $replica2_name = 'replica';
if ( $vp2 < '8.1' || $vp2->flavor() =~ m/maria/ ) {
if ( $vp2 lt '8.1' || $vp2->flavor() =~ m/maria/ ) {
$replica2_name = 'slave';
}
@@ -4914,7 +4914,7 @@ sub has_replica_updates {
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -4951,7 +4951,7 @@ sub get_replica_lag {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -5055,7 +5055,7 @@ sub get_replication_filters {
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -9218,7 +9218,7 @@ sub main {
my $vp = VersionParser->new($cxn->dbh());
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}

View File

@@ -10794,7 +10794,7 @@ sub _find_replicas_by_hosts {
my $vp = VersionParser->new($dbh);
my $sql = 'SHOW REPLICAS';
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$sql = 'SHOW SLAVE HOSTS';
$source_name='master';
}
@@ -10873,7 +10873,7 @@ sub is_source_of {
my $replica_version = VersionParser->new($replica);
my $source_name = 'source';
my $source_port = 'source_port';
if ( $replica_version < '8.1' || $replica_version->flavor() =~ m/maria/ ) {
if ( $replica_version lt '8.1' || $replica_version->flavor() =~ m/maria/ ) {
$source_name = 'master';
$source_port = 'master_port';
}
@@ -10920,7 +10920,7 @@ sub get_source_dsn {
my $vp = VersionParser->new($dbh);
my $source_host = 'source_host';
my $source_port = 'source_port';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_host = 'master_host';
$source_port = 'master_port';
}
@@ -10935,7 +10935,7 @@ sub get_replica_status {
my $server_version = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $server_version < '8.1' || $server_version->flavor() =~ m/maria/ ) {
if ( $server_version lt '8.1' || $server_version->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -10998,7 +10998,7 @@ sub get_source_status {
my $vp = VersionParser->new($dbh);
my $source_name = 'binary log';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -11050,7 +11050,7 @@ sub wait_for_source {
}
my $vp = VersionParser->new($replica_dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
my $channel_sql = $vp > '5.6' && $self->{channel} ? ", '$self->{channel}'" : '';
@@ -11078,7 +11078,7 @@ sub stop_replica {
my ( $self, $dbh ) = @_;
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
my $sth = $self->{sths}->{$dbh}->{STOP_REPLICA}
@@ -11093,7 +11093,7 @@ sub start_replica {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
$replica_name = 'slave';
}
@@ -11142,7 +11142,7 @@ sub catchup_to_source {
my $vp = VersionParser->new($replica);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -11191,13 +11191,13 @@ sub catchup_to_same_pos {
my $vp1 = VersionParser->new($s1_dbh);
my $replica1_name = 'replica';
if ( $vp1 < '8.1' || $vp1->flavor() =~ m/maria/ ) {
if ( $vp1 lt '8.1' || $vp1->flavor() =~ m/maria/ ) {
$replica1_name = 'slave';
}
my $vp2 = VersionParser->new($s2_dbh);
my $replica2_name = 'replica';
if ( $vp2 < '8.1' || $vp2->flavor() =~ m/maria/ ) {
if ( $vp2 lt '8.1' || $vp2->flavor() =~ m/maria/ ) {
$replica2_name = 'slave';
}
@@ -11220,7 +11220,7 @@ sub has_replica_updates {
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -11257,7 +11257,7 @@ sub get_replica_lag {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -11361,7 +11361,7 @@ sub get_replication_filters {
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}

View File

@@ -2936,7 +2936,7 @@ sub _find_replicas_by_hosts {
my $vp = VersionParser->new($dbh);
my $sql = 'SHOW REPLICAS';
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$sql = 'SHOW SLAVE HOSTS';
$source_name='master';
}
@@ -3015,7 +3015,7 @@ sub is_source_of {
my $replica_version = VersionParser->new($replica);
my $source_name = 'source';
my $source_port = 'source_port';
if ( $replica_version < '8.1' || $replica_version->flavor() =~ m/maria/ ) {
if ( $replica_version lt '8.1' || $replica_version->flavor() =~ m/maria/ ) {
$source_name = 'master';
$source_port = 'master_port';
}
@@ -3062,7 +3062,7 @@ sub get_source_dsn {
my $vp = VersionParser->new($dbh);
my $source_host = 'source_host';
my $source_port = 'source_port';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_host = 'master_host';
$source_port = 'master_port';
}
@@ -3077,7 +3077,7 @@ sub get_replica_status {
my $server_version = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $server_version < '8.1' || $server_version->flavor() =~ m/maria/ ) {
if ( $server_version lt '8.1' || $server_version->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -3140,7 +3140,7 @@ sub get_source_status {
my $vp = VersionParser->new($dbh);
my $source_name = 'binary log';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -3192,7 +3192,7 @@ sub wait_for_source {
}
my $vp = VersionParser->new($replica_dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
my $channel_sql = $vp > '5.6' && $self->{channel} ? ", '$self->{channel}'" : '';
@@ -3220,7 +3220,7 @@ sub stop_replica {
my ( $self, $dbh ) = @_;
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
my $sth = $self->{sths}->{$dbh}->{STOP_REPLICA}
@@ -3235,7 +3235,7 @@ sub start_replica {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
$replica_name = 'slave';
}
@@ -3284,7 +3284,7 @@ sub catchup_to_source {
my $vp = VersionParser->new($replica);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -3333,13 +3333,13 @@ sub catchup_to_same_pos {
my $vp1 = VersionParser->new($s1_dbh);
my $replica1_name = 'replica';
if ( $vp1 < '8.1' || $vp1->flavor() =~ m/maria/ ) {
if ( $vp1 lt '8.1' || $vp1->flavor() =~ m/maria/ ) {
$replica1_name = 'slave';
}
my $vp2 = VersionParser->new($s2_dbh);
my $replica2_name = 'replica';
if ( $vp2 < '8.1' || $vp2->flavor() =~ m/maria/ ) {
if ( $vp2 lt '8.1' || $vp2->flavor() =~ m/maria/ ) {
$replica2_name = 'slave';
}
@@ -3362,7 +3362,7 @@ sub has_replica_updates {
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -3399,7 +3399,7 @@ sub get_replica_lag {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -3503,7 +3503,7 @@ sub get_replication_filters {
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -5329,7 +5329,7 @@ sub main {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
$replica_name = 'slave';
}
@@ -5435,7 +5435,7 @@ sub watch_server {
my $source_name = 'source';
my $source_change = 'replication source';
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
$source_change = 'master';
$replica_name = 'slave';

View File

@@ -2525,7 +2525,7 @@ sub _find_replicas_by_hosts {
my $vp = VersionParser->new($dbh);
my $sql = 'SHOW REPLICAS';
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$sql = 'SHOW SLAVE HOSTS';
$source_name='master';
}
@@ -2604,7 +2604,7 @@ sub is_source_of {
my $replica_version = VersionParser->new($replica);
my $source_name = 'source';
my $source_port = 'source_port';
if ( $replica_version < '8.1' || $replica_version->flavor() =~ m/maria/ ) {
if ( $replica_version lt '8.1' || $replica_version->flavor() =~ m/maria/ ) {
$source_name = 'master';
$source_port = 'master_port';
}
@@ -2651,7 +2651,7 @@ sub get_source_dsn {
my $vp = VersionParser->new($dbh);
my $source_host = 'source_host';
my $source_port = 'source_port';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_host = 'master_host';
$source_port = 'master_port';
}
@@ -2666,7 +2666,7 @@ sub get_replica_status {
my $server_version = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $server_version < '8.1' || $server_version->flavor() =~ m/maria/ ) {
if ( $server_version lt '8.1' || $server_version->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -2729,7 +2729,7 @@ sub get_source_status {
my $vp = VersionParser->new($dbh);
my $source_name = 'binary log';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -2781,7 +2781,7 @@ sub wait_for_source {
}
my $vp = VersionParser->new($replica_dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
my $channel_sql = $vp > '5.6' && $self->{channel} ? ", '$self->{channel}'" : '';
@@ -2809,7 +2809,7 @@ sub stop_replica {
my ( $self, $dbh ) = @_;
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
my $sth = $self->{sths}->{$dbh}->{STOP_REPLICA}
@@ -2824,7 +2824,7 @@ sub start_replica {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
$replica_name = 'slave';
}
@@ -2873,7 +2873,7 @@ sub catchup_to_source {
my $vp = VersionParser->new($replica);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -2922,13 +2922,13 @@ sub catchup_to_same_pos {
my $vp1 = VersionParser->new($s1_dbh);
my $replica1_name = 'replica';
if ( $vp1 < '8.1' || $vp1->flavor() =~ m/maria/ ) {
if ( $vp1 lt '8.1' || $vp1->flavor() =~ m/maria/ ) {
$replica1_name = 'slave';
}
my $vp2 = VersionParser->new($s2_dbh);
my $replica2_name = 'replica';
if ( $vp2 < '8.1' || $vp2->flavor() =~ m/maria/ ) {
if ( $vp2 lt '8.1' || $vp2->flavor() =~ m/maria/ ) {
$replica2_name = 'slave';
}
@@ -2951,7 +2951,7 @@ sub has_replica_updates {
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -2988,7 +2988,7 @@ sub get_replica_lag {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -3092,7 +3092,7 @@ sub get_replication_filters {
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -4229,7 +4229,7 @@ sub print_node_summary {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
$replica_name = 'slave';
}

View File

@@ -5443,7 +5443,7 @@ sub _find_replicas_by_hosts {
my $vp = VersionParser->new($dbh);
my $sql = 'SHOW REPLICAS';
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$sql = 'SHOW SLAVE HOSTS';
$source_name='master';
}
@@ -5522,7 +5522,7 @@ sub is_source_of {
my $replica_version = VersionParser->new($replica);
my $source_name = 'source';
my $source_port = 'source_port';
if ( $replica_version < '8.1' || $replica_version->flavor() =~ m/maria/ ) {
if ( $replica_version lt '8.1' || $replica_version->flavor() =~ m/maria/ ) {
$source_name = 'master';
$source_port = 'master_port';
}
@@ -5569,7 +5569,7 @@ sub get_source_dsn {
my $vp = VersionParser->new($dbh);
my $source_host = 'source_host';
my $source_port = 'source_port';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_host = 'master_host';
$source_port = 'master_port';
}
@@ -5584,7 +5584,7 @@ sub get_replica_status {
my $server_version = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $server_version < '8.1' || $server_version->flavor() =~ m/maria/ ) {
if ( $server_version lt '8.1' || $server_version->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -5647,7 +5647,7 @@ sub get_source_status {
my $vp = VersionParser->new($dbh);
my $source_name = 'binary log';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -5699,7 +5699,7 @@ sub wait_for_source {
}
my $vp = VersionParser->new($replica_dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
my $channel_sql = $vp > '5.6' && $self->{channel} ? ", '$self->{channel}'" : '';
@@ -5727,7 +5727,7 @@ sub stop_replica {
my ( $self, $dbh ) = @_;
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
my $sth = $self->{sths}->{$dbh}->{STOP_REPLICA}
@@ -5742,7 +5742,7 @@ sub start_replica {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
$replica_name = 'slave';
}
@@ -5791,7 +5791,7 @@ sub catchup_to_source {
my $vp = VersionParser->new($replica);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -5840,13 +5840,13 @@ sub catchup_to_same_pos {
my $vp1 = VersionParser->new($s1_dbh);
my $replica1_name = 'replica';
if ( $vp1 < '8.1' || $vp1->flavor() =~ m/maria/ ) {
if ( $vp1 lt '8.1' || $vp1->flavor() =~ m/maria/ ) {
$replica1_name = 'slave';
}
my $vp2 = VersionParser->new($s2_dbh);
my $replica2_name = 'replica';
if ( $vp2 < '8.1' || $vp2->flavor() =~ m/maria/ ) {
if ( $vp2 lt '8.1' || $vp2->flavor() =~ m/maria/ ) {
$replica2_name = 'slave';
}
@@ -5869,7 +5869,7 @@ sub has_replica_updates {
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -5906,7 +5906,7 @@ sub get_replica_lag {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -6010,7 +6010,7 @@ sub get_replication_filters {
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -10410,7 +10410,7 @@ sub main {
my $vp = VersionParser->new($source_dbh);
my $source_name = 'source';
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
$replica_name = 'replica';
}

View File

@@ -6954,7 +6954,7 @@ sub _find_replicas_by_hosts {
my $vp = VersionParser->new($dbh);
my $sql = 'SHOW REPLICAS';
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$sql = 'SHOW SLAVE HOSTS';
$source_name='master';
}
@@ -7033,7 +7033,7 @@ sub is_source_of {
my $replica_version = VersionParser->new($replica);
my $source_name = 'source';
my $source_port = 'source_port';
if ( $replica_version < '8.1' || $replica_version->flavor() =~ m/maria/ ) {
if ( $replica_version lt '8.1' || $replica_version->flavor() =~ m/maria/ ) {
$source_name = 'master';
$source_port = 'master_port';
}
@@ -7080,7 +7080,7 @@ sub get_source_dsn {
my $vp = VersionParser->new($dbh);
my $source_host = 'source_host';
my $source_port = 'source_port';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_host = 'master_host';
$source_port = 'master_port';
}
@@ -7095,7 +7095,7 @@ sub get_replica_status {
my $server_version = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $server_version < '8.1' || $server_version->flavor() =~ m/maria/ ) {
if ( $server_version lt '8.1' || $server_version->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -7158,7 +7158,7 @@ sub get_source_status {
my $vp = VersionParser->new($dbh);
my $source_name = 'binary log';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -7210,7 +7210,7 @@ sub wait_for_source {
}
my $vp = VersionParser->new($replica_dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
my $channel_sql = $vp > '5.6' && $self->{channel} ? ", '$self->{channel}'" : '';
@@ -7238,7 +7238,7 @@ sub stop_replica {
my ( $self, $dbh ) = @_;
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
my $sth = $self->{sths}->{$dbh}->{STOP_REPLICA}
@@ -7253,7 +7253,7 @@ sub start_replica {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
$replica_name = 'slave';
}
@@ -7302,7 +7302,7 @@ sub catchup_to_source {
my $vp = VersionParser->new($replica);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -7351,13 +7351,13 @@ sub catchup_to_same_pos {
my $vp1 = VersionParser->new($s1_dbh);
my $replica1_name = 'replica';
if ( $vp1 < '8.1' || $vp1->flavor() =~ m/maria/ ) {
if ( $vp1 lt '8.1' || $vp1->flavor() =~ m/maria/ ) {
$replica1_name = 'slave';
}
my $vp2 = VersionParser->new($s2_dbh);
my $replica2_name = 'replica';
if ( $vp2 < '8.1' || $vp2->flavor() =~ m/maria/ ) {
if ( $vp2 lt '8.1' || $vp2->flavor() =~ m/maria/ ) {
$replica2_name = 'slave';
}
@@ -7380,7 +7380,7 @@ sub has_replica_updates {
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -7417,7 +7417,7 @@ sub get_replica_lag {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -7521,7 +7521,7 @@ sub get_replication_filters {
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -10339,7 +10339,7 @@ sub main {
my $vp = VersionParser->new($dsns[1]->{dbh});
my $source_name = 'source';
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
$replica_name = 'replica';
}

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 < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$sql = 'SHOW SLAVE HOSTS';
$source_name='master';
}
@@ -430,7 +430,7 @@ sub is_source_of {
my $replica_version = VersionParser->new($replica);
my $source_name = 'source';
my $source_port = 'source_port';
if ( $replica_version < '8.1' || $replica_version->flavor() =~ m/maria/ ) {
if ( $replica_version lt '8.1' || $replica_version->flavor() =~ m/maria/ ) {
$source_name = 'master';
$source_port = 'master_port';
}
@@ -488,7 +488,7 @@ sub get_source_dsn {
my $vp = VersionParser->new($dbh);
my $source_host = 'source_host';
my $source_port = 'source_port';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_host = 'master_host';
$source_port = 'master_port';
}
@@ -504,7 +504,7 @@ sub get_replica_status {
my $server_version = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $server_version < '8.1' || $server_version->flavor() =~ m/maria/ ) {
if ( $server_version lt '8.1' || $server_version->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -573,7 +573,7 @@ sub get_source_status {
my $vp = VersionParser->new($dbh);
my $source_name = 'binary log';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -646,7 +646,7 @@ sub wait_for_source {
}
my $vp = VersionParser->new($replica_dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
my $channel_sql = $vp > '5.6' && $self->{channel} ? ", '$self->{channel}'" : '';
@@ -679,7 +679,7 @@ sub stop_replica {
my ( $self, $dbh ) = @_;
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
my $sth = $self->{sths}->{$dbh}->{STOP_REPLICA}
@@ -695,7 +695,7 @@ sub start_replica {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
$replica_name = 'slave';
}
@@ -753,7 +753,7 @@ sub catchup_to_source {
my $vp = VersionParser->new($replica);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -805,13 +805,13 @@ sub catchup_to_same_pos {
my $vp1 = VersionParser->new($s1_dbh);
my $replica1_name = 'replica';
if ( $vp1 < '8.1' || $vp1->flavor() =~ m/maria/ ) {
if ( $vp1 lt '8.1' || $vp1->flavor() =~ m/maria/ ) {
$replica1_name = 'slave';
}
my $vp2 = VersionParser->new($s2_dbh);
my $replica2_name = 'replica';
if ( $vp2 < '8.1' || $vp2->flavor() =~ m/maria/ ) {
if ( $vp2 lt '8.1' || $vp2->flavor() =~ m/maria/ ) {
$replica2_name = 'slave';
}
@@ -837,7 +837,7 @@ sub has_replica_updates {
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}
@@ -879,7 +879,7 @@ sub get_replica_lag {
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$source_name = 'master';
}
@@ -1041,7 +1041,7 @@ sub get_replication_filters {
my $vp = VersionParser->new($dbh);
my $replica_name = 'replica';
if ( $vp < '8.1' || $vp->flavor() =~ m/maria/ ) {
if ( $vp lt '8.1' || $vp->flavor() =~ m/maria/ ) {
$replica_name = 'slave';
}

View File

@@ -59,7 +59,7 @@ diag(`/tmp/12347/start >/dev/null`);
sub reset_query_cache {
my @dbhs = @_;
return if ($sandbox_version >= '8.0');
return if ($sandbox_version ge '8.0');
foreach my $dbh (@dbhs) {
$dbh->do('RESET QUERY CACHE');
}

View File

@@ -41,14 +41,14 @@ my $replica_dsn1 = 'h=127.0.0.1,P=12346,u=msandbox,p=msandbox';
my $replica_dsn2 = 'h=127.0.0.1,P=12347,u=msandbox,p=msandbox';
my $sample = "t/pt-online-schema-change/samples";
my ($orig_master_info_repository, $orig_relay_log_info_repository);
if ( $sandbox_version < '8.4' ) {
if ( $sandbox_version lt '8.4' ) {
($orig_master_info_repository) = $replica_dbh1->selectrow_array(q{SELECT @@master_info_repository});
($orig_relay_log_info_repository) = $replica_dbh1->selectrow_array(q{SELECT @@relay_log_info_repository});
}
$replica_dbh1->do("stop ${replica_name}");
$replica_dbh1->do("reset ${replica_name} all");
if ( $sandbox_version < '8.4' ) {
if ( $sandbox_version lt '8.4' ) {
$replica_dbh1->do("SET GLOBAL master_info_repository='TABLE'");
$replica_dbh1->do("SET GLOBAL relay_log_info_repository='TABLE'");
}
@@ -83,7 +83,7 @@ like(
$replica_dbh1->do("STOP ${replica_name}");
$source_dbh->do("RESET ${source_reset}");
$replica_dbh1->do("RESET ${replica_name} ALL");
if ( $sandbox_version < '8.4' ) {
if ( $sandbox_version lt '8.4' ) {
$replica_dbh1->do("SET GLOBAL master_info_repository='${orig_master_info_repository}'");
$replica_dbh1->do("SET GLOBAL relay_log_info_repository='${orig_relay_log_info_repository}'");
}

View File

@@ -62,7 +62,7 @@ $sb->load_file('source', "$sample/create_dsns.sql");
sub reset_query_cache {
my @dbhs = @_;
return if ($sandbox_version >= '8.0');
return if ($sandbox_version ge '8.0');
foreach my $dbh (@dbhs) {
$dbh->do('RESET QUERY CACHE');
}

View File

@@ -55,7 +55,7 @@ diag(`/tmp/12347/start >/dev/null`);
sub reset_query_cache {
my @dbhs = @_;
return if ($sandbox_version >= '8.0');
return if ($sandbox_version ge '8.0');
foreach my $dbh (@dbhs) {
$dbh->do('RESET QUERY CACHE');
}

View File

@@ -45,7 +45,7 @@ my $replica_dsn2 = 'h=127.0.0.1,P=12347,u=msandbox,p=msandbox';
sub reset_query_cache {
my @dbhs = @_;
return if ($sandbox_version >= '8.0');
return if ($sandbox_version ge '8.0');
foreach my $dbh (@dbhs) {
$dbh->do('RESET QUERY CACHE');
}

View File

@@ -45,7 +45,7 @@ my $replica_dsn = 'h=127.0.0.1,P=12346,u=msandbox,p=msandbox';
sub reset_query_cache {
my @dbhs = @_;
return if ($sandbox_version >= '8.0');
return if ($sandbox_version ge '8.0');
foreach my $dbh (@dbhs) {
$dbh->do('RESET QUERY CACHE');
}

View File

@@ -106,7 +106,7 @@ GRANT USAGE ON *.* TO 'bob'@'192.168.1.1';
GRANT USAGE ON *.* TO 'bob'@'localhost';
END_OUTPUT_2
my $expected = $sandbox_version < '5.7' ? $expected_56 : $sandbox_version < '8.0' ? $expected_57 : $sandbox_version < '8.4' ? $expected_80 : $expected_84;
my $expected = $sandbox_version lt '5.7' ? $expected_56 : $sandbox_version lt '8.0' ? $expected_57 : $sandbox_version lt '8.4' ? $expected_80 : $expected_84;
is(
$output,
@@ -144,7 +144,7 @@ $expected_56 = <<'END_OUTPUT_4';
GRANT USAGE ON *.* TO 'bob'@'192.168.1.1';
END_OUTPUT_4
$expected = $sandbox_version < '5.7' ? $expected_56 : $sandbox_version < '8.0' ? $expected_57 : $sandbox_version < '8.4' ? $expected_80 : $expected_84;
$expected = $sandbox_version lt '5.7' ? $expected_56 : $sandbox_version lt '8.0' ? $expected_57 : $sandbox_version lt '8.4' ? $expected_80 : $expected_84;
is(
$output,

View File

@@ -66,7 +66,7 @@ like(
);
SKIP: {
skip "MySQL 8.0+ doesn't have ALL PRIVILEGES", 1 if ($sandbox_version >= '8.0');
skip "MySQL 8.0+ doesn't have ALL PRIVILEGES", 1 if ($sandbox_version ge '8.0');
like(
$output,
qr/^REVOKE ALL PRIVILEGES/m,
@@ -105,7 +105,7 @@ diag(`/tmp/12345/use -u root -e "CREATE USER 'sally'\@'%'"`);
diag(`/tmp/12345/use -u root -e "GRANT SELECT(DateCreated, PckPrice, PaymentStat, SANumber) ON test.t TO 'sally'\@'%'"`);
diag(`/tmp/12345/use -u root -e "GRANT SELECT(city_id), INSERT(city) ON sakila.city TO 'sally'\@'%'"`);
my $postfix = $sandbox_version >= '8.4' ? '-84' : $sandbox_version >= '8.0' ? '-80' : $sandbox_version < '5.7' ? '' : '-57';
my $postfix = $sandbox_version ge '8.4' ? '-84' : $sandbox_version ge '8.0' ? '-80' : $sandbox_version lt '5.7' ? '' : '-57';
# 11
ok(

View File

@@ -100,7 +100,7 @@ ok(
# other than to ensure that there's at least one for each table.
# 2
$row = $source_dbh->selectrow_arrayref("select count(*) from percona.checksums");
my $max_chunks = $sandbox_version < '5.7' ? 60 : 100;
my $max_chunks = $sandbox_version lt '5.7' ? 60 : 100;
ok(
$row->[0] > 25 && $row->[0] < $max_chunks,
@@ -127,7 +127,7 @@ ok(
$row = $source_dbh->selectrow_arrayref("select count(*) from percona.checksums");
my $max_rows = $sandbox_version >= '8.0' ? 102 : $sandbox_version < '5.7' ? 90 : 100;
my $max_rows = $sandbox_version ge '8.0' ? 102 : $sandbox_version lt '5.7' ? 90 : 100;
ok(
$row->[0] >= 75 && $row->[0] <= $max_rows,
'Between 75 and 90 chunks on source'

View File

@@ -21,7 +21,7 @@ my $source_dbh = $sb->get_dbh_for('source');
if ( !$source_dbh ) {
plan skip_all => 'Cannot connect to sandbox source';
} elsif ($sandbox_version >= '8.0') {
} elsif ($sandbox_version ge '8.0') {
plan skip_all => "8.0 requires fix for https://jira.percona.com/browse/PT-1805";
} else {
plan tests => 3;

View File

@@ -70,7 +70,7 @@ like(
stderr => 1,
);
my $return_code = ($sandbox_version >= '5.7') ? 16 : 0;
my $return_code = ($sandbox_version ge '5.7') ? 16 : 0;
is(
$exit_status,