List:Maria Storage Engine« Previous MessageNext Message »
From:Jani Tolonen Date:June 24 2008 2:14pm
Subject:bzr commit into MySQL/Maria:mysql-maria branch (jani:2656) Bug#29464
View as plain text  
#At bzr+ssh://bk-internal.mysql.com/bzrroot/server/mysql-maria/

 2656 Jani Tolonen	2008-06-24
      Imported fix for bug#29464 from myisam table handler to maria.
modified:
  storage/maria/ma_ft_parser.c

=== modified file 'storage/maria/ma_ft_parser.c'
--- a/storage/maria/ma_ft_parser.c	2008-04-03 13:40:25 +0000
+++ b/storage/maria/ma_ft_parser.c	2008-06-24 14:14:56 +0000
@@ -114,7 +114,8 @@ uchar maria_ft_get_word(CHARSET_INFO *cs
 {
   uchar *doc=*start;
   int ctype;
-  uint mwc, length, mbl;
+  uint mwc, length;
+  int mbl;
 
   param->yesno=(FTB_YES==' ') ? 1 : (param->quot != 0);
   param->weight_adjust= param->wasign= 0;
@@ -122,7 +123,7 @@ uchar maria_ft_get_word(CHARSET_INFO *cs
 
   while (doc<end)
   {
-    for (; doc < end; doc+= (mbl > 0 ? mbl : 1))
+    for (; doc < end; doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1)))
     {
       mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end);
       if (true_word_char(ctype, *doc))
@@ -140,7 +141,8 @@ uchar maria_ft_get_word(CHARSET_INFO *cs
         {
           /* param->prev=' '; */
           *start=doc+1;
-          if (*doc == FTB_LQUOT) param->quot= (char *) *start;
+          if (*doc == FTB_LQUOT)
+            param->quot= (char *) *start;
           param->type= (*doc == FTB_RBR ? FT_TOKEN_RIGHT_PAREN : FT_TOKEN_LEFT_PAREN);
           goto ret;
         }
@@ -160,7 +162,8 @@ uchar maria_ft_get_word(CHARSET_INFO *cs
     }
 
     mwc=length=0;
-    for (word->pos= doc; doc < end; length++, doc+= (mbl > 0 ? mbl : 1))
+    for (word->pos= doc; doc < end; length++,
+         doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1)))
     {
       mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end);
       if (true_word_char(ctype, *doc))
@@ -205,13 +208,13 @@ uchar maria_ft_simple_get_word(CHARSET_I
                                my_bool skip_stopwords)
 {
   uchar *doc= *start;
-  uint mwc, length, mbl;
-  int ctype;
+  uint mwc, length;
+  int ctype, mbl;
   DBUG_ENTER("maria_ft_simple_get_word");
 
   do
   {
-    for (;; doc+= (mbl > 0 ? mbl : 1))
+    for (;; doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1)))
     {
       if (doc >= end)
         DBUG_RETURN(0);
@@ -221,7 +224,8 @@ uchar maria_ft_simple_get_word(CHARSET_I
     }
 
     mwc= length= 0;
-    for (word->pos= doc; doc < end; length++, doc+= (mbl > 0 ? mbl : 1))
+    for (word->pos= doc; doc < end; length++,
+         doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1)))
     {
       mbl= cs->cset->ctype(cs, &ctype, doc, end);
       if (true_word_char(ctype, *doc))
@@ -393,7 +397,9 @@ MYSQL_FTPARSER_PARAM *maria_ftparser_cal
        mysql_add_word == 0 - parser is not initialized
        mysql_add_word != 0 - parser is initialized, or no
                              initialization needed. */
-    info->ftparser_param[ftparser_nr].mysql_add_word= (void *)1;
+    info->ftparser_param[ftparser_nr].mysql_add_word=
+      (int (*)(struct st_mysql_ftparser_param *, char *, int,
+               MYSQL_FTPARSER_BOOLEAN_INFO *)) 1;
     if (parser->init && parser->init(&info->ftparser_param[ftparser_nr]))
       return 0;
   }

Thread
bzr commit into MySQL/Maria:mysql-maria branch (jani:2656) Bug#29464Jani Tolonen24 Jun