diff options
author | unknown <bar@bar.intranet.mysql.r18.ru> | 2004-06-07 17:28:31 +0500 |
---|---|---|
committer | unknown <bar@bar.intranet.mysql.r18.ru> | 2004-06-07 17:28:31 +0500 |
commit | d23821d5156cf284a24975fde1bf01032324dd9c (patch) | |
tree | e4f9cccb56aba588470e2c6af3790d36b83e6f1f /sql-common | |
parent | 8e5d446227cb3c41794f198308a83a542be19a0e (diff) | |
download | mariadb-git-d23821d5156cf284a24975fde1bf01032324dd9c.tar.gz |
client.c:
Bug #3990 `--with-charset' ./configure's switch doesn'taffect mysql client library.
sql-common/client.c:
Bug #3990 `--with-charset' ./configure's switch doesn'taffect mysql client library.
Diffstat (limited to 'sql-common')
-rw-r--r-- | sql-common/client.c | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/sql-common/client.c b/sql-common/client.c index 87e62b5cd11..962faf5cbe1 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1835,40 +1835,39 @@ 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) - { - net->last_errno=CR_CANT_READ_CHARSET; - strmov(net->sqlstate, unknown_sqlstate); - if (mysql->options.charset_dir) - my_snprintf(net->last_error, sizeof(net->last_error)-1, - ER(net->last_errno), - mysql->options.charset_name, - mysql->options.charset_dir); - else - { - char cs_dir_name[FN_REFLEN]; - get_charsets_dir(cs_dir_name); - my_snprintf(net->last_error, sizeof(net->last_error)-1, - ER(net->last_errno), - mysql->options.charset_name, - cs_dir_name); - } - goto error; - } } - else + + if (!mysql->charset) { - mysql->charset= default_charset_info; + net->last_errno=CR_CANT_READ_CHARSET; + strmov(net->sqlstate, unknown_sqlstate); + if (mysql->options.charset_dir) + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(net->last_errno), + mysql->options.charset_name, + mysql->options.charset_dir); + else + { + char cs_dir_name[FN_REFLEN]; + get_charsets_dir(cs_dir_name); + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(net->last_errno), + mysql->options.charset_name, + cs_dir_name); + } + goto error; } |