Debian Codegraph @

mysql-test/suite/innodb_fts/r/innodb_fts_plugin.result

raw
1 INSTALL PLUGIN simple_parser SONAME 'mypluglib';
2 FLUSH TABLES;
3 # Test Part 1: Grammar Test
4 CREATE TABLE articles (
5 id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
6 title VARCHAR(200),
7 FULLTEXT (title) WITH PARSER simple_parser
8 ) ENGINE=MyISAM;
9 ALTER TABLE articles ENGINE=InnoDB;
10 DROP TABLE articles;
11 CREATE TABLE articles (
12 id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
13 title VARCHAR(200),
14 body TEXT,
15 comment TEXT,
16 FULLTEXT (title) WITH PARSER simple_parser
17 ) ENGINE=InnoDB;
18 ALTER TABLE articles ADD FULLTEXT INDEX (body) WITH PARSER simple_parser;
19 CREATE FULLTEXT INDEX ft_index ON articles(comment) WITH PARSER simple_parser;
20 DROP TABLE articles;
21 # Test Part 2: Create Index Test(CREATE TABLE WITH FULLTEXT INDEX)
22 CREATE TABLE articles (
23 id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
24 title VARCHAR(200),
25 body TEXT,
26 FULLTEXT (title, body) WITH PARSER simple_parser
27 ) ENGINE=InnoDB;
28 INSERT INTO articles (title, body) VALUES
29 ('MySQL Tutorial','DBMS stands for MySQL DataBase ...'),
30 ('How To Use MySQL Well','After you went through a ...'),
31 ('Optimizing MySQL','In this tutorial we will show ...'),
32 ('1001 MySQL Tricks','How to use full-text search engine'),
33 ('Go MySQL Tricks','How to use full text search engine');
34 SELECT * FROM articles WHERE
35 MATCH(title, body) AGAINST('mysql') ORDER BY id;
36 id title body
37 1 MySQL Tutorial DBMS stands for MySQL DataBase ...
38 2 How To Use MySQL Well After you went through a ...
39 3 Optimizing MySQL In this tutorial we will show ...
40 4 1001 MySQL Tricks How to use full-text search engine
41 5 Go MySQL Tricks How to use full text search engine
42 SELECT * FROM articles WHERE
43 MATCH(title, body) AGAINST('will go');
44 id title body
45 # Test plugin parser tokenizer difference
46 SELECT * FROM articles WHERE
47 MATCH(title, body) AGAINST('full-text');
48 id title body
49 4 1001 MySQL Tricks How to use full-text search engine
50 SELECT * FROM articles WHERE
51 MATCH(title, body) AGAINST('full text');
52 id title body
53 5 Go MySQL Tricks How to use full text search engine
54 SELECT * FROM articles WHERE
55 MATCH(title, body) AGAINST('"mysql database"' IN BOOLEAN MODE);
56 id title body
57 DROP TABLE articles;
58 # Test Part 3: Row Merge Create Index Test(ALTER TABLE ADD FULLTEXT INDEX)
59 CREATE TABLE articles (
60 id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
61 title VARCHAR(200),
62 body TEXT
63 ) ENGINE=InnoDB;
64 INSERT INTO articles (title, body) VALUES
65 ('MySQL Tutorial','DBMS stands for MySQL DataBase ...'),
66 ('How To Use MySQL Well','After you went through a ...'),
67 ('Optimizing MySQL','In this tutorial we will show ...'),
68 ('1001 MySQL Tricks','How to use full-text search engine'),
69 ('Go MySQL Tricks','How to use full text search engine');
70 ALTER TABLE articles ADD FULLTEXT INDEX (title, body) WITH PARSER simple_parser;
71 SELECT * FROM articles WHERE
72 MATCH(title, body) AGAINST('mysql') ORDER BY id;
73 id title body
74 1 MySQL Tutorial DBMS stands for MySQL DataBase ...
75 2 How To Use MySQL Well After you went through a ...
76 3 Optimizing MySQL In this tutorial we will show ...
77 4 1001 MySQL Tricks How to use full-text search engine
78 5 Go MySQL Tricks How to use full text search engine
79 SELECT * FROM articles WHERE
80 MATCH(title, body) AGAINST('will go');
81 id title body
82 # Test plugin parser tokenizer difference
83 SELECT * FROM articles WHERE
84 MATCH(title, body) AGAINST('full-text');
85 id title body
86 4 1001 MySQL Tricks How to use full-text search engine
87 SELECT * FROM articles WHERE
88 MATCH(title, body) AGAINST('full text');
89 id title body
90 5 Go MySQL Tricks How to use full text search engine
91 SELECT * FROM articles WHERE
92 MATCH(title, body) AGAINST('full-text' WITH QUERY EXPANSION)
93 ORDER BY id;
94 id title body
95 1 MySQL Tutorial DBMS stands for MySQL DataBase ...
96 2 How To Use MySQL Well After you went through a ...
97 3 Optimizing MySQL In this tutorial we will show ...
98 4 1001 MySQL Tricks How to use full-text search engine
99 5 Go MySQL Tricks How to use full text search engine
100 SELECT * FROM articles WHERE
101 MATCH(title, body) AGAINST('full text' WITH QUERY EXPANSION)
102 ORDER BY id;
103 id title body
104 1 MySQL Tutorial DBMS stands for MySQL DataBase ...
105 2 How To Use MySQL Well After you went through a ...
106 3 Optimizing MySQL In this tutorial we will show ...
107 4 1001 MySQL Tricks How to use full-text search engine
108 5 Go MySQL Tricks How to use full text search engine
109 SELECT * FROM articles WHERE
110 MATCH(title, body) AGAINST('"mysql database"' IN BOOLEAN MODE);
111 id title body
112 DROP TABLE articles;
113 # Test Part 3 END
114 # Test Part 4:crash on commit(before/after)
115 CREATE TABLE articles (
116 id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
117 title VARCHAR(200),
118 body TEXT,
119 FULLTEXT (title, body) WITH PARSER simple_parser
120 ) ENGINE=InnoDB;
121 SET unique_checks=0, foreign_key_checks=0;
122 BEGIN;
123 INSERT INTO articles (title, body) VALUES
124 ('MySQL Tutorial','DBMS stands for MySQL DataBase ...'),
125 ('How To Use MySQL Well','After you went through a ...'),
126 ('Optimizing MySQL','In this tutorial we will show ...'),
127 ('1001 MySQL Tricks','How to use full-text search engine'),
128 ('Go MySQL Tricks','How to use full text search engine');
129 # restart
130 SELECT COUNT(*) FROM articles;
131 COUNT(*)
132 0
133 SELECT * FROM articles WHERE
134 MATCH(title, body) AGAINST('mysql');
135 id title body
136 INSERT INTO articles (title, body) VALUES
137 ('MySQL Tutorial','DBMS stands for MySQL DataBase ...'),
138 ('How To Use MySQL Well','After you went through a ...'),
139 ('Optimizing MySQL','In this tutorial we will show ...'),
140 ('1001 MySQL Tricks','How to use full-text search engine'),
141 ('Go MariaDB Tricks','How to use full text search engine');
142 # restart
143 SELECT * FROM articles WHERE
144 MATCH(title, body) AGAINST('MySQL') ORDER BY id;
145 id title body
146 1 MySQL Tutorial DBMS stands for MySQL DataBase ...
147 2 How To Use MySQL Well After you went through a ...
148 3 Optimizing MySQL In this tutorial we will show ...
149 4 1001 MySQL Tricks How to use full-text search engine
150 SELECT * FROM articles WHERE
151 MATCH(title, body) AGAINST('tutorial') ORDER BY id;
152 id title body
153 1 MySQL Tutorial DBMS stands for MySQL DataBase ...
154 3 Optimizing MySQL In this tutorial we will show ...
155 SELECT * FROM articles WHERE
156 MATCH(title, body) AGAINST('Tricks') ORDER BY id;
157 id title body
158 4 1001 MySQL Tricks How to use full-text search engine
159 5 Go MariaDB Tricks How to use full text search engine
160 SELECT * FROM articles WHERE
161 MATCH(title, body) AGAINST('full text search') ORDER BY id;
162 id title body
163 4 1001 MySQL Tricks How to use full-text search engine
164 5 Go MariaDB Tricks How to use full text search engine
165 SELECT COUNT(*) FROM articles;
166 COUNT(*)
167 5
168 INSERT INTO articles (title, body) VALUES ('111', '1234 1234 1234');
169 DROP TABLE articles;
170 # Test Part 5: Test Uninstall Plugin After Index is Built
171 CREATE TABLE articles (
172 id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
173 title VARCHAR(200),
174 body TEXT,
175 FULLTEXT (title, body) WITH PARSER simple_parser
176 ) ENGINE=InnoDB;
177 UNINSTALL PLUGIN simple_parser;
178 INSERT INTO articles (title, body) VALUES
179 ('MySQL Tutorial','DBMS stands for MySQL DataBase ...');
180 ERROR HY000: Plugin 'simple_parser' is not loaded
181 INSTALL PLUGIN simple_parser SONAME 'mypluglib';
182 INSERT INTO articles (title, body) VALUES
183 ('MySQL Tutorial','DBMS stands for MySQL DataBase ...'),
184 ('How To Use MySQL Well','After you went through a ...'),
185 ('Optimizing MySQL','In this tutorial we will show ...'),
186 ('1001 MySQL Tricks','How to use full-text search engine'),
187 ('Go MySQL Tricks','How to use full text search engine');
188 UNINSTALL PLUGIN simple_parser;
189 Warnings:
190 Warning 1620 Plugin is busy and will be uninstalled on shutdown
191 SELECT * FROM articles WHERE
192 MATCH(title, body) AGAINST('mysql')
193 ORDER BY id;
194 id title body
195 1 MySQL Tutorial DBMS stands for MySQL DataBase ...
196 2 How To Use MySQL Well After you went through a ...
197 3 Optimizing MySQL In this tutorial we will show ...
198 4 1001 MySQL Tricks How to use full-text search engine
199 5 Go MySQL Tricks How to use full text search engine
200 SELECT * FROM articles WHERE
201 MATCH(title, body) AGAINST('will go');
202 id title body
203 # Test plugin parser tokenizer difference
204 SELECT * FROM articles WHERE
205 MATCH(title, body) AGAINST('full-text');
206 id title body
207 4 1001 MySQL Tricks How to use full-text search engine
208 SELECT * FROM articles WHERE
209 MATCH(title, body) AGAINST('full text');
210 id title body
211 5 Go MySQL Tricks How to use full text search engine
212 CREATE TABLE articles2 (
213 id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
214 title VARCHAR(200),
215 body TEXT,
216 FULLTEXT (title, body) WITH PARSER simple_parser
217 ) ENGINE=InnoDB;
218 ERROR HY000: Function 'simple_parser' is not defined
219 DROP TABLE articles;
220 UNINSTALL PLUGIN simple_parser;
221 ERROR 42000: PLUGIN simple_parser does not exist