Commit 054d7c9a authored by serg@serg.mysql.com's avatar serg@serg.mysql.com

sql_table.cc key length limit check disabled for FULLTEXT

ft_parser.c	Nasty buffer overflow fixed
parent 67dd1d11
...@@ -141,6 +141,7 @@ TREE * ft_parse(TREE *wtree, byte *doc, int doclen) ...@@ -141,6 +141,7 @@ TREE * ft_parse(TREE *wtree, byte *doc, int doclen)
for (w.pos=doc; doc<end; doc++) for (w.pos=doc; doc<end; doc++)
if (!word_char(*doc)) break; if (!word_char(*doc)) break;
if ((w.len= (uint) (doc-w.pos)) < MIN_WORD_LEN) continue; if ((w.len= (uint) (doc-w.pos)) < MIN_WORD_LEN) continue;
if (w.len >= HA_FT_MAXLEN) continue;
if (!tree_insert(wtree, &w, 0)) if (!tree_insert(wtree, &w, 0))
{ {
delete_tree(wtree); delete_tree(wtree);
......
...@@ -469,7 +469,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, ...@@ -469,7 +469,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
} }
} }
key_info->key_length=(uint16) key_length; key_info->key_length=(uint16) key_length;
if (key_length > file->max_key_length()) if (key_length > file->max_key_length() && key->type != Key::FULLTEXT)
{ {
my_error(ER_TOO_LONG_KEY,MYF(0),file->max_key_length()); my_error(ER_TOO_LONG_KEY,MYF(0),file->max_key_length());
DBUG_RETURN(-1); DBUG_RETURN(-1);
......
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