ft-update bug fixed

This commit is contained in:
serg@serg.mysql.com 2001-07-27 20:39:48 +02:00
parent 6288cfb848
commit 423f2851c5
3 changed files with 7 additions and 13 deletions

View File

@ -68,6 +68,7 @@ FT_WORD * ft_linearize(MI_INFO *info, uint keynr, byte *keybuf, TREE *wtree)
{
FT_WORD *wlist,*p;
FT_DOCSTAT docstat;
DBUG_ENTER("ft_linearize");
if ((wlist=(FT_WORD *) my_malloc(sizeof(FT_WORD)*
(1+wtree->elements_in_tree),MYF(0))))
@ -85,7 +86,7 @@ FT_WORD * ft_linearize(MI_INFO *info, uint keynr, byte *keybuf, TREE *wtree)
}
delete_tree(wtree);
if (!wlist)
return NULL;
DBUG_RETURN(NULL);
docstat.list->pos=NULL;
@ -109,7 +110,7 @@ FT_WORD * ft_linearize(MI_INFO *info, uint keynr, byte *keybuf, TREE *wtree)
p->weight/=NORM_IN_USE;
}
return wlist;
DBUG_RETURN(wlist);
}
#define true_word_char(X) (isalnum(X) || (X)=='_')

View File

@ -177,14 +177,7 @@ int _mi_ft_update(MI_INFO *info, uint keynr, byte *keybuf,
(uchar*) old_word->pos,old_word->len,
(uchar*) new_word->pos,new_word->len,0);
if (cmp==0)
{
double p=(old_word->weight-new_word->weight)/
(old_word->weight+new_word->weight);
if (p<1e-5)
cmp=0;
else
cmp=sgn(p);
}
cmp=sgn(old_word->weight-new_word->weight);
else
cmp=sgn(cmp);

View File

@ -160,7 +160,7 @@ while test $# -gt 0; do
SLEEP_TIME=`$ECHO "$1" | $SED -e "s;--sleep=;;"`
;;
--mysqld=*)
TMP=`$ECHO "$1" | $SED -e "s;--mysqld-=;"`
TMP=`$ECHO "$1" | $SED -e "s;--mysqld=;;"`
EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $TMP"
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT $TMP"
;;