summaryrefslogtreecommitdiff
path: root/myisam
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
commitda3609f8b36ba3f0917f40ac02e28bf38a9f9921 (patch)
treea3871d619a310292d639432e823085b68c31dec3 /myisam
parent8389aeda797063d0b66f7aa22748f11087d92fbe (diff)
downloadmariadb-git-da3609f8b36ba3f0917f40ac02e28bf38a9f9921.tar.gz
made fulltext search aware of concurrent inserts
Diffstat (limited to 'myisam')
-rw-r--r--myisam/ft_boolean_search.c19
-rw-r--r--myisam/ft_nlq_search.c14
2 files changed, 27 insertions, 6 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,
diff --git a/myisam/ft_nlq_search.c b/myisam/ft_nlq_search.c
index f426b88d77d..3ad983f0a37 100644
--- a/myisam/ft_nlq_search.c
+++ b/myisam/ft_nlq_search.c
@@ -85,8 +85,13 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
doc_cnt=0;
- r=_mi_search(aio->info, aio->keyinfo, aio->keybuff, keylen,
- SEARCH_FIND | SEARCH_PREFIX, aio->key_root);
+ for (
+ r=_mi_search(aio->info, aio->keyinfo, aio->keybuff, keylen,
+ SEARCH_FIND | SEARCH_PREFIX, aio->key_root) ;
+ !r && aio->info->lastpos >= aio->info->state->data_file_length ;
+ r=_mi_search_next(aio->info, aio->keyinfo, aio->info->lastkey,
+ aio->info->lastkey_length, SEARCH_BIGGER, aio->key_root)
+ );
aio->info->update|= HA_STATE_AKTIV; /* for _mi_test_if_changed() */
while (!r && gweight)
@@ -132,6 +137,11 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
r=_mi_search(aio->info, aio->keyinfo, aio->info->lastkey,
aio->info->lastkey_length, SEARCH_BIGGER,
aio->key_root);
+
+ while (!r && aio->info->lastpos >= aio->info->state->data_file_length)
+ r=_mi_search(aio->info, aio->keyinfo, aio->info->lastkey,
+ aio->info->lastkey_length, SEARCH_BIGGER,
+ aio->key_root);
}
word->weight=gweight;