From 0a9216835f406947fb4d492616da4cda75e5e113 Mon Sep 17 00:00:00 2001 From: Seppo Jaakola Date: Sat, 13 Jul 2013 13:01:13 +0300 Subject: Initial merge result with mariaDB 10: lp:maria --- mysys/default.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mysys/default.c') diff --git a/mysys/default.c b/mysys/default.c index 70738e11d4b..36f33cd9796 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -87,6 +87,12 @@ static char my_defaults_extra_file_buffer[FN_REFLEN]; static my_bool defaults_already_read= FALSE; +#ifdef WITH_WSREP +/* The only purpose of this global array is to hold full name of my.cnf + * which seems to be otherwise unavailable */ +char wsrep_defaults_file[FN_REFLEN + 10]={0,}; +#endif /* WITH_WREP */ + /* Which directories are searched for options (and in which order) */ #define MAX_DEFAULT_DIRS 6 @@ -803,6 +809,12 @@ static int search_default_file_with_ext(Process_option_func opt_handler, if (!(fp= mysql_file_fopen(key_file_cnf, name, O_RDONLY, MYF(0)))) return 1; /* Ignore wrong files */ +#ifdef WITH_WSREP + /* make sure we do this only once - for top-level file */ + if ('\0' == wsrep_defaults_file[0]) + strncpy(wsrep_defaults_file, name, sizeof(wsrep_defaults_file) - 1); +#endif /* WITH_WSREP */ + while (mysql_file_fgets(buff, sizeof(buff) - 1, fp)) { line++; -- cgit v1.2.1