summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2021-08-29 09:33:00 +0200
committerSergei Golubchik <serg@mariadb.org>2021-08-29 17:32:30 +0200
commit600e4949062e848e035e2649792a8fed963e6a91 (patch)
tree7937d14505358b1d8a4a8d24d8eaf4d780ac7a9a
parentfe2a7048e7c7345f0e011ef800346d744402bb2d (diff)
downloadmariadb-git-600e4949062e848e035e2649792a8fed963e6a91.tar.gz
mtr: fix the check where a combination is pre-selected
if all options from a combination from the combinations file are already present in the server's list of options, then don't try to run tests in other combinations from this file. old behavior was: if at least one option from a combination is already present in the list...
-rw-r--r--mysql-test/lib/My/Options.pm22
-rw-r--r--mysql-test/lib/mtr_cases.pm6
2 files changed, 11 insertions, 17 deletions
diff --git a/mysql-test/lib/My/Options.pm b/mysql-test/lib/My/Options.pm
index 6e0efe862e7..5827e0666a6 100644
--- a/mysql-test/lib/My/Options.pm
+++ b/mysql-test/lib/My/Options.pm
@@ -140,24 +140,16 @@ sub diff {
}
-sub is_set {
- my ($opts, $set_opts)= @_;
+sub is_subset {
+ my ($set, $subset)= @_;
+ my %cache = map { _split_option($_) } @$set;
- foreach my $opt (@$opts){
-
- my ($opt_name1, $value1)= _split_option($opt);
-
- foreach my $set_opt (@$set_opts){
- my ($opt_name2, $value2)= _split_option($set_opt);
-
- if ($opt_name1 eq $opt_name2 and $value1 eq $value2){
- # Option already set
- return 1;
- }
- }
+ for (@$subset){
+ my ($name, $value)= _split_option($_);
+ return 0 unless exists $cache{$name} and $cache{$name} eq $value;
}
- return 0;
+ return 1;
}
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index 8c94c281edf..27803ff1d85 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -623,8 +623,10 @@ sub make_combinations($$@)
{
# Skip all other combinations if the values they change
# are already fixed in master_opt or slave_opt
- if (My::Options::is_set($test->{master_opt}, $comb->{comb_opt}) &&
- My::Options::is_set($test->{slave_opt}, $comb->{comb_opt}) ){
+ # (empty combinations are not considered a subset of anything)
+ if (@{$comb->{comb_opt}} &&
+ My::Options::is_subset($test->{master_opt}, $comb->{comb_opt}) &&
+ My::Options::is_subset($test->{slave_opt}, $comb->{comb_opt}) ){
$test_combs->{$comb->{name}} = 2;