Bug #9075 VARCHAR column, of length more than 255, is not accepted when creating a table
Submitted: 9 Mar 2005 15:43 Modified: 30 Mar 2005 9:19
Reporter: Disha Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.0.3-alpha-nt OS:Windows (Windows Server 2003)
Assigned to: Heikki Tuuri CPU Architecture:Any

[9 Mar 2005 15:43] Disha
Description:
If we try to create a table having VARCHAR column of length more than 255 using the InnoDB engine, then it is not accepted and error is displayed.

How to repeat:
 Repro Steps: 
 1. Connect to MySQL server with valid user name and password.

 2. Select the TEST database with the USE command as follows:
 USE TEST

 3. Drop table having name T1 if exists:
 DROP TABLE if exists T1;

 4. Create a table with name T1 having a VARCHAR field of length more than 255 having the InnoDB engine as follows:
 CREATE TABLE T1(F1 VARCHAR(256)) ENGINE=INNODB;

 Expected Results: The table should be created with VARCHAR column having length 256.

 Actual Results: Table creation fails with the following error: ERROR 1074 (42000): Column length too big for column 'F1' (max = 255); use BLOB instead

 Additional Info: If we try to create similar table with MYISAM engine then it is able to create the table with VARCHAR column having length 256.
[9 Mar 2005 17:54] Trudy Pelzer
This is related to Bug#8483.
-- Trudy Pelzer
[16 Mar 2005 14:58] Heikki Tuuri
InnoDB's new true VARCHAR removes this restriction.
[10 Jan 2007 18:14] Carlos Sanchez
Related to Bug#25480, VARCHAR column, of length more than 255, is not accepted as primary key or part of an index
[11 Jan 2007 13:18] Heikki Tuuri
Carlos,

MySQL has much tighter restrictions on the length of indexed columns.

Regards,

Heikki