summaryrefslogtreecommitdiff
path: root/sql/mysql_upgrade_service.cc
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2011-02-08 12:05:16 +0100
committerVladislav Vaintroub <wlad@montyprogram.com>2011-02-08 12:05:16 +0100
commit47c776bc4cac416b677c2b4588c7a7dc54278a79 (patch)
treeac7510ddf9565a3c3f6b819b996ddb795f5215a4 /sql/mysql_upgrade_service.cc
parente3b05c79c61e3d742d687e121aaca08c4e1b42bb (diff)
downloadmariadb-git-47c776bc4cac416b677c2b4588c7a7dc54278a79.tar.gz
MWL#55: mysql_upgrade_service.exe will now ensure that datadir is always written to my.ini file
Diffstat (limited to 'sql/mysql_upgrade_service.cc')
-rw-r--r--sql/mysql_upgrade_service.cc29
1 files changed, 14 insertions, 15 deletions
diff --git a/sql/mysql_upgrade_service.cc b/sql/mysql_upgrade_service.cc
index fea10076a54..1f18ef2ab40 100644
--- a/sql/mysql_upgrade_service.cc
+++ b/sql/mysql_upgrade_service.cc
@@ -339,6 +339,8 @@ static void change_service_config()
char defaults_file[MAX_PATH];
char default_character_set[64];
+ char buf[MAX_PATH];
+ int i;
scm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
if(!scm)
@@ -376,24 +378,21 @@ static void change_service_config()
/*
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);
+ }
- /*
- Write datadir to my.ini, after converting backslashes to
- unix style slashes.
- */
- strcpy_s(buf, MAX_PATH, props.datadir);
- for(i=0; buf[i]; i++)
- {
- if (buf[i] == '\\')
- buf[i]= '/';
- }
-
- WritePrivateProfileString("mysqld", "datadir",buf, props.inifile);
+ /*
+ Write datadir to my.ini, after converting backslashes to
+ unix style slashes.
+ */
+ strcpy_s(buf, MAX_PATH, props.datadir);
+ for(i=0; buf[i]; i++)
+ {
+ if (buf[i] == '\\')
+ buf[i]= '/';
}
+ WritePrivateProfileString("mysqld", "datadir",buf, props.inifile);
+
/*
Remove basedir from defaults file, otherwise the service wont come up in
the new version, and will complain about mismatched message file.