summaryrefslogtreecommitdiff
path: root/myisam/ft_boolean_search.c
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-04-05 11:36:30 +0200
committerunknown <serg@serg.mylan>2004-04-05 11:36:30 +0200
commit76b882c272a8d25eedcf94d8382ca71fa95c436f (patch)
treea3871d619a310292d639432e823085b68c31dec3 /myisam/ft_boolean_search.c
parent43db12f631a487a9bca7d812e9adcfac6a2491d9 (diff)
downloadmariadb-git-76b882c272a8d25eedcf94d8382ca71fa95c436f.tar.gz
made fulltext search aware of concurrent inserts
Diffstat (limited to 'myisam/ft_boolean_search.c')
-rw-r--r--myisam/ft_boolean_search.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c
index 799022a5a0d..d728c379ea5 100644
--- a/myisam/ft_boolean_search.c
+++ b/myisam/ft_boolean_search.c
@@ -262,8 +262,14 @@ static void _ftb_init_index_search(FT_INFO *ftb)
else
reset_tree(& ftb->no_dupes);
}
- r=_mi_search(info, keyinfo, (uchar*) ftbw->word, ftbw->len,
- SEARCH_FIND | SEARCH_BIGGER, keyroot);
+ for (
+ r=_mi_search(info, keyinfo, (uchar*) ftbw->word, ftbw->len,
+ SEARCH_FIND | SEARCH_BIGGER, keyroot) ;
+ !r && info->lastpos >= info->state->data_file_length;
+ r=_mi_search_next(info, keyinfo, info->lastkey, info->lastkey_length,
+ SEARCH_BIGGER, keyroot)
+ );
+
if (!r)
{
r=_mi_compare_text(ftb->charset,
@@ -488,8 +494,13 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
_ftb_climb_the_tree(ftb, ftbw, 0);
/* update queue */
- r=_mi_search(info, keyinfo, (uchar*) ftbw->word, USE_WHOLE_KEY,
- SEARCH_BIGGER , keyroot);
+ for (
+ r=_mi_search(info, keyinfo, (uchar*) ftbw->word, USE_WHOLE_KEY,
+ SEARCH_BIGGER, keyroot) ;
+ !r && info->lastpos >= info->state->data_file_length ;
+ r=_mi_search_next(info, keyinfo, info->lastkey, info->lastkey_length,
+ SEARCH_BIGGER, keyroot)
+ );
if (!r)
{
r=_mi_compare_text(ftb->charset,