diff options
author | unknown <df@kahlann.erinye.com> | 2006-12-08 10:23:03 +0100 |
---|---|---|
committer | unknown <df@kahlann.erinye.com> | 2006-12-08 10:23:03 +0100 |
commit | 12ac165c2f856ca8e8bf10a85b60722c9cbade64 (patch) | |
tree | 53ccb3f0487573b9f8c1edf99ae12a498c525132 /client/mysql_upgrade.c | |
parent | 1a899c053188113f6057c9d1b7154eacad7b2e62 (diff) | |
download | mariadb-git-12ac165c2f856ca8e8bf10a85b60722c9cbade64.tar.gz |
BUG#24896 mysql_upgrade -p fix
client/mysql_upgrade.c:
BUG#24896 mysql_upgrade core dumps on RHEL3 using 5.0.30 commerical binaries
Diffstat (limited to 'client/mysql_upgrade.c')
-rw-r--r-- | client/mysql_upgrade.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 520d87b5ed7..309b532051c 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -142,6 +142,7 @@ void set_extra_default(int id, const struct my_option *opt) case 'f': /* --force is ours */ case 'u': /* --user passed on cmdline */ case 'T': /* --debug-info is not accepted by mysqlcheck */ + case 'p': /* --password may change yet */ /* so, do nothing */ break; default: @@ -173,7 +174,7 @@ void set_extra_default(int id, const struct my_option *opt) d->id= id; d->name= opt->name; d->n_len= strlen(opt->name); - if (opt->arg_type != NO_ARG) + if (opt->arg_type != NO_ARG && opt->value) switch (opt->var_type & GET_TYPE_MASK) { case GET_BOOL: if (*((int *)opt->value)) @@ -319,6 +320,15 @@ static int create_defaults_file(const char *path, const char *forced_path) } dynstr_set(&buf, "\n[client]"); + if (opt_password) + { + if (dynstr_append_mem(&buf, "\npassword=", 10) + || dynstr_append_mem(&buf, opt_password, strlen(opt_password))) + { + ret = 1; + goto error; + } + } while (extra_defaults) { int len; |