client.c:

  Bug #3990  	`--with-charset' ./configure's switch doesn'taffect mysql client library.
parent f50066bd
......@@ -1835,15 +1835,19 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
}
/* Set character set */
if (mysql->options.charset_name)
if (!mysql->options.charset_name &&
!(mysql->options.charset_name=
my_strdup(MYSQL_DEFAULT_CHARSET_NAME,MYF(MY_WME))))
goto error;
{
const char *save= charsets_dir;
if (mysql->options.charset_dir)
charsets_dir=mysql->options.charset_dir;
mysql->charset=get_charset_by_csname(mysql->options.charset_name,
MY_CS_PRIMARY,
MYF(MY_WME));
MY_CS_PRIMARY, MYF(MY_WME));
charsets_dir= save;
}
if (!mysql->charset)
{
......@@ -1865,11 +1869,6 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
}
goto error;
}
}
else
{
mysql->charset= default_charset_info;
}
/* Save connection information */
......
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