Commit 56f83127 authored by unknown's avatar unknown

bug#3011 - multi-byte charset in fulltext


myisam/ft_nlq_search.c:
  bug#3011 - multi-byte charset in fulltext
  cleanup
parent e7776e5d
...@@ -64,8 +64,8 @@ static int FT_SUPERDOC_cmp(void* cmp_arg __attribute__((unused)), ...@@ -64,8 +64,8 @@ static int FT_SUPERDOC_cmp(void* cmp_arg __attribute__((unused)),
static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
{ {
int subkeys; int subkeys, r;
uint keylen, r, doc_cnt; uint keylen, doc_cnt;
FT_SUPERDOC sdoc, *sptr; FT_SUPERDOC sdoc, *sptr;
TREE_ELEMENT *selem; TREE_ELEMENT *selem;
double gweight=1; double gweight=1;
...@@ -73,7 +73,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) ...@@ -73,7 +73,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
uchar *keybuff=aio->keybuff; uchar *keybuff=aio->keybuff;
MI_KEYDEF *keyinfo=info->s->keyinfo+aio->keynr; MI_KEYDEF *keyinfo=info->s->keyinfo+aio->keynr;
my_off_t key_root=info->s->state.key_root[aio->keynr]; my_off_t key_root=info->s->state.key_root[aio->keynr];
uint extra=HA_FT_WLEN+info->s->base.rec_reflength+1; uint extra=HA_FT_WLEN+info->s->base.rec_reflength;
#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT #if HA_FT_WTYPE == HA_KEYTYPE_FLOAT
float tmp_weight; float tmp_weight;
#else #else
...@@ -96,10 +96,10 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) ...@@ -96,10 +96,10 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
if (keylen && if (keylen &&
mi_compare_text(aio->charset,info->lastkey+1, mi_compare_text(aio->charset,info->lastkey+1,
info->lastkey_length-extra, keybuff+1,keylen-1,0)) info->lastkey_length-extra-1, keybuff+1,keylen-1,0))
break; break;
subkeys=ft_sintXkorr(info->lastkey+keylen); subkeys=ft_sintXkorr(info->lastkey+info->lastkey_length-extra);
if (subkeys<0) if (subkeys<0)
{ {
if (doc_cnt) if (doc_cnt)
......
...@@ -346,6 +346,9 @@ t collation(t) ...@@ -346,6 +346,9 @@ t collation(t)
aus Osnabrck utf8_general_ci aus Osnabrck utf8_general_ci
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck'); SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
t collation(t) t collation(t)
SELECT t, collation(t),MATCH t AGAINST ('Osnabruck') FROM t1 WHERE MATCH t AGAINST ('Osnabruck');
t collation(t) MATCH t AGAINST ('Osnabruck')
aus Osnabrck utf8_general_ci 1.591139793396
alter table t1 modify t varchar(200) collate latin1_german2_ci not null; alter table t1 modify t varchar(200) collate latin1_german2_ci not null;
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck'); SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck');
t collation(t) t collation(t)
......
...@@ -268,6 +268,7 @@ SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabr ...@@ -268,6 +268,7 @@ SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabr
SET NAMES latin1; SET NAMES latin1;
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck'); SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck');
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck'); SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
SELECT t, collation(t),MATCH t AGAINST ('Osnabruck') FROM t1 WHERE MATCH t AGAINST ('Osnabruck');
#alter table t1 modify t text character set latin1 collate latin1_german2_ci not null; #alter table t1 modify t text character set latin1 collate latin1_german2_ci not null;
alter table t1 modify t varchar(200) collate latin1_german2_ci not null; alter table t1 modify t varchar(200) collate latin1_german2_ci not null;
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck'); SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment