summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2006-11-21 16:51:47 +0100
committerunknown <msvensson@neptunus.(none)>2006-11-21 16:51:47 +0100
commit8f93a6c97707b2d7f4aad8198d82bd7ec7d7d130 (patch)
tree8b713a9a23cb42f2d7faaeb2b7892fbf33ceb373 /client
parent0aad12d99e6bca631a04c5c52e31d9298da91222 (diff)
parente7065e0643e7d59baccf917acdc15add5b7fcdbf (diff)
downloadmariadb-git-8f93a6c97707b2d7f4aad8198d82bd7ec7d7d130.tar.gz
Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
into neptunus.(none):/home/msvensson/mysql/mysql-5.1-new-maint client/mysql_upgrade.c: Auto merged client/mysqltest.c: Auto merged mysql-test/lib/mtr_report.pl: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/t/system_mysql_db_fix30020.test: Auto merged scripts/mysql_fix_privilege_tables.sql: Auto merged
Diffstat (limited to 'client')
-rw-r--r--client/mysql_upgrade.c35
-rw-r--r--client/mysqltest.c18
2 files changed, 33 insertions, 20 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);
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 561bc541c74..6871701e691 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -4138,8 +4138,9 @@ void init_win_path_patterns()
/* List of string patterns to match in order to find paths */
const char* paths[] = { "$MYSQL_TEST_DIR",
"$MYSQL_TMP_DIR",
- "./test/", 0 };
- int num_paths= 3;
+ "$MYSQLTEST_VARDIR",
+ "./test/" };
+ int num_paths= sizeof(paths)/sizeof(char*);
int i;
char* p;
@@ -4159,6 +4160,13 @@ void init_win_path_patterns()
else
p= my_strdup(paths[i], MYF(MY_FAE));
+ /* Don't insert zero length strings in patterns array */
+ if (strlen(p) == 0)
+ {
+ my_free(p, MYF(0));
+ continue;
+ }
+
if (insert_dynamic(&patterns, (gptr) &p))
die(NullS);
@@ -4208,7 +4216,7 @@ void fix_win_paths(const char *val, int len)
{
const char** pattern= dynamic_element(&patterns, i, const char**);
DBUG_PRINT("info", ("pattern: %s", *pattern));
- if (strlen(*pattern) == 0) continue;
+
/* Search for the path in string */
while ((p= strstr(val, *pattern)))
{
@@ -6448,7 +6456,7 @@ int reg_replace(char** buf_p, int* buf_len_p, char *pattern,
{
my_regex_t r;
my_regmatch_t *subs;
- char *buf_end, *replace_end;
+ char *replace_end;
char *buf= *buf_p;
int len;
int buf_len, need_buf_len;
@@ -6468,8 +6476,6 @@ int reg_replace(char** buf_p, int* buf_len_p, char *pattern,
SECURE_REG_BUF
- buf_end= buf + buf_len;
-
if (icase)
cflags|= REG_ICASE;