summaryrefslogtreecommitdiff
path: root/mysql-test/lib/My
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-08-31 08:36:59 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-08-31 08:36:59 +0300
commite835cc851e389770219a33037af65db8887cc9a8 (patch)
tree84305de5bfaf4d2e2fc8977cd118b5820f8e581f /mysql-test/lib/My
parentb378ddb3d3c3af75195d328018259369671bb029 (diff)
parentceb40ef45b735f7e35aa87306b220a8493f4d754 (diff)
downloadmariadb-git-e835cc851e389770219a33037af65db8887cc9a8.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/lib/My')
-rw-r--r--mysql-test/lib/My/Options.pm22
1 files changed, 7 insertions, 15 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;
}