From 9e29bb4e012b9f27a6716d03bb67358cbab0459f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Nov 2001 16:17:31 +0100 Subject: ft boolean search by table scan; queue_fix() include/queues.h: queue_fix() introduced myisam/ft_boolean_search.c: ft boolean search by table scan myisam/ft_parser.c: ft boolean search by table scan myisam/ft_update.c: ft boolean search by table scan myisam/ftdefs.h: ft boolean search by table scan mysql-test/r/fulltext_cache.result: ft boolean search by table scan mysql-test/t/fulltext_cache.test: ft boolean search by table scan mysys/queues.c: queue_fix() introduced --- myisam/ft_parser.c | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) (limited to 'myisam/ft_parser.c') diff --git a/myisam/ft_parser.c b/myisam/ft_parser.c index 466f1dfe021..def49d17b74 100644 --- a/myisam/ft_parser.c +++ b/myisam/ft_parser.c @@ -33,17 +33,16 @@ typedef struct st_ft_docstat { double max, nsum, nsum2; #endif /* EVAL_RUN */ - MI_INFO *info; - uint keynr; - byte *keybuf; +// MI_INFO *info; +// uint keynr; +// byte *keybuf; } FT_DOCSTAT; -static int FT_WORD_cmp(void* cmp_arg __attribute__((unused)), - FT_WORD *w1, FT_WORD *w2) +static int FT_WORD_cmp(void* cmp_arg, FT_WORD *w1, FT_WORD *w2) { return _mi_compare_text(default_charset_info, (uchar*) w1->pos,w1->len, - (uchar*) w2->pos, w2->len,0); + (uchar*) w2->pos, w2->len,(my_bool)cmp_arg); } static int walk_and_copy(FT_WORD *word,uint32 count,FT_DOCSTAT *docstat) @@ -64,7 +63,9 @@ static int walk_and_copy(FT_WORD *word,uint32 count,FT_DOCSTAT *docstat) /* transforms tree of words into the array, applying normalization */ -FT_WORD * ft_linearize(MI_INFO *info, uint keynr, byte *keybuf, TREE *wtree) +FT_WORD * ft_linearize(//MI_INFO *info, uint keynr, + //byte *keybuf, + TREE *wtree) { FT_WORD *wlist,*p; FT_DOCSTAT docstat; @@ -73,9 +74,9 @@ FT_WORD * ft_linearize(MI_INFO *info, uint keynr, byte *keybuf, TREE *wtree) if ((wlist=(FT_WORD *) my_malloc(sizeof(FT_WORD)* (1+wtree->elements_in_tree),MYF(0)))) { - docstat.info=info; - docstat.keynr=keynr; - docstat.keybuf=keybuf; +// docstat.info=info; +// docstat.keynr=keynr; +// docstat.keybuf=keybuf; docstat.list=wlist; docstat.uniq=wtree->elements_in_tree; #ifdef EVAL_RUN @@ -207,19 +208,6 @@ byte ft_simple_get_word(byte **start, byte *end, FT_WORD *word) return 0; } -int is_boolean(byte *q, uint len) -{ - if (!len) return 0; - if (*q == FTB_YES || *q == FTB_NO) return 1; - - for (++q; --len; ++q) - { - if ((*q == FTB_YES || *q == FTB_NO) && q[-1] == ' ' && true_word_char(q[1])) - return 1; - } - return 0; -} - TREE * ft_parse(TREE *wtree, byte *doc, int doclen) { byte *end=doc+doclen; -- cgit v1.2.1