Merge work.mysql.com:/home/bk/mysql

into mysql.sashanet.com:/home/sasha/src/bk/mysql
This commit is contained in:
sasha@mysql.sashanet.com 2000-11-16 10:38:01 -07:00
commit ea0f9d358c
2 changed files with 27 additions and 15 deletions

View File

@ -1,2 +1,3 @@
monty@donna.mysql.com monty@donna.mysql.com
sasha@mysql.sashanet.com sasha@mysql.sashanet.com
serg@serg.mysql.com

View File

@ -1975,33 +1975,44 @@ bool Item_func_match::fix_index()
} }
} }
uint max_cnt=0, max_key=0; uint max_cnt=0, mkeys=0;
for (key=0 ; key<fts ; key++) for (key=0 ; key<fts ; key++)
{ {
if (ft_cnt[key] > max_cnt) if (ft_cnt[key] > max_cnt)
{ {
max_cnt=ft_cnt[key]; mkeys=0;
max_key=ft_to_key[key]; max_cnt=ft_cnt[mkeys]=ft_cnt[key];
ft_to_key[mkeys]=ft_to_key[key];
continue;
} }
} if (ft_cnt[key] == max_cnt)
// for now, partial keys won't work. SerG
if (max_cnt < fields.elements ||
max_cnt < table->key_info[max_key].key_parts)
{ {
my_printf_error(ER_FT_MATCHING_KEY_NOT_FOUND, mkeys++;
ER(ER_FT_MATCHING_KEY_NOT_FOUND),MYF(0)); ft_cnt[mkeys]=ft_cnt[key];
return 1; ft_to_key[mkeys]=ft_to_key[key];
continue;
}
} }
this->key=max_key; for (key=0 ; key<=mkeys ; key++)
{
// for now, partial keys won't work. SerG
if (max_cnt < fields.elements ||
max_cnt < table->key_info[ft_to_key[key]].key_parts)
continue;
this->key=ft_to_key[key];
maybe_null=1; maybe_null=1;
join_key=0; join_key=0;
return 0; return 0;
} }
my_printf_error(ER_FT_MATCHING_KEY_NOT_FOUND,
ER(ER_FT_MATCHING_KEY_NOT_FOUND),MYF(0));
return 1;
}
bool Item_func_match::eq(const Item *item) const bool Item_func_match::eq(const Item *item) const
{ {
if (item->type() != FUNC_ITEM) if (item->type() != FUNC_ITEM)