Commit 21b624f0 authored by unknown's avatar unknown

fulltext.test, fulltext.result, ft_nlq_search.c:

  a bug in latin1_german2 FT fixed


myisam/ft_nlq_search.c:
  a bug in latin1_german2 FT fixed
mysql-test/r/fulltext.result:
  a bug in latin1_german2 FT fixed
mysql-test/t/fulltext.test:
  a bug in latin1_german2 FT fixed
parent 06fd12c5
...@@ -73,6 +73,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) ...@@ -73,6 +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;
#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT #if HA_FT_WTYPE == HA_KEYTYPE_FLOAT
float tmp_weight; float tmp_weight;
#else #else
...@@ -94,7 +95,8 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) ...@@ -94,7 +95,8 @@ 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,keylen, keybuff,keylen,0)) mi_compare_text(aio->charset,info->lastkey+1,
info->lastkey_length-extra, keybuff+1,keylen,0))
break; break;
subkeys=ft_sintXkorr(info->lastkey+keylen); subkeys=ft_sintXkorr(info->lastkey+keylen);
......
...@@ -29,8 +29,8 @@ Full-text indexes are called collections ...@@ -29,8 +29,8 @@ Full-text indexes are called collections
Only MyISAM tables support collections Only MyISAM tables support collections
select * from t1 where MATCH(a,b) AGAINST ("indexes collections" WITH QUERY EXPANSION); select * from t1 where MATCH(a,b) AGAINST ("indexes collections" WITH QUERY EXPANSION);
a b a b
Full-text indexes are called collections
Only MyISAM tables support collections Only MyISAM tables support collections
Full-text indexes are called collections
MySQL has now support for full-text search MySQL has now support for full-text search
explain select * from t1 where MATCH(a,b) AGAINST ("collections"); explain select * from t1 where MATCH(a,b) AGAINST ("collections");
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
...@@ -294,18 +294,27 @@ INSERT t1 VALUES ('Mit freundlichem Gr ...@@ -294,18 +294,27 @@ INSERT t1 VALUES ('Mit freundlichem Gr
SET NAMES koi8r; SET NAMES koi8r;
INSERT t1 VALUES (" - "),(", !"), INSERT t1 VALUES (" - "),(", !"),
(" , !"),(" !"); (" , !"),(" !");
SELECT t, charset(t) FROM t1 WHERE MATCH t AGAINST (''); SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('');
t charset(t) t collation(t)
- utf8 - utf8_general_ci
SELECT t, charset(t) FROM t1 WHERE MATCH t AGAINST ('*' IN BOOLEAN MODE); SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('*' IN BOOLEAN MODE);
t charset(t) t collation(t)
! utf8 ! utf8_general_ci
SELECT * FROM t1 WHERE MATCH t AGAINST ('' IN BOOLEAN MODE); SELECT * FROM t1 WHERE MATCH t AGAINST ('' IN BOOLEAN MODE);
t t
SELECT t, charset(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck'); SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck');
t charset(t) t collation(t)
SET NAMES latin1; SET NAMES latin1;
SELECT t, charset(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck'); SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck');
t charset(t) t collation(t)
aus Osnabrck utf8 aus Osnabrck utf8_general_ci
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
t collation(t)
alter table t1 modify t varchar(200) collate latin1_german2_ci not null;
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck');
t collation(t)
aus Osnabrck latin1_german2_ci
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
t collation(t)
aus Osnabrck latin1_german2_ci
DROP TABLE t1; DROP TABLE t1;
...@@ -237,11 +237,16 @@ INSERT t1 VALUES ('Mit freundlichem Gr ...@@ -237,11 +237,16 @@ INSERT t1 VALUES ('Mit freundlichem Gr
SET NAMES koi8r; SET NAMES koi8r;
INSERT t1 VALUES (" - "),(", !"), INSERT t1 VALUES (" - "),(", !"),
(" , !"),(" !"); (" , !"),(" !");
SELECT t, charset(t) FROM t1 WHERE MATCH t AGAINST (''); SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('');
SELECT t, charset(t) FROM t1 WHERE MATCH t AGAINST ('*' IN BOOLEAN MODE); SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('*' IN BOOLEAN MODE);
SELECT * FROM t1 WHERE MATCH t AGAINST ('' IN BOOLEAN MODE); SELECT * FROM t1 WHERE MATCH t AGAINST ('' IN BOOLEAN MODE);
SELECT t, charset(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck'); SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck');
SET NAMES latin1; SET NAMES latin1;
SELECT t, charset(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');
#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;
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck');
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
DROP TABLE t1; DROP TABLE t1;
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