diff options
author | unknown <serg@serg.mysql.com> | 2001-11-06 16:17:31 +0100 |
---|---|---|
committer | unknown <serg@serg.mysql.com> | 2001-11-06 16:17:31 +0100 |
commit | 9e29bb4e012b9f27a6716d03bb67358cbab0459f (patch) | |
tree | 88269f9b0f218945be5522352a0d0c855ac2fcc1 /myisam/ft_update.c | |
parent | 36a4cc178fc574dd9996c620eca609fe456d8c58 (diff) | |
download | mariadb-git-9e29bb4e012b9f27a6716d03bb67358cbab0459f.tar.gz |
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
Diffstat (limited to 'myisam/ft_update.c')
-rw-r--r-- | myisam/ft_update.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/myisam/ft_update.c b/myisam/ft_update.c index 1e53b2d7775..89da06e673f 100644 --- a/myisam/ft_update.c +++ b/myisam/ft_update.c @@ -29,17 +29,12 @@ /* parses a document i.e. calls _mi_ft_parse for every keyseg */ -FT_WORD * _mi_ft_parserecord(MI_INFO *info, uint keynr, byte *keybuf, - const byte *record) +uint _mi_ft_parse(TREE *parsed, MI_INFO *info, uint keynr, const byte *record) { - TREE *parsed, ptree; - MI_KEYSEG *keyseg; byte *pos; uint i; + MI_KEYSEG *keyseg=info->s->keyinfo[keynr].seg; - bzero(parsed=&ptree, sizeof(ptree)); - - keyseg=info->s->keyinfo[keynr].seg; for (i=info->s->keyinfo[keynr].keysegs-FT_SEGS ; i-- ; ) { uint len; @@ -62,13 +57,26 @@ FT_WORD * _mi_ft_parserecord(MI_INFO *info, uint keynr, byte *keybuf, } else len=keyseg->length; - if (!(parsed=ft_parse(parsed, pos, len))) - return NULL; + if (!(ft_parse(parsed, pos, len))) + return 1; } /* Handle the case where all columns are NULL */ - if (!is_tree_inited(parsed) && !(parsed=ft_parse(parsed, (byte*) "", 0))) + if (!is_tree_inited(parsed) && !(ft_parse(parsed, (byte*) "", 0))) + return 1; + else + return 0; +} + +FT_WORD * _mi_ft_parserecord(MI_INFO *info, uint keynr, byte *keybuf, + const byte *record) +{ + TREE ptree; + + bzero(&ptree, sizeof(ptree)); + if (_mi_ft_parse(& ptree, info, keynr, record)) return NULL; - return ft_linearize(info, keynr, keybuf, parsed); + + return ft_linearize(/*info, keynr, keybuf, */ & ptree); } static int _mi_ft_store(MI_INFO *info, uint keynr, byte *keybuf, @@ -158,7 +166,7 @@ int _mi_ft_cmp(MI_INFO *info, uint keynr, const byte *rec1, const byte *rec2) } /* update a document entry */ -int _mi_ft_update(MI_INFO *info, uint keynr, byte *keybuf, +int _mi_ft_update(MI_INFO *info, uint keynr, byte *keybuf, const byte *oldrec, const byte *newrec, my_off_t pos) { int error= -1; |