summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 4498e1d1c51..77b7070743c 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -4171,6 +4171,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
if (key->type == Key::UNIQUE && !(key_info->flags & HA_NULL_PART_KEY))
unique_key=1;
key_info->key_length=(uint16) key_length;
+ if (key_info->key_length > max_key_length && key->type == Key::UNIQUE)
+ is_hash_field_needed= true;
if (key_length > max_key_length && key->type != Key::FULLTEXT &&
!is_hash_field_needed)
{