Commit 2530d5ad authored by serg@sergbook.mysql.com's avatar serg@sergbook.mysql.com

Merge work:/home/bk/mysql-4.0

into sergbook.mysql.com:/usr/home/serg/Abk/mysql-4.0
parents daf1a575 888d3cf7
...@@ -370,7 +370,8 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, ...@@ -370,7 +370,8 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
share.state.rec_per_key_part[key_segs-1]=1L; share.state.rec_per_key_part[key_segs-1]=1L;
length+=key_length; length+=key_length;
keydef->block_length= MI_BLOCK_SIZE(length,pointer,MI_MAX_KEYPTR_SIZE); keydef->block_length= MI_BLOCK_SIZE(length,pointer,MI_MAX_KEYPTR_SIZE);
if (keydef->block_length > MI_MAX_KEY_BLOCK_LENGTH) if (keydef->block_length > MI_MAX_KEY_BLOCK_LENGTH ||
length > MI_MAX_KEY_LENGTH)
{ {
my_errno=HA_WRONG_CREATE_OPTION; my_errno=HA_WRONG_CREATE_OPTION;
goto err; goto err;
......
...@@ -627,7 +627,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, ...@@ -627,7 +627,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
if (!(key_info->flags & HA_NULL_PART_KEY)) if (!(key_info->flags & HA_NULL_PART_KEY))
unique_key=1; unique_key=1;
key_info->key_length=(uint16) key_length; key_info->key_length=(uint16) key_length;
uint max_key_length= max(file->max_key_length(), MAX_KEY_LENGTH); uint max_key_length= min(file->max_key_length(), MAX_KEY_LENGTH);
if (key_length > max_key_length && key->type != Key::FULLTEXT) if (key_length > max_key_length && key->type != Key::FULLTEXT)
{ {
my_error(ER_TOO_LONG_KEY,MYF(0),max_key_length); my_error(ER_TOO_LONG_KEY,MYF(0),max_key_length);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment