Debian Codegraph @

mysql-test/suite/maria/fulltext2.test

raw
1 #
2 # test of new fulltext search features
3 #
4
5 let collation=utf8mb3_unicode_ci;
6 source include/have_collation.inc;
7
8 #
9 # two-level tree
10 #
11
12 CREATE TABLE t1 (
13 i int(10) unsigned not null auto_increment primary key,
14 a varchar(255) not null,
15 FULLTEXT KEY (a)
16 ) ENGINE=Aria ROW_FORMAT=DYNAMIC MAX_ROWS=2000000000000;
17
18 # two-level entry, second-level tree with depth 2
19 disable_query_log;
20 let $1=1024;
21 while ($1)
22 {
23 eval insert t1 (a) values ('aaaxxx');
24 dec $1;
25 }
26
27 # one-level entry (entries)
28 let $1=150;
29 while ($1)
30 {
31 eval insert t1 (a) values ('aaayyy');
32 dec $1;
33 }
34 enable_query_log;
35
36 repair table t1 quick;
37 check table t1;
38 repair table t1;
39 check table t1;
40 repair table t1;
41
42 select count(*) from t1 where match a against ('aaaxxx');
43 select count(*) from t1 where match a against ('aaayyy');
44 select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
45 select count(*) from t1 where match a against ('aaayyy' in boolean mode);
46
47 select count(*) from t1 where match a against ('aaax*' in boolean mode);
48 select count(*) from t1 where match a against ('aaay*' in boolean mode);
49 select count(*) from t1 where match a against ('aaa*' in boolean mode);
50
51 # mi_write:
52 insert t1 (a) values ('aaaxxx'),('aaayyy');
53 # call to enlarge_root() below
54 select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
55 select count(*) from t1 where match a against ('aaayyy');
56
57 # mi_delete
58 insert t1 (a) values ('aaaxxx 000000');
59 select count(*) from t1 where match a against ('000000');
60 delete from t1 where match a against ('000000');
61 select count(*) from t1 where match a against ('000000');
62 select count(*) from t1 where match a against ('aaaxxx');
63 select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
64 select count(*) from t1 where match a against ('aaayyy' in boolean mode);
65 # double-check without index
66 select count(*) from t1 where a = 'aaaxxx';
67 select count(*) from t1 where a = 'aaayyy';
68
69 # update
70 insert t1 (a) values ('aaaxxx 000000');
71 select count(*) from t1 where match a against ('000000');
72 select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
73 update t1 set a='aaaxxx' where a = 'aaayyy';
74 select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
75 select count(*) from t1 where match a against ('aaayyy' in boolean mode);
76
77 drop table t1;
78
79 #
80 # MDEV-11241 Certain combining marks cause MariaDB to crash when doing Full-Text searches
81 #
82 set names utf8mb4;
83 create table t1 (a int, b text, fulltext (b)) charset=utf8mb4 collate=utf8mb4_unicode_ci engine=aria;
84 insert t1 values (1000, 'C͓̙̯͔̩ͅͅi̩̘̜̲a̯̲̬̳̜̖̤o͕͓̜͓̺̖̗,̠̬͚ ̺T͇̲h͈̱e ̬̜D̖o̦̖͔̗͖̩̘c̣̼t̝͉̫̮̗o͉̫̭r̙͎̗.͓̪̥');
85 select a from t1 where match(b) against ('ciao' in boolean mode);
86 drop table t1;