summaryrefslogtreecommitdiff
path: root/myisam/ft_boolean_search.c
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-12-10 00:08:24 +0200
committerunknown <monty@hundin.mysql.fi>2001-12-10 00:08:24 +0200
commitf939a6b635846216778bb4abd96ba6fef229908e (patch)
tree3e69c63ee516f0cf84e4f42523b616db0f833200 /myisam/ft_boolean_search.c
parentb05520526e75ea6fbe17aad0c256851bccd33054 (diff)
downloadmariadb-git-f939a6b635846216778bb4abd96ba6fef229908e.tar.gz
Removed compiler warnings.
Added new operators to be used with gcc 3.0.x Update of query cache code. Added semaphores for Windows (not yet in use) Added pthread_mutex_trylock for windows. Docs/manual.texi: Update of query cache info. Docs/section.Comparisons.texi: Added indexing. client/mysqlbinlog.cc: Removed compiler warnings. client/mysqltest.c: Added enable_result_log/disable_result_log include/config-win.h: Added support of semaphores on Windows. include/my_pthread.h: Added pthread_mutex_trylock for windows. include/my_sys.h: Cleanup libmysql/libmysql.c: Fixed bug in mysql_use_result() (When reusing connections). myisam/ft_boolean_search.c: Removed compiler warnings myisam/ft_nlq_search.c: Removed compiler warnings myisam/ft_update.c: Removed compiler warnings mysql-test/r/query_cache.result: New tests mysql-test/t/query_cache-master.opt: New tests mysql-test/t/query_cache.test: New tests mysys/Makefile.am: Added new operators to be used with gcc 3.0.x sql/filesort.cc: Removed compiler warnings sql/item_func.cc: Removed compiler warnings sql/mysql_priv.h: Removed compiler warnings sql/mysqld.cc: Update of query cache code. sql/slave.cc: Removed compiler warnings. Code cleanup (Indentation) sql/sql_cache.cc: Updated code sql/sql_cache.h: Updated code sql/sql_repl.cc: Removed compiler warnings sql/sql_yacc.yy: Updated query cache
Diffstat (limited to 'myisam/ft_boolean_search.c')
-rw-r--r--myisam/ft_boolean_search.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c
index ea9a8ab15e0..c41c699bf5b 100644
--- a/myisam/ft_boolean_search.c
+++ b/myisam/ft_boolean_search.c
@@ -112,11 +112,13 @@ void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
while ((res=ft_get_word(start,end,&w,&param)))
{
byte r=param.plusminus;
- float weight=(param.pmsign ? nwghts : wghts)[(r>5)?5:((r<-5)?-5:r)];
+ float weight= (float) (param.pmsign ? nwghts : wghts)[(r>5)?5:((r<-5)?-5:r)];
switch (res) {
case 1: /* word found */
ftbw=(FTB_WORD *)alloc_root(&ftb->mem_root,
- sizeof(FTB_WORD) + (param.trunc ? MI_MAX_KEY_BUFF : w.len+extra));
+ sizeof(FTB_WORD) +
+ (param.trunc ? MI_MAX_KEY_BUFF :
+ w.len+extra));
ftbw->len=w.len+1;
ftbw->yesno=param.yesno;
ftbw->trunc=param.trunc; /* 0 or 1 */
@@ -216,7 +218,8 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
ftb->queue.root=(byte **)alloc_root(&ftb->mem_root, (res+1)*sizeof(void*));
reinit_queue(& ftb->queue, res, 0, 0, FTB_WORD_cmp, ftb);
ftbe=(FTB_EXPR *)alloc_root(&ftb->mem_root, sizeof(FTB_EXPR));
- ftbe->weight=ftbe->yesno=ftbe->nos=1;
+ ftbe->weight=1;
+ ftbe->yesno=ftbe->nos=1;
ftbe->up=0;
ftbe->ythresh=0;
ftbe->docid=HA_POS_ERROR;
@@ -236,7 +239,8 @@ void _ftb_climb_the_tree(FTB_WORD *ftbw, my_off_t curdoc)
{
if (ftbe->docid != curdoc)
{
- ftbe->cur_weight=ftbe->yesses=ftbe->nos=0;
+ ftbe->cur_weight=0;
+ ftbe->yesses=ftbe->nos=0;
ftbe->docid=curdoc;
}
if (ftbe->nos)
@@ -373,7 +377,8 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length)
{
if (ftbe->docid != HA_POS_ERROR)
{
- ftbe->cur_weight=ftbe->yesses=ftbe->nos=0;
+ ftbe->cur_weight=0;
+ ftbe->yesses=ftbe->nos=0;
ftbe->docid=HA_POS_ERROR;
}
else