diff options
author | unknown <serg@serg.mysql.com> | 2002-04-15 20:32:40 +0000 |
---|---|---|
committer | unknown <serg@serg.mysql.com> | 2002-04-15 20:32:40 +0000 |
commit | d8764f0b4a83bcd5958dad215c7bc59db807dc39 (patch) | |
tree | c17f60b1d5e1e0f9131ce25d7c3633df8dd60406 /myisam/ft_parser.c | |
parent | 8fcaf4a3fb188cbc9df6290f3731beeee5a55c3c (diff) | |
download | mariadb-git-d8764f0b4a83bcd5958dad215c7bc59db807dc39.tar.gz |
getting rid of default_charset_info
Diffstat (limited to 'myisam/ft_parser.c')
-rw-r--r-- | myisam/ft_parser.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/myisam/ft_parser.c b/myisam/ft_parser.c index c1b1190bcab..78529efed0b 100644 --- a/myisam/ft_parser.c +++ b/myisam/ft_parser.c @@ -35,12 +35,10 @@ typedef struct st_ft_docstat { } FT_DOCSTAT; -static int FT_WORD_cmp(void* cmp_arg, FT_WORD *w1, FT_WORD *w2) +static int FT_WORD_cmp(CHARSET_INFO* cs, FT_WORD *w1, FT_WORD *w2) { - return _mi_compare_text(default_charset_info, - (uchar*) w1->pos, w1->len, - (uchar*) w2->pos, w2->len, - (my_bool) (cmp_arg != 0)); + return _mi_compare_text(cs, (uchar*) w1->pos, w1->len, + (uchar*) w2->pos, w2->len, 0); } static int walk_and_copy(FT_WORD *word,uint32 count,FT_DOCSTAT *docstat) @@ -207,16 +205,17 @@ byte ft_simple_get_word(byte **start, byte *end, FT_WORD *word) return 0; } +void ft_parse_init(TREE *wtree, CHARSET_INFO *cs) +{ + if (!is_tree_inited(wtree)) + init_tree(wtree,0,0,sizeof(FT_WORD),(qsort_cmp2)&FT_WORD_cmp,0,NULL, cs); +} + int ft_parse(TREE *wtree, byte *doc, int doclen) { byte *end=doc+doclen; FT_WORD w; - if (!is_tree_inited(wtree)) - { - init_tree(wtree,0,0,sizeof(FT_WORD),(qsort_cmp2)&FT_WORD_cmp,0,NULL, NULL); - } - while (ft_simple_get_word(&doc,end,&w)) { if (!tree_insert(wtree, &w, 0)) |