Bug #5174 SHOW CREATE TABLE hangs up if the table contains half-with katakana enum values
Submitted: 23 Aug 2004 22:55 Modified: 6 Dec 2004 16:37
Reporter: Shuichi Tamagawa Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.1.3-beta OS:Linux (SuSE Linux 9.0)
Assigned to: Alexander Barkov CPU Architecture:Any

[23 Aug 2004 22:55] Shuichi Tamagawa
Description:
SHOW CREATE TABLE hangs up under the following condition

-Server character set is ucs2
-Client character set is ujis
-collation_connection variable is ucs2_general_ci
-The table contains enum column with half-width katakana values
-The column is indexed

The result of show full processlist and desc from another connection are as follows. 

mysql> show full processlist;
+----+------+-----------+------+---------+------+-------+-----------------------+
| Id | User | Host      | db   | Command | Time | State | Info                  |
+----+------+-----------+------+---------+------+-------+-----------------------+
|  6 | root | localhost | ucs2 | Query   |  624 | NULL  | show create table t   |
|  7 | root | localhost | ucs2 | Query   |    0 | NULL  | show full processlist |
+----+------+-----------+------+---------+------+-------+-----------------------+

mysql> desc t;
+-------+-------------------------+------+-----+---------+-------+
| Field | Type                    | Null | Key | Default | Extra |
+-------+-------------------------+------+-----+---------+-------+
| y   | enum('','','','','','') | YES  | MUL | NULL    |       |
+-------+-------------------------+------+-----+---------+-------+

Note:
If I use the default collation_connection variable 'ujis_japanese_ci', no problem.
However, to avoid 'illegal mix of collation' error, I need to set collation_connection = ucs2_general_ci.

How to repeat:
use the attached file "test.txt"

mysql>SOURCE test.txt
mysql>SHOW CREATE TABLE t;
[24 Aug 2004 12:21] Alexander Barkov
Shuichi, It seems you forgot to attach the file. 
Can you please attach it?
[24 Aug 2004 19:00] Shuichi Tamagawa
Test case file to reproduce the problem

Attachment: test.txt (text/plain), 382 bytes.

[24 Aug 2004 19:01] Shuichi Tamagawa
Sorry, I uploaded the attachment now.
[6 Oct 2004 23:35] MySQL Verification Team
Hi Shuichi,

Please test with latest BK source tree because I wasn't able to repeat your
script test case.

Thanks
[7 Oct 2004 19:30] Shuichi Tamagawa
Hi Miguel

I tested on 4.1.6, 5.0.2 and confirmed that it doesn't hang now.
However, the result of SHOW CREATE TABLE is incorrect.

mysql> SHOW CREATE TABLE t \G
*************************** 1. row ***************************
       Table: t
Create Table: CREATE TABLE `t` (
  `t` enum('','','','','','') default NULL,
  KEY `a` (`t`)
) ENGINE=MyISAM DEFAULT CHARSET=ucs2
1 row in set (0.00 sec)

It is supposed to be:
mysql> SHOW CREATE TABLE t \G
*************************** 1. row ***************************
       Table: t
Create Table: CREATE TABLE `t` (
  `a` enum('ア','イ','ウ') default NULL,
  KEY `a` (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=ucs2
1 row in set (0.00 sec)
[21 Oct 2004 4:13] Alexander Barkov
This bug will be fixed in 5.0.
In 4.1 we'll produce an error: cannot create ENUM/SET column with UCS2 character set
[6 Dec 2004 13:14] Alexander Barkov
I decided to fix it in 4.1, as a not-so-complicated solution was found.
Patch is sent for review.
[6 Dec 2004 16:37] Alexander Barkov
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Fixed in 4.1.8