diff options
author | unknown <svoj@may.pils.ru> | 2006-05-29 16:46:46 +0500 |
---|---|---|
committer | unknown <svoj@may.pils.ru> | 2006-05-29 16:46:46 +0500 |
commit | 528e85a4c0de5b6cfe65f1c664089628db6cf1b4 (patch) | |
tree | 2d99880d147ef4ce559982554840a1011fb091e9 /storage/myisam/ftdefs.h | |
parent | 52078846fc635b913c2090c20adc18e1f06c9e56 (diff) | |
download | mariadb-git-528e85a4c0de5b6cfe65f1c664089628db6cf1b4.tar.gz |
BUG#19580 - FULLTEXT search produces wrong results on UTF-8 columns
The problem was that MySQL hadn't true ctype implementation. As a
result many multibyte punctuation/whitespace characters were
treated as word characters.
This fix uses recently added CTYPE table for unicode character sets
(WL1386) to detect unicode punctuation/whitespace characters
correctly.
Note: this is incompatible change since it changes parser behavior.
One will have to use REPAIR TABLE statement to rebuild fulltext
indexes.
mysql-test/r/fulltext2.result:
Testcase for BUG#19580.
mysql-test/t/fulltext2.test:
Testcase for BUG#19580.
storage/myisam/ft_parser.c:
Use WL1386 "CTYPE table for unicode character sets" functionality.
storage/myisam/ft_update.c:
Use WL1386 "CTYPE table for unicode character sets" functionality.
Reverse fix for BUG#16489 "utf8 + fulltext leads to corrupt index
file.". It is not needed anymore, since we have true ctype
implementation.
storage/myisam/ftdefs.h:
Use WL1386 "CTYPE table for unicode character sets" functionality.
Rework true_word_char macro so it accepts ctype instead of charset
as first param. It doesn't use my_isalnum anymore, but instead
directly checks ctype.
Obsolete word_char macro removed.
Diffstat (limited to 'storage/myisam/ftdefs.h')
-rw-r--r-- | storage/myisam/ftdefs.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/storage/myisam/ftdefs.h b/storage/myisam/ftdefs.h index 2c4cfa1ffd6..82429773824 100644 --- a/storage/myisam/ftdefs.h +++ b/storage/myisam/ftdefs.h @@ -24,9 +24,10 @@ #include <queues.h> #include <mysql/plugin.h> -#define true_word_char(s,X) (my_isalnum(s,X) || (X)=='_') +#define true_word_char(ctype, character) \ + ((ctype) & (_MY_U | _MY_L | _MY_NMR) || \ + (character) == '_') #define misc_word_char(X) 0 -#define word_char(s,X) (true_word_char(s,X) || misc_word_char(X)) #define FT_MAX_WORD_LEN_FOR_SORT 31 |