Commit 3793da44 authored by Anel Husakovic's avatar Anel Husakovic

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.
parent 3422c13a
...@@ -1057,7 +1057,7 @@ static int get_options(int *argc, char ***argv) ...@@ -1057,7 +1057,7 @@ static int get_options(int *argc, char ***argv)
my_progname_short); my_progname_short);
return(EX_USAGE); 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, !(charset_info= get_charset_by_csname(default_charset,
MY_CS_PRIMARY, MYF(MY_WME)))) MY_CS_PRIMARY, MYF(MY_WME))))
exit(1); exit(1);
...@@ -1522,6 +1522,9 @@ static int switch_character_set_results(MYSQL *mysql, const char *cs_name) ...@@ -1522,6 +1522,9 @@ static int switch_character_set_results(MYSQL *mysql, const char *cs_name)
char query_buffer[QUERY_LENGTH]; char query_buffer[QUERY_LENGTH];
size_t 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 . */ /* Server lacks facility. This is not an error, by arbitrary decision . */
if (!server_supports_switching_charsets) if (!server_supports_switching_charsets)
return FALSE; return FALSE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment