diff options
author | unknown <serg@serg.mysql.com> | 2002-10-18 14:53:46 +0000 |
---|---|---|
committer | unknown <serg@serg.mysql.com> | 2002-10-18 14:53:46 +0000 |
commit | 5ab1dbf5679c74814dd8ba61e9b946e4af920f1e (patch) | |
tree | d7b0288c090522f988411ef11d574f27b9b249b4 /myisam/ft_nlq_search.c | |
parent | 320d4912f4e6318d7ac080692ed780b6f1557e54 (diff) | |
download | mariadb-git-5ab1dbf5679c74814dd8ba61e9b946e4af920f1e.tar.gz |
some DBUG_ENTER/RETURN macro added
safer GWS_PROB, avoid log(0)
myisam/ft_nlq_search.c:
some DBUG_ENTER/RETURN macro added
myisam/ft_parser.c:
some DBUG_ENTER/RETURN macro added
myisam/ftdefs.h:
safer GWS_PROB, avoid log(0).
sql/item_func.cc:
some DBUG_ENTER/RETURN macro added
Diffstat (limited to 'myisam/ft_nlq_search.c')
-rw-r--r-- | myisam/ft_nlq_search.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/myisam/ft_nlq_search.c b/myisam/ft_nlq_search.c index 5670edde7c0..6df9fd235fa 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); @@ -111,7 +113,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); @@ -121,7 +123,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))) - return 1; + DBUG_RETURN(1); sptr=(FT_SUPERDOC *)ELEMENT_KEY((&aio->dtree), selem); @@ -152,21 +154,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); } @@ -184,12 +187,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; @@ -236,7 +240,7 @@ err2: err: info->lastpos=saved_lastpos; - return dlist; + DBUG_RETURN(dlist); } |