summaryrefslogtreecommitdiff
path: root/myisam/ft_boolean_search.c
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-02-15 20:36:12 +0100
committerunknown <serg@serg.mylan>2004-02-15 20:36:12 +0100
commitd3545913028c1479a704c2a7523115eaa81860b4 (patch)
tree304adc3ec45054065c6b77d3b55083cadf7a0fd0 /myisam/ft_boolean_search.c
parentf7f02b484c9e2509a1a52dcddcce04bb12263419 (diff)
downloadmariadb-git-d3545913028c1479a704c2a7523115eaa81860b4.tar.gz
bug#2708
test results updated myisam/ft_boolean_search.c: cleanup myisam/ft_parser.c: cleanup bug#2708 mysql-test/r/derived.result: error messages updated mysql-test/r/fulltext.result: bug#2708 mysql-test/r/warnings.result: error messages updated mysql-test/t/fulltext.test: bug#2708
Diffstat (limited to 'myisam/ft_boolean_search.c')
-rw-r--r--myisam/ft_boolean_search.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c
index 8cbb7a71a43..447744b0521 100644
--- a/myisam/ft_boolean_search.c
+++ b/myisam/ft_boolean_search.c
@@ -61,12 +61,12 @@ typedef struct st_ftb_expr FTB_EXPR;
struct st_ftb_expr
{
FTB_EXPR *up;
- my_off_t docid[2];
+ uint flags;
/* ^^^^^^^^^^^^^^^^^^ FTB_{EXPR,WORD} common section */
+ my_off_t docid[2];
float weight;
float cur_weight;
byte *quot, *qend;
- uint flags;
uint yesses; /* number of "yes" words matched */
uint nos; /* number of "no" words matched */
uint ythresh; /* number of "yes" words in expr */
@@ -76,13 +76,13 @@ struct st_ftb_expr
typedef struct st_ftb_word
{
FTB_EXPR *up;
- MI_KEYDEF *keyinfo;
- my_off_t docid[2]; /* for index search and for scan */
+ uint flags;
/* ^^^^^^^^^^^^^^^^^^ FTB_{EXPR,WORD} common section */
+ my_off_t docid[2]; /* for index search and for scan */
my_off_t key_root;
+ MI_KEYDEF *keyinfo;
float weight;
uint ndepth;
- uint flags;
uint len;
uchar off;
byte word[1];
@@ -193,7 +193,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
}
static int _ftb_no_dupes_cmp(void* not_used __attribute__((unused)),
- const void *a,const void *b)
+ const void *a,const void *b)
{
return CMP_NUM((*((my_off_t*)a)), (*((my_off_t*)b)));
}
@@ -238,9 +238,9 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
if ((ftbw->flags & FTB_FLAG_YES) && ftbw->up->up==0)
{
/*
- This word MUST BE present in every document returned,
- so we can stop the search right now
- */
+ This word MUST BE present in every document returned,
+ so we can stop the search right now
+ */
ftb->state=INDEX_DONE;
return 1; /* search is done */
}
@@ -250,7 +250,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
/* going up to the first-level tree to continue search there */
_mi_dpointer(info, (uchar*) (ftbw->word+ftbw->off+HA_FT_WLEN),
- ftbw->key_root);
+ ftbw->key_root);
ftbw->key_root=info->s->state.key_root[ftb->keynr];
ftbw->keyinfo=info->s->keyinfo+ftb->keynr;
ftbw->off=0;
@@ -297,7 +297,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
if (ftbw->flags & FTB_FLAG_TRUNC)
{
/*
- special treatment for truncation operator
+ special treatment for truncation operator
1. there are some (besides this) +words
| no need to search in the index, it can never ADD new rows
| to the result, and to remove half-matched rows we do scan anyway
@@ -348,7 +348,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
- uint query_len)
+ uint query_len)
{
FTB *ftb;
FTB_EXPR *ftbe;
@@ -419,7 +419,7 @@ static int _ftb_strstr(const byte *s0, const byte *e0,
while (p0 < e0)
{
while (p0 < e0 && cs->to_upper[(uint) (uchar) *p0++] !=
- cs->to_upper[(uint) (uchar) *s1])
+ cs->to_upper[(uint) (uchar) *s1])
/* no-op */;
if (p0 >= e0)
return 0;
@@ -429,7 +429,7 @@ static int _ftb_strstr(const byte *s0, const byte *e0,
p1=s1+1;
while (p0 < e0 && p1 < e1 && cs->to_upper[(uint) (uchar) *p0] ==
- cs->to_upper[(uint) (uchar) *p1])
+ cs->to_upper[(uint) (uchar) *p1])
p0++, p1++;
if (p1 == e1 && (!e_before || p0 == e0 || !true_word_char(cs, p0[0])))
return 1;
@@ -487,12 +487,12 @@ static void _ftb_climb_the_tree(FTB *ftb, FTB_WORD *ftbw, FT_SEG_ITERATOR *ftsi_
if (yn & FTB_FLAG_NO)
{
/*
- NOTE: special sort function of queue assures that all
- (yn & FTB_FLAG_NO) != 0
- events for every particular subexpression will
- "auto-magically" happen BEFORE all the
- (yn & FTB_FLAG_YES) != 0 events. So no
- already matched expression can become not-matched again.
+ NOTE: special sort function of queue assures that all
+ (yn & FTB_FLAG_NO) != 0
+ events for every particular subexpression will
+ "auto-magically" happen BEFORE all the
+ (yn & FTB_FLAG_YES) != 0 events. So no
+ already matched expression can become not-matched again.
*/
++ftbe->nos;
break;
@@ -500,7 +500,7 @@ static void _ftb_climb_the_tree(FTB *ftb, FTB_WORD *ftbw, FT_SEG_ITERATOR *ftsi_
else
{
if (ftbe->ythresh)
- weight/=3;
+ weight/=3;
ftbe->cur_weight += weight;
if ((int) ftbe->yesses < ythresh)
break;
@@ -535,8 +535,8 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
ftb->queue.first_cmp_arg=(void *)&curdoc;
while (ftb->state == INDEX_SEARCH &&
- (curdoc=((FTB_WORD *)queue_top(& ftb->queue))->docid[0]) !=
- HA_POS_ERROR)
+ (curdoc=((FTB_WORD *)queue_top(& ftb->queue))->docid[0]) !=
+ HA_POS_ERROR)
{
while (curdoc == (ftbw=(FTB_WORD *)queue_top(& ftb->queue))->docid[0])
{
@@ -554,7 +554,7 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
/* curdoc matched ! */
if (is_tree_inited(&ftb->no_dupes) &&
tree_insert(&ftb->no_dupes, &curdoc, 0,
- ftb->no_dupes.custom_arg)->count >1)
+ ftb->no_dupes.custom_arg)->count >1)
/* but it managed already to get past this line once */
continue;