1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +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


sql/sql_table.cc:
  Bug#11657 Creation of secondary index fails
  For TINYBLOB key part length can be equal to field length.
  We should still keep a non-zero key part length,
mysql-test/t/type_blob.test:
  fixing tests accordinly
mysql-test/r/type_blob.result:
  fixing tests accordinly
This commit is contained in:
unknown
2005-07-01 15:07:06 +05:00
parent 8e08a14b08
commit 0e6a93ece3
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