summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-05-27 21:14:59 +0200
committerunknown <serg@serg.mylan>2004-05-27 21:14:59 +0200
commit53393cd4fee1b59789eda428098b42559b459bda (patch)
tree5663f0d56946229ad599814bac1f95f907a53396 /myisam
parent4431f3c525d9727c4421c184fa090172a2988594 (diff)
downloadmariadb-git-53393cd4fee1b59789eda428098b42559b459bda.tar.gz
backport bug#2708 fix from 4.1
myisam/ft_boolean_search.c: perlify comment
Diffstat (limited to 'myisam')
-rw-r--r--myisam/ft_boolean_search.c2
-rw-r--r--myisam/ft_parser.c40
2 files changed, 25 insertions, 17 deletions
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c
index 61381f80783..13f46849210 100644
--- a/myisam/ft_boolean_search.c
+++ b/myisam/ft_boolean_search.c
@@ -360,7 +360,7 @@ err:
}
-/* returns 1 if str0 ~= /\<str1\>/ */
+/* returns 1 if str0 ~= /\bstr1\b/ */
static int _ftb_strstr(const byte *s0, const byte *e0,
const byte *s1, const byte *e1,
CHARSET_INFO *cs)
diff --git a/myisam/ft_parser.c b/myisam/ft_parser.c
index f397660af6b..e40b7472113 100644
--- a/myisam/ft_parser.c
+++ b/myisam/ft_parser.c
@@ -124,27 +124,30 @@ byte ft_get_word(byte **start, byte *end, FT_WORD *word, FTB_PARAM *param)
for (;doc<end;doc++)
{
if (true_word_char(*doc)) break;
- if (*doc == FTB_RQUOT && param->quot) {
+ if (*doc == FTB_RQUOT && param->quot)
+ {
param->quot=doc;
*start=doc+1;
return 3; /* FTB_RBR */
}
- if ((*doc == FTB_LBR || *doc == FTB_RBR || *doc == FTB_LQUOT)
- && !param->quot)
- {
- /* param->prev=' '; */
- *start=doc+1;
- if (*doc == FTB_LQUOT) param->quot=*start;
- return (*doc == FTB_RBR)+2;
- }
- if (param->prev == ' ' && !param->quot)
+ if (!param->quot)
{
- if (*doc == FTB_YES ) { param->yesno=+1; continue; } else
- if (*doc == FTB_EGAL) { param->yesno= 0; continue; } else
- if (*doc == FTB_NO ) { param->yesno=-1; continue; } else
- if (*doc == FTB_INC ) { param->plusminus++; continue; } else
- if (*doc == FTB_DEC ) { param->plusminus--; continue; } else
- if (*doc == FTB_NEG ) { param->pmsign=!param->pmsign; continue; }
+ if (*doc == FTB_LBR || *doc == FTB_RBR || *doc == FTB_LQUOT)
+ {
+ /* param->prev=' '; */
+ *start=doc+1;
+ if (*doc == FTB_LQUOT) param->quot=*start;
+ return (*doc == FTB_RBR)+2;
+ }
+ if (param->prev == ' ')
+ {
+ if (*doc == FTB_YES ) { param->yesno=+1; continue; } else
+ if (*doc == FTB_EGAL) { param->yesno= 0; continue; } else
+ if (*doc == FTB_NO ) { param->yesno=-1; continue; } else
+ if (*doc == FTB_INC ) { param->plusminus++; continue; } else
+ if (*doc == FTB_DEC ) { param->plusminus--; continue; } else
+ if (*doc == FTB_NEG ) { param->pmsign=!param->pmsign; continue; }
+ }
}
param->prev=*doc;
param->yesno=(FTB_YES==' ') ? 1 : (param->quot != 0);
@@ -170,6 +173,11 @@ byte ft_get_word(byte **start, byte *end, FT_WORD *word, FTB_PARAM *param)
return 1;
}
}
+ if (param->quot)
+ {
+ param->quot=*start=doc;
+ return 3; /* FTB_RBR */
+ }
return 0;
}