diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-12-21 21:24:22 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-12-21 21:24:22 +0100 |
commit | a2bcee626d4ef2836e38e4932305871390164644 (patch) | |
tree | b41e357427318bad8985078b91bbd2b0360defc8 /scripts | |
parent | 1788bfe93a745582d938a608d5959b7d2e6b2f23 (diff) | |
parent | 4fdf25afa8188905653a83e08fc387243e584600 (diff) | |
download | mariadb-git-a2bcee626d4ef2836e38e4932305871390164644.tar.gz |
Merge branch '10.0' into 10.1
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mysqld_multi.sh | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index e3f8e50122c..ca259e5396d 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -490,6 +490,7 @@ sub get_mysqladmin_options # Return a list of option files which can be opened. Similar, but not # identical, to behavior of my_search_option_files() +# TODO implement and use my_print_defaults --list-groups instead sub list_defaults_files { my %opt; @@ -501,9 +502,7 @@ sub list_defaults_files return ($opt{file}) if exists $opt{file}; - my %seen; # Don't list the same file more than once - return grep { defined $_ and not $seen{$_}++ and -f $_ and -r $_ } - ('@sysconfdir@/my.cnf', + return ('@sysconfdir@/my.cnf', '@sysconfdir@/mysql/my.cnf', '@prefix@/my.cnf', ($ENV{MYSQL_HOME} ? "$ENV{MYSQL_HOME}/my.cnf" : undef), @@ -543,11 +542,12 @@ sub find_groups } } + my %seen; my @defaults_files = list_defaults_files(); - #warn "@{[sort keys %gids]} -> @defaults_files\n"; - foreach my $file (@defaults_files) + while (@defaults_files) { - next unless open CONF, "< $file"; + my $file = shift @defaults_files; + next unless defined $file and not $seen{$file}++ and open CONF, '<', $file; while (<CONF>) { @@ -560,6 +560,14 @@ sub find_groups push @groups, "$1$2"; } } + elsif (/^\s*!include\s+(\S.*?)\s*$/) + { + push @defaults_files, $1; + } + elsif (/^\s*!includedir\s+(\S.*?)\s*$/) + { + push @defaults_files, <$1/*.cnf>; + } } close CONF; |