diff options
author | unknown <msvensson@shellback.(none)> | 2006-11-21 00:46:13 +0100 |
---|---|---|
committer | unknown <msvensson@shellback.(none)> | 2006-11-21 00:46:13 +0100 |
commit | 4cd2aa73dda449dfc972b95ab2418d30cb9f97eb (patch) | |
tree | 2aac571102665d245c17cfcef0c576b10767049c /client/mysql_upgrade.c | |
parent | 2244f8e73ddf5b8023093f0b7e890f44420185be (diff) | |
download | mariadb-git-4cd2aa73dda449dfc972b95ab2418d30cb9f97eb.tar.gz |
Port mysql_upgrade to be tested on windows
client/mysql_upgrade.c:
Send error messages to stderr
Add new define EXTRA_CLIENT_PATHS containing additional paths where
to look for the client binaries
Diffstat (limited to 'client/mysql_upgrade.c')
-rw-r--r-- | client/mysql_upgrade.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 849cef2287c..37cbeb81e1d 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -31,10 +31,12 @@ const char *mysqlcheck_name= "mysqlcheck.exe"; const char *mysql_name= "mysql.exe"; const char *mysqld_name= "mysqld.exe"; +#define EXTRA_CLIENT_PATHS "client/release", "client/debug" #else const char *mysqlcheck_name= "mysqlcheck"; const char *mysql_name= "mysql"; const char *mysqld_name= "mysqld"; +#define EXTRA_CLIENT_PATHS "client" #endif /*__WIN__*/ extern TYPELIB sql_protocol_typelib; @@ -497,8 +499,9 @@ int main(int argc, char **argv) "mysql", NullS)) { ret= 1; - puts("Can't find data directory. Please restart with" - " --datadir=path-to-writable-data-dir"); + fprintf(stderr, + "Can't find data directory. Please restart with" + " --datadir=path-to-writable-data-dir"); goto error; } @@ -541,11 +544,13 @@ int main(int argc, char **argv) } if (find_file(mysqlcheck_name, basedir, MYF(0), path, sizeof(path), - "bin", "client", NullS)) + "bin", EXTRA_CLIENT_PATHS, NullS)) { ret= 1; - printf("Can't find program '%s'\n", mysqlcheck_name); - puts("Please restart with --basedir=mysql-install-directory"); + fprintf(stderr, + "Can't find program '%s'\n" + "Please restart with --basedir=mysql-install-directory", + mysqlcheck_name); goto error; } else @@ -567,7 +572,7 @@ int main(int argc, char **argv) ret= system(cmdline.str); if (ret) { - printf("Error executing '%s'\n", cmdline.str); + fprintf(stderr, "Error executing '%s'\n", cmdline.str); goto error; } @@ -578,12 +583,13 @@ int main(int argc, char **argv) fix_priv_tables: if (find_file(mysql_name, basedir, MYF(0), path, sizeof(path), - "bin", "client", NullS)) + "bin", EXTRA_CLIENT_PATHS, NullS)) { ret= 1; - puts("Could not find MySQL command-line client (mysql).\n" - "Please use --basedir to specify the directory" - " where MySQL is installed."); + fprintf(stderr, + "Could not find MySQL command-line client (mysql).\n" + "Please use --basedir to specify the directory" + " where MySQL is installed."); goto error; } else @@ -598,9 +604,10 @@ fix_priv_tables: "share/mysql", NullS)) { ret= 1; - puts("Could not find file " MYSQL_FIX_PRIV_TABLES_NAME "\n" - "Please use --basedir to specify the directory" - " where MySQL is installed"); + fprintf(stderr, + "Could not find file " MYSQL_FIX_PRIV_TABLES_NAME "\n" + "Please use --basedir to specify the directory" + " where MySQL is installed"); goto error; } else @@ -621,7 +628,7 @@ fix_priv_tables: ret= system(cmdline.str); if (ret) - printf("Error executing '%s'\n", cmdline.str); + fprintf(stderr, "Error executing '%s'\n", cmdline.str); error: dynstr_free(&cmdline); |