Show charsets dir in error message, instead of just "path: default".

parent 4bdf3ca9
...@@ -178,6 +178,7 @@ extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags); ...@@ -178,6 +178,7 @@ extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
extern my_bool set_default_charset_by_name(const char *cs_name, myf flags); extern my_bool set_default_charset_by_name(const char *cs_name, myf flags);
extern void free_charsets(void); extern void free_charsets(void);
extern char *list_charsets(myf want_flags); /* my_free() this string... */ extern char *list_charsets(myf want_flags); /* my_free() this string... */
extern char *get_charsets_dir(char *buf);
/* statistics */ /* statistics */
......
...@@ -1394,10 +1394,18 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, ...@@ -1394,10 +1394,18 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
if (!mysql->charset) if (!mysql->charset)
{ {
net->last_errno=CR_CANT_READ_CHARSET; net->last_errno=CR_CANT_READ_CHARSET;
if (mysql->options.charset_dir)
sprintf(net->last_error,ER(net->last_errno),
charset_name ? charset_name : "unknown",
mysql->options.charset_dir);
else
{
char cs_dir_name[FN_REFLEN];
get_charsets_dir(cs_dir_name);
sprintf(net->last_error,ER(net->last_errno), sprintf(net->last_error,ER(net->last_errno),
charset_name ? charset_name : "unknown", charset_name ? charset_name : "unknown",
mysql->options.charset_dir ? mysql->options.charset_dir : cs_dir_name);
"default"); }
goto error; goto error;
} }
......
...@@ -94,7 +94,7 @@ static my_bool get_word(struct simpleconfig_buf_st *fb, char *buf) ...@@ -94,7 +94,7 @@ static my_bool get_word(struct simpleconfig_buf_st *fb, char *buf)
} }
static char *get_charsets_dir(char *buf) char *get_charsets_dir(char *buf)
{ {
const char *sharedir = SHAREDIR; const char *sharedir = SHAREDIR;
DBUG_ENTER("get_charsets_dir"); DBUG_ENTER("get_charsets_dir");
......
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