diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-12-13 00:10:40 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-12-13 00:10:40 +0100 |
commit | 162399515813a4e23c8735473f9d2dd622a6679b (patch) | |
tree | 39077fdabea60983c59899ce3d28e84c4d97c7e6 /scripts | |
parent | 5908d7ebb81bc2d52c67e519a4643372cb9f08bd (diff) | |
parent | 0ed474484c037a32bea32abaecd3ff770f40bd49 (diff) | |
download | mariadb-git-162399515813a4e23c8735473f9d2dd622a6679b.tar.gz |
Merge branch '5.5' into 10.0
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 c567d434047..45ad0467163 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -486,6 +486,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; @@ -497,9 +498,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), @@ -539,11 +538,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>) { @@ -556,6 +556,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; |