Commit 41814b70 authored by unknown's avatar unknown

myisam/ft_* bugfix


myisam/ft_search.c:
  small bugfix
myisam/ft_eval.c:
  HA_KEY_NOT_FOUND => HA_END_OF_FILE
myisam/ft_test1.c:
  HA_KEY_NOT_FOUND => HA_END_OF_FILE
parent d000fde5
...@@ -96,7 +96,7 @@ int main(int argc,char *argv[]) ...@@ -96,7 +96,7 @@ int main(int argc,char *argv[])
w=ft_get_relevance(result); w=ft_get_relevance(result);
printf("%d %.*s %f\n",i,t,read_record+2,w); printf("%d %.*s %f\n",i,t,read_record+2,w);
} }
if(err != HA_ERR_KEY_NOT_FOUND) { if(err != HA_ERR_END_OF_FILE) {
printf("ft_read_next %d failed with errno %3d\n",j,my_errno); printf("ft_read_next %d failed with errno %3d\n",j,my_errno);
goto err; goto err;
} }
......
...@@ -210,7 +210,10 @@ int ft_read_next(FT_DOCLIST *handler, char *record) ...@@ -210,7 +210,10 @@ int ft_read_next(FT_DOCLIST *handler, char *record)
MI_INFO *info=handler->info; MI_INFO *info=handler->info;
if (++handler->curdoc >= handler->ndocs) if (++handler->curdoc >= handler->ndocs)
{
--handler->curdoc;
return HA_ERR_END_OF_FILE; return HA_ERR_END_OF_FILE;
}
info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
......
...@@ -147,7 +147,7 @@ static int run_test(const char *filename) ...@@ -147,7 +147,7 @@ static int run_test(const char *filename)
i,query[i],result->ndocs); i,query[i],result->ndocs);
for(j=0;j<5;j++) { double w; int err; for(j=0;j<5;j++) { double w; int err;
err=ft_read_next(result, read_record); err=ft_read_next(result, read_record);
if(err==HA_ERR_KEY_NOT_FOUND) { if(err==HA_ERR_END_OF_FILE) {
printf("No more matches!\n"); printf("No more matches!\n");
break; break;
} else if (err) { } else if (err) {
......
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