summaryrefslogtreecommitdiff
path: root/myisam/ft_nlq_search.c
diff options
context:
space:
mode:
authorunknown <serg@serg.mysql.com>2002-10-25 22:07:04 +0000
committerunknown <serg@serg.mysql.com>2002-10-25 22:07:04 +0000
commit7962de4cf303e71600f7ff2beebcb5900ef41f71 (patch)
treea265b1027bdd9f187cbc41ed6c5c709d6793109e /myisam/ft_nlq_search.c
parentd51b72cac30e5d02fde6e9c98c3e91716b19ed04 (diff)
parentf5563ddad40e8ab84d457b0e9960ddfdc7faec99 (diff)
downloadmariadb-git-7962de4cf303e71600f7ff2beebcb5900ef41f71.tar.gz
merged
BitKeeper/etc/gone: auto-union BitKeeper/etc/logging_ok: auto-union BitKeeper/deleted/.del-skipkeys~888e38cf95239a33: 'Auto converge rename' Docs/manual.texi: Auto merged libmysqld/lib_sql.cc: Auto merged myisam/ft_boolean_search.c: Auto merged myisam/ft_nlq_search.c: Auto merged myisam/ft_parser.c: Auto merged myisam/ftdefs.h: Auto merged myisam/mi_create.c: Auto merged mysys/my_init.c: Auto merged sql/log.cc: Auto merged sql/log_event.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_update.cc: Auto merged
Diffstat (limited to 'myisam/ft_nlq_search.c')
-rw-r--r--myisam/ft_nlq_search.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/myisam/ft_nlq_search.c b/myisam/ft_nlq_search.c
index f3fa8865bc6..7225896c69e 100644
--- a/myisam/ft_nlq_search.c
+++ b/myisam/ft_nlq_search.c
@@ -79,6 +79,8 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
#error
#endif
+ DBUG_ENTER("walk_and_match");
+
word->weight=LWS_FOR_QUERY;
keylen=_ft_make_key(aio->info,aio->keynr,(char*) aio->keybuff,word,0);
@@ -112,7 +114,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
#else
#error
#endif
- if(tmp_weight==0) return doc_cnt; /* stopword, doc_cnt should be 0 */
+ if(tmp_weight==0) DBUG_RETURN(doc_cnt); /* stopword, doc_cnt should be 0 */
#ifdef EVAL_RUN
cnt=*(byte *)(aio->info->lastkey+keylen);
@@ -122,7 +124,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
/* saving document matched into dtree */
if (!(selem=tree_insert(&aio->dtree, &sdoc, 0, aio->dtree.custom_arg)))
- return 1;
+ DBUG_RETURN(1);
sptr=(FT_SUPERDOC *)ELEMENT_KEY((&aio->dtree), selem);
@@ -153,21 +155,22 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
if (doc_cnt)
{
word->weight*=GWS_IN_USE;
- if (word->weight < 0)
- word->weight=0;
+ if (word->weight < 0) word->weight=0;
+
}
- return 0;
+ DBUG_RETURN(0);
}
static int walk_and_copy(FT_SUPERDOC *from,
uint32 count __attribute__((unused)), FT_DOC **to)
{
+ DBUG_ENTER("walk_and_copy");
from->doc.weight+=from->tmp_weight*from->word_ptr->weight;
(*to)->dpos=from->doc.dpos;
(*to)->weight=from->doc.weight;
(*to)++;
- return 0;
+ DBUG_RETURN(0);
}
@@ -185,12 +188,13 @@ FT_INFO *ft_init_nlq_search(MI_INFO *info, uint keynr, byte *query,
FT_DOC *dptr;
FT_INFO *dlist=NULL;
my_off_t saved_lastpos=info->lastpos;
+ DBUG_ENTER("ft_init_nlq_search");
/* black magic ON */
if ((int) (keynr = _mi_check_index(info,keynr)) < 0)
- return NULL;
+ DBUG_RETURN(NULL);
if (_mi_readinfo(info,F_RDLCK,1))
- return NULL;
+ DBUG_RETURN(NULL);
/* black magic OFF */
aio.info=info;
@@ -237,7 +241,7 @@ err2:
err:
info->lastpos=saved_lastpos;
- return dlist;
+ DBUG_RETURN(dlist);
}