Bug #13253 | InnoDB causes error when a long sub-part index is created. | ||
---|---|---|---|
Submitted: | 16 Sep 2005 2:47 | Modified: | 19 Sep 2005 8:16 |
Reporter: | Sadao Hiratsuka (Basic Quality Contributor) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S3 (Non-critical) |
Version: | 5.0.10 | OS: | Linux (Linux) |
Assigned to: | Osku Salerma | CPU Architecture: | Any |
[16 Sep 2005 2:47]
Sadao Hiratsuka
[16 Sep 2005 4:07]
MySQL Verification Team
Most probably a feature request. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 to server version: 5.0.14-rc-debug Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> create table test_i1ng (col1 varchar(2000), index (col1(768))) -> character set = latin1 engine = innodb; ERROR 1005 (HY000): Can't create table './test/test_i1ng.frm' (errno: 139) mysql> create table test_m1ng (col1 varchar(2000), index (col1(1001))) -> character set = latin1 engine = myisam; Query OK, 0 rows affected, 1 warning (0.07 sec) mysql> show warnings; +---------+------+----------------------------------------------------------+ | Level | Code | Message | +---------+------+----------------------------------------------------------+ | Warning | 1071 | Specified key was too long; max key length is 1000 bytes | +---------+------+----------------------------------------------------------+ 1 row in set (0.00 sec) mysql> exit Bye miguel@hegel:~/dbs/5.0> bin/perror 139 MySQL error code 139: Too big row miguel@hegel:~/dbs/5.0>
[16 Sep 2005 4:55]
Heikki Tuuri
Hi! Since InnoDB may store 'externally' tails of columns whose length is > 768 bytes, you cannot create a column prefix index on the first 769 bytes of a column, or a normal index on a column whose length is 769 bytes. Osku, please check that an error is returned by 5.0.14 in the above cases. Error 139 is 'Too long row'. We should fix this so that MySQL would return a more descriptive error. Is it enough to return a warning and truncate the index? In my opinion, no. An error is better noticed by the user. Regards, Heikki
[16 Sep 2005 11:13]
Osku Salerma
I've tested things a bit. Normal indexes in InnoDB have a maximum length of 1024 bytes, not 767. Prefix indexes have a maximum length of 767, not 768. At least these manual pages talk about a limit of 1000 for InnoDB which is wrong: http://dev.mysql.com/doc/mysql/en/indexes.html http://dev.mysql.com/doc/mysql/en/create-table.html
[19 Sep 2005 8:16]
Osku Salerma
The actual bug in this case is that index lengths 768-1024 are accepted at all, which has been split into its own bug #13315. A better error message could surely be used, but the same could be said for almost every error, and the exact mechanism by which detailed error messages can be created is still being hashed out (see bug #3443). So I'm closing this specific bug.