﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
9431	UNIQUE index on VARCHAR(256+) causes failure on MySQL 5.0 with InnoDB tables, a slightly higher threshold for MyISAM	Adam Nelson	Adam Nelson	"== Description ==

MySQL 5.0 can't handle 256 or more characters on a column with a UNIQUE index if the storage engine is InnoDB and the character set is utf8

== Test ==

Shows 1 byte character set working:
{{{
mysql> create table foo ( x varchar(999), primary key (x)) character set
= 'latin1';
Query OK, 0 rows affected (0.00 sec)
}}}
Shows failure with larger character set (standard python utf8):
{{{
mysql> create table foo2 ( x varchar(999), primary key (x)) character
set = 'utf8';
ERROR 1071 (42000): Specified key was too long; max key length is 999 bytes
}}}
Shows success that works with utf8:
{{{
mysql> create table foo2 ( x varchar(255), primary key (x)) character
set = 'utf8';
Query OK, 0 rows affected (0.01 sec) 
}}}

== Suggested Fix ==

./manage.py validate should throw a validation warning if the database is MySQL

"		closed	Database layer (models, ORM)	1.0		fixed	mysql		Accepted	0	0	1	0	0	0
