summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2019-06-06 15:23:12 +0300
committerMonty <monty@mariadb.org>2019-06-06 15:23:12 +0300
commitd6d5c168cf106535d719c4715986dac4767254ea (patch)
tree8701a3cd9ab456eb24b14cde5530c2ad93a72d6d
parentbb5d04c9b809b6e5542a0739124fc214807d1615 (diff)
downloadmariadb-git-d6d5c168cf106535d719c4715986dac4767254ea.tar.gz
Fixed that test suite doesn't remove duplicate options
- multiple usage of plugin-load-add and optimizer-switch are now included in generated config files
-rw-r--r--mysql-test/lib/My/Config.pm17
1 files changed, 16 insertions, 1 deletions
diff --git a/mysql-test/lib/My/Config.pm b/mysql-test/lib/My/Config.pm
index 12647edf0a4..e148fa1dcb7 100644
--- a/mysql-test/lib/My/Config.pm
+++ b/mysql-test/lib/My/Config.pm
@@ -21,6 +21,17 @@ use strict;
use warnings;
use Carp;
+# Define all MariaDB options that the user should be able to specify
+# many times in the config file. Note that options must be written
+# using '-' instead of '_' here!
+
+my %multipart_options=
+ (
+ "plugin-load-add" => 1,
+ "optimizer-switch" => 1,
+);
+
+
sub new {
my ($class, $option_name, $option_value)= @_;
my $self= bless { name => $option_name,
@@ -327,7 +338,6 @@ sub new {
# Skip comment
next;
}
-
else {
croak "Unexpected line '$line' found in '$path'";
}
@@ -355,6 +365,11 @@ sub insert {
if ( defined $option ) {
#print "option: $option, value: $value\n";
+ my $tmp_option= $option;
+ $tmp_option =~ s/_/-/g;
+
+ # If the option is an option that one can specify many times, always add
+ $if_not_exist= 1 if (@multipart_options{$tmp_option});
# Add the option to the group
$group->insert($option, $value, $if_not_exist);