Commit 9320bb41 authored by unknown's avatar unknown

ft-update bug fixed


myisam/ft_parser.c:
  cleanup
myisam/ft_update.c:
  bug fixed
mysql-test/mysql-test-run.sh:
  typo fixed
parent 5372399c
...@@ -68,6 +68,7 @@ FT_WORD * ft_linearize(MI_INFO *info, uint keynr, byte *keybuf, TREE *wtree) ...@@ -68,6 +68,7 @@ FT_WORD * ft_linearize(MI_INFO *info, uint keynr, byte *keybuf, TREE *wtree)
{ {
FT_WORD *wlist,*p; FT_WORD *wlist,*p;
FT_DOCSTAT docstat; FT_DOCSTAT docstat;
DBUG_ENTER("ft_linearize");
if ((wlist=(FT_WORD *) my_malloc(sizeof(FT_WORD)* if ((wlist=(FT_WORD *) my_malloc(sizeof(FT_WORD)*
(1+wtree->elements_in_tree),MYF(0)))) (1+wtree->elements_in_tree),MYF(0))))
...@@ -85,7 +86,7 @@ FT_WORD * ft_linearize(MI_INFO *info, uint keynr, byte *keybuf, TREE *wtree) ...@@ -85,7 +86,7 @@ FT_WORD * ft_linearize(MI_INFO *info, uint keynr, byte *keybuf, TREE *wtree)
} }
delete_tree(wtree); delete_tree(wtree);
if (!wlist) if (!wlist)
return NULL; DBUG_RETURN(NULL);
docstat.list->pos=NULL; docstat.list->pos=NULL;
...@@ -109,7 +110,7 @@ FT_WORD * ft_linearize(MI_INFO *info, uint keynr, byte *keybuf, TREE *wtree) ...@@ -109,7 +110,7 @@ FT_WORD * ft_linearize(MI_INFO *info, uint keynr, byte *keybuf, TREE *wtree)
p->weight/=NORM_IN_USE; p->weight/=NORM_IN_USE;
} }
return wlist; DBUG_RETURN(wlist);
} }
#define true_word_char(X) (isalnum(X) || (X)=='_') #define true_word_char(X) (isalnum(X) || (X)=='_')
......
...@@ -177,14 +177,7 @@ int _mi_ft_update(MI_INFO *info, uint keynr, byte *keybuf, ...@@ -177,14 +177,7 @@ int _mi_ft_update(MI_INFO *info, uint keynr, byte *keybuf,
(uchar*) old_word->pos,old_word->len, (uchar*) old_word->pos,old_word->len,
(uchar*) new_word->pos,new_word->len,0); (uchar*) new_word->pos,new_word->len,0);
if (cmp==0) if (cmp==0)
{ cmp=sgn(old_word->weight-new_word->weight);
double p=(old_word->weight-new_word->weight)/
(old_word->weight+new_word->weight);
if (p<1e-5)
cmp=0;
else
cmp=sgn(p);
}
else else
cmp=sgn(cmp); cmp=sgn(cmp);
......
...@@ -160,7 +160,7 @@ while test $# -gt 0; do ...@@ -160,7 +160,7 @@ while test $# -gt 0; do
SLEEP_TIME=`$ECHO "$1" | $SED -e "s;--sleep=;;"` SLEEP_TIME=`$ECHO "$1" | $SED -e "s;--sleep=;;"`
;; ;;
--mysqld=*) --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_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $TMP"
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT $TMP" EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT $TMP"
;; ;;
......
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