Skip to content

Commit 57739ae

Browse files
committed
MDEV-13888: innodb_fts.innodb_fts_plugin failed
Add ORDER BY to make the test deterministic. Add FLUSH TABLES to avoid crash recovery warnings about the table mysql.plugin. This tends to occur on Valgrind, where the server shutdown could presumably time out, resulting in a forced kill.
1 parent 422f320 commit 57739ae

File tree

2 files changed

+35
-25
lines changed

2 files changed

+35
-25
lines changed

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

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
INSTALL PLUGIN simple_parser SONAME 'mypluglib';
2+
FLUSH TABLES;
23
# Test Part 1: Grammar Test
34
CREATE TABLE articles (
45
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
@@ -31,7 +32,7 @@ INSERT INTO articles (title, body) VALUES
3132
('1001 MySQL Tricks','How to use full-text search engine'),
3233
('Go MySQL Tricks','How to use full text search engine');
3334
SELECT * FROM articles WHERE
34-
MATCH(title, body) AGAINST('mysql');
35+
MATCH(title, body) AGAINST('mysql') ORDER BY id;
3536
id title body
3637
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
3738
2 How To Use MySQL Well After you went through a ...
@@ -68,7 +69,7 @@ INSERT INTO articles (title, body) VALUES
6869
('Go MySQL Tricks','How to use full text search engine');
6970
ALTER TABLE articles ADD FULLTEXT INDEX (title, body) WITH PARSER simple_parser;
7071
SELECT * FROM articles WHERE
71-
MATCH(title, body) AGAINST('mysql');
72+
MATCH(title, body) AGAINST('mysql') ORDER BY id;
7273
id title body
7374
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
7475
2 How To Use MySQL Well After you went through a ...
@@ -88,21 +89,23 @@ MATCH(title, body) AGAINST('full text');
8889
id title body
8990
5 Go MySQL Tricks How to use full text search engine
9091
SELECT * FROM articles WHERE
91-
MATCH(title, body) AGAINST('full-text' WITH QUERY EXPANSION);
92+
MATCH(title, body) AGAINST('full-text' WITH QUERY EXPANSION)
93+
ORDER BY id;
9294
id title body
93-
4 1001 MySQL Tricks How to use full-text search engine
94-
5 Go MySQL Tricks How to use full text search engine
95-
2 How To Use MySQL Well After you went through a ...
9695
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
96+
2 How To Use MySQL Well After you went through a ...
9797
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
98100
SELECT * FROM articles WHERE
99-
MATCH(title, body) AGAINST('full text' WITH QUERY EXPANSION);
101+
MATCH(title, body) AGAINST('full text' WITH QUERY EXPANSION)
102+
ORDER BY id;
100103
id title body
101-
5 Go MySQL Tricks How to use full text search engine
102-
4 1001 MySQL Tricks How to use full-text search engine
103-
2 How To Use MySQL Well After you went through a ...
104104
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
105+
2 How To Use MySQL Well After you went through a ...
105106
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
106109
SELECT * FROM articles WHERE
107110
MATCH(title, body) AGAINST('"mysql database"' IN BOOLEAN MODE);
108111
id title body
@@ -135,27 +138,27 @@ INSERT INTO articles (title, body) VALUES
135138
('1001 MySQL Tricks','How to use full-text search engine'),
136139
('Go MariaDB Tricks','How to use full text search engine');
137140
SELECT * FROM articles WHERE
138-
MATCH(title, body) AGAINST('MySQL');
141+
MATCH(title, body) AGAINST('MySQL') ORDER BY id;
139142
id title body
140143
6 MySQL Tutorial DBMS stands for MySQL DataBase ...
141144
7 How To Use MySQL Well After you went through a ...
142145
8 Optimizing MySQL In this tutorial we will show ...
143146
9 1001 MySQL Tricks How to use full-text search engine
144147
SELECT * FROM articles WHERE
145-
MATCH(title, body) AGAINST('tutorial');
148+
MATCH(title, body) AGAINST('tutorial') ORDER BY id;
146149
id title body
147150
6 MySQL Tutorial DBMS stands for MySQL DataBase ...
148151
8 Optimizing MySQL In this tutorial we will show ...
149152
SELECT * FROM articles WHERE
150-
MATCH(title, body) AGAINST('Tricks');
153+
MATCH(title, body) AGAINST('Tricks') ORDER BY id;
151154
id title body
152155
9 1001 MySQL Tricks How to use full-text search engine
153156
10 Go MariaDB Tricks How to use full text search engine
154157
SELECT * FROM articles WHERE
155-
MATCH(title, body) AGAINST('full text search');
158+
MATCH(title, body) AGAINST('full text search') ORDER BY id;
156159
id title body
157-
10 Go MariaDB Tricks How to use full text search engine
158160
9 1001 MySQL Tricks How to use full-text search engine
161+
10 Go MariaDB Tricks How to use full text search engine
159162
SELECT COUNT(*) FROM articles;
160163
COUNT(*)
161164
5
@@ -183,7 +186,8 @@ UNINSTALL PLUGIN simple_parser;
183186
Warnings:
184187
Warning 1620 Plugin is busy and will be uninstalled on shutdown
185188
SELECT * FROM articles WHERE
186-
MATCH(title, body) AGAINST('mysql');
189+
MATCH(title, body) AGAINST('mysql')
190+
ORDER BY id;
187191
id title body
188192
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
189193
2 How To Use MySQL Well After you went through a ...

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

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
# Install fts parser plugin
77
INSTALL PLUGIN simple_parser SONAME 'mypluglib';
88

9+
# Flush the table mysql.plugin in case the server shutdown would time out.
10+
FLUSH TABLES;
11+
912
-- echo # Test Part 1: Grammar Test
1013
# Create a myisam table and alter it to innodb table
1114
CREATE TABLE articles (
@@ -52,7 +55,7 @@ INSERT INTO articles (title, body) VALUES
5255

5356
# Simple term search
5457
SELECT * FROM articles WHERE
55-
MATCH(title, body) AGAINST('mysql');
58+
MATCH(title, body) AGAINST('mysql') ORDER BY id;
5659

5760
# Test stopword and word len less than fts_min_token_size
5861
SELECT * FROM articles WHERE
@@ -90,7 +93,7 @@ ALTER TABLE articles ADD FULLTEXT INDEX (title, body) WITH PARSER simple_parser;
9093

9194
# Simple term search
9295
SELECT * FROM articles WHERE
93-
MATCH(title, body) AGAINST('mysql');
96+
MATCH(title, body) AGAINST('mysql') ORDER BY id;
9497

9598
# Test stopword and word len less than fts_min_token_size
9699
SELECT * FROM articles WHERE
@@ -105,10 +108,12 @@ SELECT * FROM articles WHERE
105108

106109
# Test query expansion
107110
SELECT * FROM articles WHERE
108-
MATCH(title, body) AGAINST('full-text' WITH QUERY EXPANSION);
111+
MATCH(title, body) AGAINST('full-text' WITH QUERY EXPANSION)
112+
ORDER BY id;
109113

110114
SELECT * FROM articles WHERE
111-
MATCH(title, body) AGAINST('full text' WITH QUERY EXPANSION);
115+
MATCH(title, body) AGAINST('full text' WITH QUERY EXPANSION)
116+
ORDER BY id;
112117

113118
# No result here, we get '"mysql' 'database"' by simple parser
114119
SELECT * FROM articles WHERE
@@ -150,13 +155,13 @@ INSERT INTO articles (title, body) VALUES
150155
--source include/restart_mysqld.inc
151156

152157
SELECT * FROM articles WHERE
153-
MATCH(title, body) AGAINST('MySQL');
158+
MATCH(title, body) AGAINST('MySQL') ORDER BY id;
154159
SELECT * FROM articles WHERE
155-
MATCH(title, body) AGAINST('tutorial');
160+
MATCH(title, body) AGAINST('tutorial') ORDER BY id;
156161
SELECT * FROM articles WHERE
157-
MATCH(title, body) AGAINST('Tricks');
162+
MATCH(title, body) AGAINST('Tricks') ORDER BY id;
158163
SELECT * FROM articles WHERE
159-
MATCH(title, body) AGAINST('full text search');
164+
MATCH(title, body) AGAINST('full text search') ORDER BY id;
160165
SELECT COUNT(*) FROM articles;
161166

162167
INSERT INTO articles (title, body) VALUES ('111', '1234 1234 1234');
@@ -193,7 +198,8 @@ UNINSTALL PLUGIN simple_parser;
193198

194199
# Simple term search
195200
SELECT * FROM articles WHERE
196-
MATCH(title, body) AGAINST('mysql');
201+
MATCH(title, body) AGAINST('mysql')
202+
ORDER BY id;
197203

198204
# Test stopword and word len less than fts_min_token_size
199205
SELECT * FROM articles WHERE

0 commit comments

Comments
 (0)