summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorsvoj@mysql.com/june.mysql.com <>2007-06-27 18:10:19 +0500
committersvoj@mysql.com/june.mysql.com <>2007-06-27 18:10:19 +0500
commitff9aeb560c2dd96c95d552184097b74b5f1bc886 (patch)
tree8521349d513536e124d936118690ca0abb5320a9 /myisam
parent717c8fe98ee82eef09343a6abb9863dc49f337d7 (diff)
downloadmariadb-git-ff9aeb560c2dd96c95d552184097b74b5f1bc886.tar.gz
BUG#29299 - repeatable myisam fulltext index corruption
Fulltext index may get corrupt by certain gbk characters. The problem was that when skipping leading non-true-word-characters, we assumed that these characters are always 1 byte long. This is not the case with gbk character set, since non-true-word-characters may be 2 bytes long. Affects 5.0 only.
Diffstat (limited to 'myisam')
-rw-r--r--myisam/ft_parser.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/myisam/ft_parser.c b/myisam/ft_parser.c
index 6c79f9249cf..6d68542e4e2 100644
--- a/myisam/ft_parser.c
+++ b/myisam/ft_parser.c
@@ -111,7 +111,7 @@ byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end,
while (doc<end)
{
- for (;doc<end;doc++)
+ for (; doc < end; doc+= mbl)
{
if (true_word_char(cs,*doc)) break;
if (*doc == FTB_RQUOT && param->quot)
@@ -120,6 +120,7 @@ byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end,
*start=doc+1;
return 3; /* FTB_RBR */
}
+ mbl= my_mbcharlen(cs, *(uchar *)doc);
if (!param->quot)
{
if (*doc == FTB_LBR || *doc == FTB_RBR || *doc == FTB_LQUOT)
@@ -187,10 +188,11 @@ byte ft_simple_get_word(CHARSET_INFO *cs, byte **start, const byte *end,
do
{
- for (;; doc++)
+ for (;; doc+= mbl)
{
if (doc >= end) DBUG_RETURN(0);
if (true_word_char(cs, *doc)) break;
+ mbl= my_mbcharlen(cs, *(uchar *)doc);
}
mwc= length= 0;