Commit a93191a4 authored by serg@serg.mysql.com's avatar serg@serg.mysql.com

ft_boolean_search - minor simplification

manual: News updated
parent 410cae66
...@@ -48626,6 +48626,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}. ...@@ -48626,6 +48626,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@itemize @bullet @itemize @bullet
@item @item
Fixed bug in truncation operator for boolean fulltext search.
@item
Allow numeric user id to @code{mysqld --user=#}. Allow numeric user id to @code{mysqld --user=#}.
@item @item
Fixed a bug where @code{SQL_CALC_ROWS} returned a wrong value when used Fixed a bug where @code{SQL_CALC_ROWS} returned a wrong value when used
...@@ -96,7 +96,7 @@ int FTB_WORD_cmp(void *v __attribute__((unused)), byte *a, byte *b) ...@@ -96,7 +96,7 @@ int FTB_WORD_cmp(void *v __attribute__((unused)), byte *a, byte *b)
} }
void _ftb_parse_query(FTB *ftb, byte **start, byte *end, void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
FTB_EXPR *up, uint ndepth, uint depth) FTB_EXPR *up, uint depth)
{ {
byte res; byte res;
FTB_PARAM param; FTB_PARAM param;
...@@ -125,7 +125,7 @@ void _ftb_parse_query(FTB *ftb, byte **start, byte *end, ...@@ -125,7 +125,7 @@ void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
ftbw->weight=weight; ftbw->weight=weight;
ftbw->up=up; ftbw->up=up;
ftbw->docid=HA_POS_ERROR; ftbw->docid=HA_POS_ERROR;
ftbw->ndepth= param.yesno<0 ? depth : ndepth; ftbw->ndepth= (param.yesno<0) + depth;
memcpy(ftbw->word+1, w.pos, w.len); memcpy(ftbw->word+1, w.pos, w.len);
ftbw->word[0]=w.len; ftbw->word[0]=w.len;
if (ftbw->yesno > 0) up->ythresh++; if (ftbw->yesno > 0) up->ythresh++;
...@@ -139,8 +139,7 @@ void _ftb_parse_query(FTB *ftb, byte **start, byte *end, ...@@ -139,8 +139,7 @@ void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
ftbe->ythresh=0; ftbe->ythresh=0;
ftbe->docid=HA_POS_ERROR; ftbe->docid=HA_POS_ERROR;
if (ftbe->yesno > 0) up->ythresh++; if (ftbe->yesno > 0) up->ythresh++;
_ftb_parse_query(ftb, start, end, ftbe, depth+1, _ftb_parse_query(ftb, start, end, ftbe, depth+1);
(param.yesno<0 ? depth+1 : ndepth));
break; break;
case 3: /* right bracket */ case 3: /* right bracket */
return; return;
...@@ -224,7 +223,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query, ...@@ -224,7 +223,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
ftbe->ythresh=0; ftbe->ythresh=0;
ftbe->docid=HA_POS_ERROR; ftbe->docid=HA_POS_ERROR;
ftb->root=ftbe; ftb->root=ftbe;
_ftb_parse_query(ftb, &query, query+query_len, ftbe, 0, 0); _ftb_parse_query(ftb, &query, query+query_len, ftbe, 0);
ftb->state=READY; ftb->state=READY;
return ftb; return ftb;
} }
......
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