diff options
author | serg@serg.mylan <> | 2004-02-16 18:53:00 +0100 |
---|---|---|
committer | serg@serg.mylan <> | 2004-02-16 18:53:00 +0100 |
commit | de240a1ce2ffbc62f16e5772f9c78df58edb9092 (patch) | |
tree | 9f50a5286834ba27e3397680e3530b5bb72e2392 /myisam | |
parent | 3c1e8aa4aaae94537359d617279f6b1ed90a74e7 (diff) | |
download | mariadb-git-de240a1ce2ffbc62f16e5772f9c78df58edb9092.tar.gz |
ft_boolean_syntax made changeable
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/ft_parser.c | 20 | ||||
-rw-r--r-- | myisam/ft_static.c | 2 |
2 files changed, 21 insertions, 1 deletions
diff --git a/myisam/ft_parser.c b/myisam/ft_parser.c index f68bf3f030c..250e92566b7 100644 --- a/myisam/ft_parser.c +++ b/myisam/ft_parser.c @@ -73,6 +73,26 @@ FT_WORD * ft_linearize(TREE *wtree) DBUG_RETURN(wlist); } +my_bool ft_boolean_check_syntax_string(const byte *str) +{ + uint i, j; + + if (!str || + (strlen(str)+1 != sizeof(ft_boolean_syntax)) || + (str[0] != ' ' && str[1] != ' ')) + return 1; + for (i=0; i<sizeof(ft_boolean_syntax); i++) + { + /* limiting to 7-bit ascii only */ + if ((unsigned char)(str[i]) > 127 || my_isalnum(default_charset_info, str[i])) + return 1; + for (j=0; j<i; j++) + if (str[i] == str[j] && (i != 11 || j != 10)) + return 1; + } + return 0; +} + /* returns: * 0 - eof * 1 - word found diff --git a/myisam/ft_static.c b/myisam/ft_static.c index 0dcea5bec0c..7168406d027 100644 --- a/myisam/ft_static.c +++ b/myisam/ft_static.c @@ -21,7 +21,7 @@ ulong ft_min_word_len=4; ulong ft_max_word_len=HA_FT_MAXCHARLEN; ulong ft_query_expansion_limit=5; -const char *ft_boolean_syntax="+ -><()~*:\"\"&|"; +char ft_boolean_syntax[]="+ -><()~*:\"\"&|"; const HA_KEYSEG ft_keysegs[FT_SEGS]={ { |