diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-12-10 13:00:08 -0500 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-12-10 13:00:08 -0500 |
commit | ca07ee85ea28d4b820498535508c6b23f089c22c (patch) | |
tree | 1445f647e7b3237031b04339b5be69a183e761eb /scripts | |
parent | 278ff1661a9fcf690b6b7604eb889fd287e6246a (diff) | |
parent | d67aacb4fbb449ffa8db4e3d70fe8756d62b5222 (diff) | |
download | mariadb-git-ca07ee85ea28d4b820498535508c6b23f089c22c.tar.gz |
Merge tag 'mariadb-5.5.47' into 5.5-galera
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mysqld_multi.sh | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 52135071ac5..6b650aa6248 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -572,11 +572,9 @@ sub get_mysqladmin_options return $com; } -#### -#### Return a list of option files which can be opened. Similar, but not -#### identical, to behavior of my_search_option_files() -#### - +# 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; @@ -588,9 +586,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 $_ } - ('/etc/my.cnf', + return ('/etc/my.cnf', '/etc/mysql/my.cnf', '@sysconfdir@/my.cnf', ($ENV{MYSQL_HOME} ? "$ENV{MYSQL_HOME}/my.cnf" : undef), @@ -632,11 +628,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>) { @@ -649,6 +646,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; |