1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

sql_table.cc:

Bug#11657 Creation of secondary index fails:

  If TINYBLOB key part length is 255, it is equal
  to field length. For BLOB, unlike for CHAR/VARCHAR,
  we should keep a non-zero key part length, otherwise
  "BLOB/TEXT column used in key specification without a key length"
  error is produced afterwards.

type_blob.result, type_blob.test:
  fixing tests accordinly
This commit is contained in:
bar@mysql.com
2005-07-01 15:07:06 +05:00
parent a921d083cb
commit 48f34a0bc5
3 changed files with 25 additions and 2 deletions

View File

@@ -3400,7 +3400,8 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
*/
if (!Field::type_can_have_key_part(cfield->field->type()) ||
!Field::type_can_have_key_part(cfield->sql_type) ||
cfield->field->field_length == key_part_length ||
(cfield->field->field_length == key_part_length &&
!f_is_blob(key_part->key_type)) ||
(cfield->length && (cfield->length < key_part_length /
key_part->field->charset()->mbmaxlen)))
key_part_length= 0; // Use whole field