summaryrefslogtreecommitdiff
path: root/myisam/ft_boolean_search.c
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-04-29 12:25:56 +0200
committerunknown <serg@serg.mylan>2004-04-29 12:25:56 +0200
commit709a4a9ff2d2dbcaabd12faf0cd31c28ab346e4c (patch)
tree429e4e6a6d4e160a25b5d3b8246f090b59bdc45f /myisam/ft_boolean_search.c
parente35880e0b86ea38412b1c5e94a99aa995f071564 (diff)
downloadmariadb-git-709a4a9ff2d2dbcaabd12faf0cd31c28ab346e4c.tar.gz
postreview fixes
Diffstat (limited to 'myisam/ft_boolean_search.c')
-rw-r--r--myisam/ft_boolean_search.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c
index 90647990ee8..5f88122e730 100644
--- a/myisam/ft_boolean_search.c
+++ b/myisam/ft_boolean_search.c
@@ -204,7 +204,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
{
int r;
uint off;
- int subkeys;
+ int subkeys=1;
my_bool can_go_down;
MI_INFO *info=ftb->info;
@@ -279,22 +279,19 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
/* matching key found */
memcpy(ftbw->word+ftbw->off, info->lastkey, info->lastkey_length);
- if (!ftbw->off && (init_search || (ftbw->flags & FTB_FLAG_TRUNC)))
+ /* going down ? */
+ if (subkeys<0)
{
- /* going down ? */
- if (subkeys<0)
- {
- /*
- yep, going down, to the second-level tree
- TODO here: subkey-based optimization
- */
- ftbw->off=off;
- ftbw->key_root=info->lastpos;
- ftbw->keyinfo=& info->s->ft2_keyinfo;
- r=_mi_search_first(info, ftbw->keyinfo, ftbw->key_root);
- DBUG_ASSERT(r==0); /* found something */
- memcpy(ftbw->word+off, info->lastkey, info->lastkey_length);
- }
+ /*
+ yep, going down, to the second-level tree
+ TODO here: subkey-based optimization
+ */
+ ftbw->off=off;
+ ftbw->key_root=info->lastpos;
+ ftbw->keyinfo=& info->s->ft2_keyinfo;
+ r=_mi_search_first(info, ftbw->keyinfo, ftbw->key_root);
+ DBUG_ASSERT(r==0); /* found something */
+ memcpy(ftbw->word+off, info->lastkey, info->lastkey_length);
}
ftbw->docid[0]=info->lastpos;
return 0;