MWL#55 : Philip's review:
Take into account that mysql services start even with invalid defaults files (using data file relative to mysqld.exe location). Handle this case in upgrade scenarios, as if there was no --defaults-file in service definition.
This commit is contained in:
parent
3ec6533ac8
commit
7ac23980b8
@ -130,17 +130,30 @@ int get_mysql_service_properties(const wchar_t *bin_path,
|
|||||||
get_file_version(props->mysqld_exe, &props->version_major,
|
get_file_version(props->mysqld_exe, &props->version_major,
|
||||||
&props->version_minor, &props->version_patch);
|
&props->version_minor, &props->version_patch);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (have_inifile)
|
if (have_inifile)
|
||||||
{
|
{
|
||||||
/* Easy case, we have --defaults-file in service definition. */
|
/* We have --defaults-file in service definition. */
|
||||||
wcstombs(props->inifile, args[1]+16, MAX_PATH);
|
wcstombs(props->inifile, args[1]+16, MAX_PATH);
|
||||||
normalize_path(props->inifile, MAX_PATH);
|
normalize_path(props->inifile, MAX_PATH);
|
||||||
if (GetFileAttributes(props->inifile) == INVALID_FILE_ATTRIBUTES)
|
if (GetFileAttributes(props->inifile) != INVALID_FILE_ATTRIBUTES)
|
||||||
goto end;
|
{
|
||||||
GetPrivateProfileString("mysqld", "datadir", NULL, props->datadir, MAX_PATH,
|
GetPrivateProfileString("mysqld", "datadir", NULL, props->datadir, MAX_PATH,
|
||||||
props->inifile);
|
props->inifile);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
Service will start even with invalid .ini file, using lookup for
|
||||||
|
datadir relative to mysqld.exe. This is equivalent to the case no ini
|
||||||
|
file used.
|
||||||
|
*/
|
||||||
|
props->inifile[0]= 0;
|
||||||
|
have_inifile= FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if(!have_inifile)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
Hard, although a rare case, we're guessing datadir and defaults-file.
|
Hard, although a rare case, we're guessing datadir and defaults-file.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user