diff options
author | Anel Husakovic <anel@mariadb.org> | 2018-04-16 20:49:27 +0000 |
---|---|---|
committer | Anel Husakovic <anel@mariadb.org> | 2019-09-13 02:26:16 -0700 |
commit | 3793da44cff600843384d8c5718940d95711511a (patch) | |
tree | b10d925bc892cd6062fef31a37c33103983dab97 /client | |
parent | 3422c13ab748a9da688c00b1b1e522cbcd38d4a7 (diff) | |
download | mariadb-git-3793da44cff600843384d8c5718940d95711511a.tar.gz |
Enable the auto parameter of the flag `default-character-set`
Closes #739
When invoking option `--default-character-set=auto` character set
from underlying OS settings should be detected for mysqldump.
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqldump.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c index b9ff8caed8c..f0c53052a1f 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1057,7 +1057,7 @@ static int get_options(int *argc, char ***argv) my_progname_short); return(EX_USAGE); } - if (strcmp(default_charset, charset_info->csname) && + if (strcmp(default_charset, MYSQL_AUTODETECT_CHARSET_NAME) && !(charset_info= get_charset_by_csname(default_charset, MY_CS_PRIMARY, MYF(MY_WME)))) exit(1); @@ -1522,6 +1522,9 @@ static int switch_character_set_results(MYSQL *mysql, const char *cs_name) char query_buffer[QUERY_LENGTH]; size_t query_length; + if (!strcmp(cs_name, MYSQL_AUTODETECT_CHARSET_NAME)) + cs_name= (char *)my_default_csname(); + /* Server lacks facility. This is not an error, by arbitrary decision . */ if (!server_supports_switching_charsets) return FALSE; |