summaryrefslogtreecommitdiff
path: root/myisam/ft_boolean_search.c
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-02-15 17:12:13 +0200
committerunknown <monty@mysql.com>2005-02-15 17:12:13 +0200
commite2edf02421de2e94264f1b64e7e5ece43a67ac5b (patch)
tree15b9cad34a1d5d325aaaa43172f7410440a0e70e /myisam/ft_boolean_search.c
parent67b16d202b6e6912d6018685a0f7b0bb55cfbbad (diff)
parente1099fac1f9d409ad767f0a2cd02ca93f5ddd209 (diff)
downloadmariadb-git-e2edf02421de2e94264f1b64e7e5ece43a67ac5b.tar.gz
Merge with 4.1
BitKeeper/etc/logging_ok: auto-union BitKeeper/triggers/post-commit: Auto merged innobase/row/row0mysql.c: Auto merged myisam/ft_boolean_search.c: Auto merged mysql-test/r/ctype_ucs.result: Auto merged mysql-test/r/distinct.result: Auto merged mysql-test/r/fulltext.result: Auto merged mysql-test/r/select.result: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/r/union.result: Auto merged mysql-test/t/ctype_ucs.test: Auto merged mysql-test/t/subselect.test: Auto merged mysql-test/t/union.test: Auto merged sql/item_strfunc.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_list.h: Auto merged sql/examples/ha_archive.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_string.h: Auto merged vio/viosocket.c: Auto merged scripts/mysql_create_system_tables.sh: simple merge sql/field.cc: simple merge sql/item.h: simple merge sql/sql_lex.h: simple merge sql/sql_yacc.yy: Merge (join_table_list was not comptely merged. Need to run test to know how things works...) sql/table.cc: Keep code from 5.0, except delted one not needed line strings/ctype-ucs2.c: Auto merge
Diffstat (limited to 'myisam/ft_boolean_search.c')
-rw-r--r--myisam/ft_boolean_search.c36
1 files changed, 14 insertions, 22 deletions
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c
index a5b4439a57f..6236f837c42 100644
--- a/myisam/ft_boolean_search.c
+++ b/myisam/ft_boolean_search.c
@@ -436,32 +436,24 @@ static int _ftb_strstr(const byte *s0, const byte *e0,
const byte *s1, const byte *e1,
CHARSET_INFO *cs)
{
- const byte *p0, *p1;
- my_bool s_after, e_before;
-
- s_after=true_word_char(cs, s1[0]);
- e_before=true_word_char(cs, e1[-1]);
- p0=s0;
+ const byte *p0= s0;
+ my_bool s_after= true_word_char(cs, s1[0]);
+ my_bool e_before= true_word_char(cs, e1[-1]);
+ uint p0_len;
+ my_match_t m[2];
while (p0 < e0)
{
- while (p0 < e0 && cs->to_upper[(uint) (uchar) *p0++] !=
- cs->to_upper[(uint) (uchar) *s1])
- /* no-op */;
- if (p0 >= e0)
- return 0;
-
- if (s_after && p0-1 > s0 && true_word_char(cs, p0[-2]))
- continue;
-
- p1=s1+1;
- while (p0 < e0 && p1 < e1 && cs->to_upper[(uint) (uchar) *p0] ==
- cs->to_upper[(uint) (uchar) *p1])
- p0++, p1++;
- if (p1 == e1 && (!e_before || p0 == e0 || !true_word_char(cs, p0[0])))
- return 1;
+ if (cs->coll->instr(cs, p0, e0 - p0, s1, e1 - s1, m, 2) != 2)
+ return(0);
+ if ((!s_after || p0 + m[1].beg == s0 || !true_word_char(cs, p0[m[1].beg-1])) &&
+ (!e_before || p0 + m[1].end == e0 || !true_word_char(cs, p0[m[1].end])))
+ return(1);
+ p0+= m[1].beg;
+ p0+= (p0_len= my_mbcharlen(cs, *(uchar *)p0)) ? p0_len : 1;
}
- return 0;
+
+ return(0);
}