2 messages in com.mysql.lists.bugsKey over 500 characters fails to error.
FromSent OnAttachments
cfa...@fpsn.net07 Sep 2002 18:55 
Michael Widenius10 Sep 2002 13:41 
Subject:Key over 500 characters fails to error.
From:Michael Widenius (mon@mysql.com)
Date:09/10/2002 01:41:59 PM
List:com.mysql.lists.bugs

Hi!

"cfaber" == cfaber <cfa@fpsn.net> writes:

Description:

cfaber> MySQL no longer reports an error on keys larger than cfaber> 500 characters which results in an errno 138 on the cfaber> new table.

cfaber> I think this is from the latest hack to allow Innodb keys cfaber> greater than 500 characters. However this fails to restrict cfaber> the length on any other table handler.

How-To-Repeat:

<cut>

Fix:

Thanks for the test case. Here is a fix for this:

((/my/mysql-4.0)) bk diffs -c sql/sql_table.cc ===== sql/sql_table.cc 1.129 vs edited ===== *** /tmp/sql_table.cc-1.129-2111 Tue Sep 3 18:02:04 2002 --- edited/sql/sql_table.cc Wed Sep 11 00:12:21 2002 *************** *** 627,633 **** if (!(key_info->flags & HA_NULL_PART_KEY)) unique_key=1; key_info->key_length=(uint16) key_length; ! uint max_key_length= max(file->max_key_length(), MAX_KEY_LENGTH); if (key_length > max_key_length && key->type != Key::FULLTEXT) { my_error(ER_TOO_LONG_KEY,MYF(0),max_key_length); --- 627,633 ---- if (!(key_info->flags & HA_NULL_PART_KEY)) unique_key=1; key_info->key_length=(uint16) key_length; ! uint max_key_length= min(file->max_key_length(), MAX_KEY_LENGTH); if (key_length > max_key_length && key->type != Key::FULLTEXT) { my_error(ER_TOO_LONG_KEY,MYF(0),max_key_length);

Regards, Monty