Debian Codegraph @

mysql-test/suite/innodb_fts/t/phrase_clear_no_match.test

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