diff options
author | jimw@mysql.com <> | 2005-01-06 01:08:03 +0100 |
---|---|---|
committer | jimw@mysql.com <> | 2005-01-06 01:08:03 +0100 |
commit | 9971b2f0f582ef3c744000a28421f1945609a89c (patch) | |
tree | 1f51b36818994e674293a78538157f17f0c16b16 /client/mysqladmin.cc | |
parent | a3f184f5329dbd6086bca7d4d2a2f6b29cbe217b (diff) | |
download | mariadb-git-9971b2f0f582ef3c744000a28421f1945609a89c.tar.gz |
Add support for --default-character-set to mysqladmin (Bug #7524)
Diffstat (limited to 'client/mysqladmin.cc')
-rw-r--r-- | client/mysqladmin.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 2e8b3cd588a..ae92765dfdf 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -33,7 +33,8 @@ #define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */ #define MAX_TRUNC_LENGTH 3 -char *host= NULL, *user= 0, *opt_password= 0; +char *host= NULL, *user= 0, *opt_password= 0, + *default_charset= NULL; char truncated_var_names[MAX_MYSQL_VAR][MAX_TRUNC_LENGTH]; char ex_var_names[MAX_MYSQL_VAR][FN_REFLEN]; ulonglong last_values[MAX_MYSQL_VAR]; @@ -145,6 +146,9 @@ static struct my_option my_long_options[] = {"character-sets-dir", OPT_CHARSETS_DIR, "Directory where character sets are.", (gptr*) &charsets_dir, (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"default-character-set", OPT_DEFAULT_CHARSET, + "Set the default character set.", (gptr*) &default_charset, + (gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Connect to host.", (gptr*) &host, (gptr*) &host, 0, GET_STR, @@ -343,6 +347,8 @@ int main(int argc,char *argv[]) if (shared_memory_base_name) mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name); #endif + if (default_charset) + mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset); if (sql_connect(&mysql, option_wait)) { unsigned int err= mysql_errno(&mysql); |