summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
Diffstat (limited to 'myisam')
-rw-r--r--myisam/ft_boolean_search.c36
-rw-r--r--myisam/mi_preload.c8
2 files changed, 18 insertions, 26 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);
}
diff --git a/myisam/mi_preload.c b/myisam/mi_preload.c
index 5e03d489efe..317ab4ad7fe 100644
--- a/myisam/mi_preload.c
+++ b/myisam/mi_preload.c
@@ -71,15 +71,15 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves)
if (flush_key_blocks(share->key_cache,share->kfile, FLUSH_RELEASE))
goto err;
-
+
do
{
/* Read the next block of index file into the preload buffer */
if ((my_off_t) length > (key_file_length-pos))
length= (ulong) (key_file_length-pos);
- if (my_pread(share->kfile, (byte*) buff, length, pos, MYF(MY_FAE)))
+ if (my_pread(share->kfile, (byte*) buff, length, pos, MYF(MY_FAE|MY_FNABP)))
goto err;
-
+
if (ignore_leaves)
{
uchar *end= buff+length;
@@ -88,7 +88,7 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves)
if (mi_test_if_nod(buff))
{
if (key_cache_insert(share->key_cache,
- share->kfile, pos, DFLT_INIT_HITS,
+ share->kfile, pos, DFLT_INIT_HITS,
(byte*) buff, block_length))
goto err;
}