Commit 47c776bc authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MWL#55: mysql_upgrade_service.exe will now ensure that datadir is always written to my.ini file

parent e3b05c79
...@@ -339,6 +339,8 @@ static void change_service_config() ...@@ -339,6 +339,8 @@ static void change_service_config()
char defaults_file[MAX_PATH]; char defaults_file[MAX_PATH];
char default_character_set[64]; char default_character_set[64];
char buf[MAX_PATH];
int i;
scm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); scm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
if(!scm) if(!scm)
...@@ -376,10 +378,8 @@ static void change_service_config() ...@@ -376,10 +378,8 @@ static void change_service_config()
/* /*
Weird case, no --defaults-file in service definition, need to create one. Weird case, no --defaults-file in service definition, need to create one.
*/ */
char buf[MAX_PATH];
int i;
sprintf_s(props.inifile, MAX_PATH, "%s\\my.ini", props.datadir); sprintf_s(props.inifile, MAX_PATH, "%s\\my.ini", props.datadir);
}
/* /*
Write datadir to my.ini, after converting backslashes to Write datadir to my.ini, after converting backslashes to
...@@ -391,9 +391,8 @@ static void change_service_config() ...@@ -391,9 +391,8 @@ static void change_service_config()
if (buf[i] == '\\') if (buf[i] == '\\')
buf[i]= '/'; buf[i]= '/';
} }
WritePrivateProfileString("mysqld", "datadir",buf, props.inifile); WritePrivateProfileString("mysqld", "datadir",buf, props.inifile);
}
/* /*
Remove basedir from defaults file, otherwise the service wont come up in Remove basedir from defaults file, otherwise the service wont come up in
the new version, and will complain about mismatched message file. the new version, and will complain about mismatched message file.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment