Commit df8c849d authored by unknown's avatar unknown

Bug #2077 Japanese characters in enum/default values are reported incorrectly

parent 74c03743
...@@ -111,3 +111,18 @@ no index ...@@ -111,3 +111,18 @@ no index
drop table t1; 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;
...@@ -73,3 +73,13 @@ create index idx_c1 on t1(c1); ...@@ -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 '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); select c1 as 'no index' from t1 where c1 like cast(concat('%',0xA4A2, '%') as char character set ujis);
drop table t1; 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;
...@@ -1251,7 +1251,7 @@ store_create_info(THD *thd, TABLE *table, String *packet) ...@@ -1251,7 +1251,7 @@ store_create_info(THD *thd, TABLE *table, String *packet)
packet->append(' '); packet->append(' ');
// check for surprises from the previous call to Field::sql_type() // check for surprises from the previous call to Field::sql_type()
if (type.ptr() != tmp) if (type.ptr() != tmp)
type.set(tmp, sizeof(tmp),&my_charset_bin); type.set(tmp, sizeof(tmp), system_charset_info);
field->sql_type(type); field->sql_type(type);
packet->append(type.ptr(), type.length(), system_charset_info); packet->append(type.ptr(), type.length(), system_charset_info);
......
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