diff options
author | ram@gw.mysql.r18.ru <> | 2003-12-16 17:39:33 +0400 |
---|---|---|
committer | ram@gw.mysql.r18.ru <> | 2003-12-16 17:39:33 +0400 |
commit | 795c88517e10580bcabe8314184c9b90176fdfb3 (patch) | |
tree | 660f505bb2dce4c0702b3e56b69e6c82af2a30fa /sql/sql_show.cc | |
parent | 0462f48b344633c7d88d12d9667f4bd50b91c552 (diff) | |
download | mariadb-git-795c88517e10580bcabe8314184c9b90176fdfb3.tar.gz |
proper fix for the bug #2077: accented characters in enum/defaul values are reported incorrectly.
note: bar asked me to use res.charset in ::sql_type() functions to be more consistent.
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 855b5d1e97e..781ee2e7082 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -688,14 +688,14 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild, { byte *pos; uint flags=field->flags; - String type(tmp,sizeof(tmp), field->charset()); + String type(tmp,sizeof(tmp), system_charset_info); uint col_access; bool null_default_value=0; protocol->prepare_for_resend(); protocol->store(field->field_name, system_charset_info); field->sql_type(type); - protocol->store(type.ptr(), type.length(), type.charset()); + protocol->store(type.ptr(), type.length(), system_charset_info); if (verbose) protocol->store(field->has_charset() ? field->charset()->name : "NULL", system_charset_info); @@ -1117,7 +1117,13 @@ store_create_info(THD *thd, TABLE *table, String *packet) type.set(tmp, sizeof(tmp), field->charset()); field->val_str(&type,&type); if (type.length()) - append_unescaped(packet, type.ptr(), type.length()); + { + String def_val; + /* convert to system_charset_info == utf8 */ + def_val.copy(type.ptr(), type.length(), field->charset(), + system_charset_info); + append_unescaped(packet, def_val.ptr(), def_val.length()); + } else packet->append("''",2); } |