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

Fix reporting of type for unique key on VARCHAR field. (Bug #11227)

mysql-test/r/key.result:
  Add new results
mysql-test/t/key.test:
  Add new regression test
sql/table.cc:
  Use keyinfo->key_parts to determine if key is part of a
  multiple-field key or is unique.
This commit is contained in:
unknown
2005-06-22 12:46:21 -07:00
parent bbc0211304
commit d93705b837
3 changed files with 44 additions and 4 deletions

View File

@@ -701,10 +701,9 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
key_part->key_part_flag|= HA_BIT_PART;
if (i == 0 && key != primary_key)
field->flags |=
((keyinfo->flags & HA_NOSAME) &&
field->key_length() ==
keyinfo->key_length ? UNIQUE_KEY_FLAG : MULTIPLE_KEY_FLAG);
field->flags |= ((keyinfo->flags & HA_NOSAME) &&
(keyinfo->key_parts == 1)) ?
UNIQUE_KEY_FLAG : MULTIPLE_KEY_FLAG;
if (i == 0)
field->key_start.set_bit(key);
if (field->key_length() == key_part->length &&