Bug #3475 ALTER TABLE x CHANGE COLUMN var enum ENUM;
Submitted: 15 Apr 2004 4:29 Modified: 29 Dec 2009 5:32
Reporter: Are you mortal Then prepare to die. Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DDL Severity:S4 (Feature request)
Version:na OS:Any (na)
Assigned to: CPU Architecture:Any

[15 Apr 2004 4:29] Are you mortal Then prepare to die.
Description:
This is actually an SQL request.

I would like to be able to automatically create ENUM columns from VARCHAR / CHAR columns which contain only a few terms repeated many times. 

If mysql would do this for me it would be great. 

As it is, creating an 'enum version' of an existing table can be quite involved, requiring several steps. 

How to repeat:

Create an enum column from a varchar / char column which has fewer than ~60,000 distinct terms used repeatedly.

ALTER the table to turn that ENUM back into a VARCHAR / CHAR and wish that the reverse transformation were as easy.

Suggested fix:
Auto generate ENUM data (where possible) for the 

ALTER TABLE ... CHANGE COLUMN ... ENUM;

query.