diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result index cc062094535..7c3ae52cbc9 100644 --- a/mysql-test/r/ctype_ujis.result +++ b/mysql-test/r/ctype_ujis.result @@ -111,3 +111,18 @@ no index あ あ drop table t1; +CREATE TABLE t1 ( +a char(1) NOT NULL default '', +b enum('あ','い') default NULL +) CHARACTER SET ujis; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(1) NOT NULL default '', + `b` enum('あ','い') default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW COLUMNS FROM t1; +Field Type Null Key Default Extra +a char(1) +b enum('あ','い') YES NULL +DROP TABLE t1; diff --git a/mysql-test/t/ctype_ujis.test b/mysql-test/t/ctype_ujis.test index 6281f2a4249..e5405d9f1bd 100644 --- a/mysql-test/t/ctype_ujis.test +++ b/mysql-test/t/ctype_ujis.test @@ -73,3 +73,13 @@ create index idx_c1 on t1(c1); select c1 as 'using index' from t1 where c1 like cast(concat(0xA4A2, '%') as char character set ujis); select c1 as 'no index' from t1 where c1 like cast(concat('%',0xA4A2, '%') as char character set ujis); drop table t1; + + +# Bug 2077 +CREATE TABLE t1 ( + a char(1) NOT NULL default '', + b enum('あ','い') default NULL +) CHARACTER SET ujis; +SHOW CREATE TABLE t1; +SHOW COLUMNS FROM t1; +DROP TABLE t1; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 6c4b65a4a70..0b565968b08 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1251,7 +1251,7 @@ store_create_info(THD *thd, TABLE *table, String *packet) packet->append(' '); // check for surprises from the previous call to Field::sql_type() if (type.ptr() != tmp) - type.set(tmp, sizeof(tmp),&my_charset_bin); + type.set(tmp, sizeof(tmp), system_charset_info); field->sql_type(type); packet->append(type.ptr(), type.length(), system_charset_info);