| 1 |
# |
| 2 |
# Bug #30933728 INNODB FTS PHRASE SEARCH CRASH |
| 3 |
# |
| 4 |
# Case 1 : test phrase search with ngram. |
| 5 |
# restart: --ngram_token_size=1 |
| 6 |
select @@ngram_token_size; |
| 7 |
@@ngram_token_size |
| 8 |
1 |
| 9 |
select @@innodb_ft_enable_stopword; |
| 10 |
@@innodb_ft_enable_stopword |
| 11 |
1 |
| 12 |
create table t1( |
| 13 |
FTS_DOC_ID bigint unsigned auto_increment not null primary key, |
| 14 |
content varchar(100) COLLATE utf8mb4_danish_ci |
| 15 |
)DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_danish_ci; |
| 16 |
create fulltext index fts_index on t1(content) with parser ngram; |
| 17 |
insert into t1(content) values('María'), ('Maríb'), ('Maria'), ('Marib'); |
| 18 |
select * from t1 where match(content) against('+María' IN BOOLEAN MODE); |
| 19 |
FTS_DOC_ID content |
| 20 |
1 María |
| 21 |
select * from t1 where match(content) against('+Maríb' IN BOOLEAN MODE); |
| 22 |
FTS_DOC_ID content |
| 23 |
2 Maríb |
| 24 |
select * from t1 where match(content) against('+Maria' IN BOOLEAN MODE); |
| 25 |
FTS_DOC_ID content |
| 26 |
1 María |
| 27 |
3 Maria |
| 28 |
select * from t1 where match(content) against('+Marib' IN BOOLEAN MODE); |
| 29 |
FTS_DOC_ID content |
| 30 |
2 Maríb |
| 31 |
4 Marib |
| 32 |
drop table t1; |
| 33 |
# Case 2: test with ngram without stopword |
| 34 |
# restart: --ngram_token_size=1 --innodb_ft_enable_stopword=off |
| 35 |
select @@ngram_token_size; |
| 36 |
@@ngram_token_size |
| 37 |
1 |
| 38 |
select @@innodb_ft_enable_stopword; |
| 39 |
@@innodb_ft_enable_stopword |
| 40 |
0 |
| 41 |
create table t1( |
| 42 |
FTS_DOC_ID bigint unsigned auto_increment not null primary key, |
| 43 |
content varchar(100) COLLATE utf8mb4_danish_ci |
| 44 |
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_danish_ci; |
| 45 |
create fulltext index fts_index on t1(content) with parser ngram; |
| 46 |
insert into t1(content) values('María'), ('Maríb'), ('Maria'), ('Marib'); |
| 47 |
select * from t1 where match(content) against('+María' IN BOOLEAN MODE); |
| 48 |
FTS_DOC_ID content |
| 49 |
1 María |
| 50 |
3 Maria |
| 51 |
select * from t1 where match(content) against('+Maríb' IN BOOLEAN MODE); |
| 52 |
FTS_DOC_ID content |
| 53 |
2 Maríb |
| 54 |
4 Marib |
| 55 |
select * from t1 where match(content) against('+Maria' IN BOOLEAN MODE); |
| 56 |
FTS_DOC_ID content |
| 57 |
1 María |
| 58 |
3 Maria |
| 59 |
select * from t1 where match(content) against('+Marib' IN BOOLEAN MODE); |
| 60 |
FTS_DOC_ID content |
| 61 |
2 Maríb |
| 62 |
4 Marib |
| 63 |
drop table t1; |
| 64 |
# Case 3: test phrase search without ngram. |
| 65 |
create table t1( |
| 66 |
FTS_DOC_ID bigint unsigned auto_increment not null primary key, |
| 67 |
content varchar(100) COLLATE utf8mb4_danish_ci |
| 68 |
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_danish_ci; |
| 69 |
create fulltext index fts_index on t1(content); |
| 70 |
insert into t1(content) values('María'), ('Maríb'), ('Maria'), ('Marib'); |
| 71 |
select * from t1 where match(content) against('+María' IN BOOLEAN MODE); |
| 72 |
FTS_DOC_ID content |
| 73 |
1 María |
| 74 |
3 Maria |
| 75 |
select * from t1 where match(content) against('+Maríb' IN BOOLEAN MODE); |
| 76 |
FTS_DOC_ID content |
| 77 |
2 Maríb |
| 78 |
4 Marib |
| 79 |
select * from t1 where match(content) against('+Maria' IN BOOLEAN MODE); |
| 80 |
FTS_DOC_ID content |
| 81 |
1 María |
| 82 |
3 Maria |
| 83 |
select * from t1 where match(content) against('+Marib' IN BOOLEAN MODE); |
| 84 |
FTS_DOC_ID content |
| 85 |
2 Maríb |
| 86 |
4 Marib |
| 87 |
drop table t1; |
| 88 |
# restart: |