Description:
Attempts to index a blob/text column via a 0-length prefix are rejected by the server with error 1170, as if no prefix had been provided. Aside from this obvious documentation-omission-slash-misleading-error bug, I'd like to actually request the ability to index empty prefixes, as I have a text column where I'm only interested in indexing its null status, and not its contents.
How to repeat:
mysql> create table tmp (id int, error text);
Query OK, 0 rows affected (0.04 sec)
mysql> alter table tmp add index (id, error(0));
ERROR 1170: BLOB column 'error' used in key specification without a key length
Suggested fix:
Short term: return a more appropriate error message (1089 maybe?)
Long term: do as I asked. :)