Commit 57739ae9 authored by Marko Mäkelä's avatar Marko Mäkelä

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.
parent 422f3204
INSTALL PLUGIN simple_parser SONAME 'mypluglib'; INSTALL PLUGIN simple_parser SONAME 'mypluglib';
FLUSH TABLES;
# Test Part 1: Grammar Test # Test Part 1: Grammar Test
CREATE TABLE articles ( CREATE TABLE articles (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
...@@ -31,7 +32,7 @@ INSERT INTO articles (title, body) VALUES ...@@ -31,7 +32,7 @@ INSERT INTO articles (title, body) VALUES
('1001 MySQL Tricks','How to use full-text search engine'), ('1001 MySQL Tricks','How to use full-text search engine'),
('Go MySQL Tricks','How to use full text search engine'); ('Go MySQL Tricks','How to use full text search engine');
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('mysql'); MATCH(title, body) AGAINST('mysql') ORDER BY id;
id title body id title body
1 MySQL Tutorial DBMS stands for MySQL DataBase ... 1 MySQL Tutorial DBMS stands for MySQL DataBase ...
2 How To Use MySQL Well After you went through a ... 2 How To Use MySQL Well After you went through a ...
...@@ -68,7 +69,7 @@ INSERT INTO articles (title, body) VALUES ...@@ -68,7 +69,7 @@ INSERT INTO articles (title, body) VALUES
('Go MySQL Tricks','How to use full text search engine'); ('Go MySQL Tricks','How to use full text search engine');
ALTER TABLE articles ADD FULLTEXT INDEX (title, body) WITH PARSER simple_parser; ALTER TABLE articles ADD FULLTEXT INDEX (title, body) WITH PARSER simple_parser;
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('mysql'); MATCH(title, body) AGAINST('mysql') ORDER BY id;
id title body id title body
1 MySQL Tutorial DBMS stands for MySQL DataBase ... 1 MySQL Tutorial DBMS stands for MySQL DataBase ...
2 How To Use MySQL Well After you went through a ... 2 How To Use MySQL Well After you went through a ...
...@@ -88,21 +89,23 @@ MATCH(title, body) AGAINST('full text'); ...@@ -88,21 +89,23 @@ MATCH(title, body) AGAINST('full text');
id title body id title body
5 Go MySQL Tricks How to use full text search engine 5 Go MySQL Tricks How to use full text search engine
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('full-text' WITH QUERY EXPANSION); MATCH(title, body) AGAINST('full-text' WITH QUERY EXPANSION)
ORDER BY id;
id title body id title body
4 1001 MySQL Tricks How to use full-text search engine
5 Go MySQL Tricks How to use full text search engine
2 How To Use MySQL Well After you went through a ...
1 MySQL Tutorial DBMS stands for MySQL DataBase ... 1 MySQL Tutorial DBMS stands for MySQL DataBase ...
2 How To Use MySQL Well After you went through a ...
3 Optimizing MySQL In this tutorial we will show ... 3 Optimizing MySQL In this tutorial we will show ...
4 1001 MySQL Tricks How to use full-text search engine
5 Go MySQL Tricks How to use full text search engine
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('full text' WITH QUERY EXPANSION); MATCH(title, body) AGAINST('full text' WITH QUERY EXPANSION)
ORDER BY id;
id title body id title body
5 Go MySQL Tricks How to use full text search engine
4 1001 MySQL Tricks How to use full-text search engine
2 How To Use MySQL Well After you went through a ...
1 MySQL Tutorial DBMS stands for MySQL DataBase ... 1 MySQL Tutorial DBMS stands for MySQL DataBase ...
2 How To Use MySQL Well After you went through a ...
3 Optimizing MySQL In this tutorial we will show ... 3 Optimizing MySQL In this tutorial we will show ...
4 1001 MySQL Tricks How to use full-text search engine
5 Go MySQL Tricks How to use full text search engine
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('"mysql database"' IN BOOLEAN MODE); MATCH(title, body) AGAINST('"mysql database"' IN BOOLEAN MODE);
id title body id title body
...@@ -135,27 +138,27 @@ INSERT INTO articles (title, body) VALUES ...@@ -135,27 +138,27 @@ INSERT INTO articles (title, body) VALUES
('1001 MySQL Tricks','How to use full-text search engine'), ('1001 MySQL Tricks','How to use full-text search engine'),
('Go MariaDB Tricks','How to use full text search engine'); ('Go MariaDB Tricks','How to use full text search engine');
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('MySQL'); MATCH(title, body) AGAINST('MySQL') ORDER BY id;
id title body id title body
6 MySQL Tutorial DBMS stands for MySQL DataBase ... 6 MySQL Tutorial DBMS stands for MySQL DataBase ...
7 How To Use MySQL Well After you went through a ... 7 How To Use MySQL Well After you went through a ...
8 Optimizing MySQL In this tutorial we will show ... 8 Optimizing MySQL In this tutorial we will show ...
9 1001 MySQL Tricks How to use full-text search engine 9 1001 MySQL Tricks How to use full-text search engine
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('tutorial'); MATCH(title, body) AGAINST('tutorial') ORDER BY id;
id title body id title body
6 MySQL Tutorial DBMS stands for MySQL DataBase ... 6 MySQL Tutorial DBMS stands for MySQL DataBase ...
8 Optimizing MySQL In this tutorial we will show ... 8 Optimizing MySQL In this tutorial we will show ...
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('Tricks'); MATCH(title, body) AGAINST('Tricks') ORDER BY id;
id title body id title body
9 1001 MySQL Tricks How to use full-text search engine 9 1001 MySQL Tricks How to use full-text search engine
10 Go MariaDB Tricks How to use full text search engine 10 Go MariaDB Tricks How to use full text search engine
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('full text search'); MATCH(title, body) AGAINST('full text search') ORDER BY id;
id title body id title body
10 Go MariaDB Tricks How to use full text search engine
9 1001 MySQL Tricks How to use full-text search engine 9 1001 MySQL Tricks How to use full-text search engine
10 Go MariaDB Tricks How to use full text search engine
SELECT COUNT(*) FROM articles; SELECT COUNT(*) FROM articles;
COUNT(*) COUNT(*)
5 5
...@@ -183,7 +186,8 @@ UNINSTALL PLUGIN simple_parser; ...@@ -183,7 +186,8 @@ UNINSTALL PLUGIN simple_parser;
Warnings: Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown Warning 1620 Plugin is busy and will be uninstalled on shutdown
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('mysql'); MATCH(title, body) AGAINST('mysql')
ORDER BY id;
id title body id title body
1 MySQL Tutorial DBMS stands for MySQL DataBase ... 1 MySQL Tutorial DBMS stands for MySQL DataBase ...
2 How To Use MySQL Well After you went through a ... 2 How To Use MySQL Well After you went through a ...
......
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
# Install fts parser plugin # Install fts parser plugin
INSTALL PLUGIN simple_parser SONAME 'mypluglib'; INSTALL PLUGIN simple_parser SONAME 'mypluglib';
# Flush the table mysql.plugin in case the server shutdown would time out.
FLUSH TABLES;
-- echo # Test Part 1: Grammar Test -- echo # Test Part 1: Grammar Test
# Create a myisam table and alter it to innodb table # Create a myisam table and alter it to innodb table
CREATE TABLE articles ( CREATE TABLE articles (
...@@ -52,7 +55,7 @@ INSERT INTO articles (title, body) VALUES ...@@ -52,7 +55,7 @@ INSERT INTO articles (title, body) VALUES
# Simple term search # Simple term search
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('mysql'); MATCH(title, body) AGAINST('mysql') ORDER BY id;
# Test stopword and word len less than fts_min_token_size # Test stopword and word len less than fts_min_token_size
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
...@@ -90,7 +93,7 @@ ALTER TABLE articles ADD FULLTEXT INDEX (title, body) WITH PARSER simple_parser; ...@@ -90,7 +93,7 @@ ALTER TABLE articles ADD FULLTEXT INDEX (title, body) WITH PARSER simple_parser;
# Simple term search # Simple term search
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('mysql'); MATCH(title, body) AGAINST('mysql') ORDER BY id;
# Test stopword and word len less than fts_min_token_size # Test stopword and word len less than fts_min_token_size
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
...@@ -105,10 +108,12 @@ SELECT * FROM articles WHERE ...@@ -105,10 +108,12 @@ SELECT * FROM articles WHERE
# Test query expansion # Test query expansion
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('full-text' WITH QUERY EXPANSION); MATCH(title, body) AGAINST('full-text' WITH QUERY EXPANSION)
ORDER BY id;
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('full text' WITH QUERY EXPANSION); MATCH(title, body) AGAINST('full text' WITH QUERY EXPANSION)
ORDER BY id;
# No result here, we get '"mysql' 'database"' by simple parser # No result here, we get '"mysql' 'database"' by simple parser
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
...@@ -150,13 +155,13 @@ INSERT INTO articles (title, body) VALUES ...@@ -150,13 +155,13 @@ INSERT INTO articles (title, body) VALUES
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('MySQL'); MATCH(title, body) AGAINST('MySQL') ORDER BY id;
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('tutorial'); MATCH(title, body) AGAINST('tutorial') ORDER BY id;
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('Tricks'); MATCH(title, body) AGAINST('Tricks') ORDER BY id;
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('full text search'); MATCH(title, body) AGAINST('full text search') ORDER BY id;
SELECT COUNT(*) FROM articles; SELECT COUNT(*) FROM articles;
INSERT INTO articles (title, body) VALUES ('111', '1234 1234 1234'); INSERT INTO articles (title, body) VALUES ('111', '1234 1234 1234');
...@@ -193,7 +198,8 @@ UNINSTALL PLUGIN simple_parser; ...@@ -193,7 +198,8 @@ UNINSTALL PLUGIN simple_parser;
# Simple term search # Simple term search
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('mysql'); MATCH(title, body) AGAINST('mysql')
ORDER BY id;
# Test stopword and word len less than fts_min_token_size # Test stopword and word len less than fts_min_token_size
SELECT * FROM articles WHERE SELECT * FROM articles WHERE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment