Bug #4899 limit on index length for blob
Submitted: 4 Aug 2004 21:18 Modified: 6 Aug 2004 10:34
Reporter: Alexei Filine Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:mysql-max-4.1.3-beta-pc-linux-i686 OS:Linux (RH7.3-x86)
Assigned to: CPU Architecture:Any

[4 Aug 2004 21:18] Alexei Filine
Description:
wrong index limit for blobs

How to repeat:
mysql> CREATE TABLE IF NOT EXISTS a (id BIGINT NOT NULL auto_increment, name BLOB, PRIMARY KEY  (id),INDEX  (name(512))) type=innodb;
ERROR 1005 (HY000): Can't create table './fil_crab/a.frm' (errno: -1)

after the error server denies any try to create any table with the name:

actual server limit is 511 bytes while "Prefixes can be up to 255 bytes long (or 1000 bytes for MyISAM and InnoDB tables as of MySQL 4.1.2)":
http://dev.mysql.com/doc/mysql/en/Indexes.html

besides table name became "invalid":

mysql> CREATE TABLE IF NOT EXISTS a (id BIGINT NOT NULL auto_increment, PRIMARY KEY  (id)) type=innodb;
ERROR 1005 (HY000): Can't create table './fil_crab/a.frm' (errno: 121)

the name is permitted for usage only after current database recreation
[4 Aug 2004 21:27] Alexei Filine
mysql-max-4.1.3-beta-pc-linux-i686
[6 Aug 2004 10:34] Alexander Keremidarski
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:

mysql> CREATE TABLE IF NOT EXISTS a (id BIGINT NOT NULL auto_increment, name
    -> BLOB, PRIMARY KEY  (id),INDEX  (name(512))) type=innodb;
Query OK, 0 rows affected, 1 warning (0.22 sec)
 
mysql> select version();
+----------------------+
| version()            |
+----------------------+
| 4.1.4-beta-debug-log |
+----------------------+