From 57739ae94a4af580c62bbc87d364fa002c5dbe04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 30 Aug 2022 12:03:58 +0300 Subject: [PATCH] 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. --- .../innodb_fts/r/innodb_fts_plugin.result | 36 ++++++++++--------- .../suite/innodb_fts/t/innodb_fts_plugin.test | 24 ++++++++----- 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_plugin.result b/mysql-test/suite/innodb_fts/r/innodb_fts_plugin.result index cec88f14b269a..e636b30852b17 100644 --- a/mysql-test/suite/innodb_fts/r/innodb_fts_plugin.result +++ b/mysql-test/suite/innodb_fts/r/innodb_fts_plugin.result @@ -1,4 +1,5 @@ INSTALL PLUGIN simple_parser SONAME 'mypluglib'; +FLUSH TABLES; # Test Part 1: Grammar Test CREATE TABLE articles ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, @@ -31,7 +32,7 @@ INSERT INTO articles (title, body) VALUES ('1001 MySQL Tricks','How to use full-text search engine'), ('Go MySQL Tricks','How to use full text search engine'); SELECT * FROM articles WHERE -MATCH(title, body) AGAINST('mysql'); +MATCH(title, body) AGAINST('mysql') ORDER BY id; id title body 1 MySQL Tutorial DBMS stands for MySQL DataBase ... 2 How To Use MySQL Well After you went through a ... @@ -68,7 +69,7 @@ INSERT INTO articles (title, body) VALUES ('Go MySQL Tricks','How to use full text search engine'); ALTER TABLE articles ADD FULLTEXT INDEX (title, body) WITH PARSER simple_parser; SELECT * FROM articles WHERE -MATCH(title, body) AGAINST('mysql'); +MATCH(title, body) AGAINST('mysql') ORDER BY id; id title body 1 MySQL Tutorial DBMS stands for MySQL DataBase ... 2 How To Use MySQL Well After you went through a ... @@ -88,21 +89,23 @@ MATCH(title, body) AGAINST('full text'); id title body 5 Go MySQL Tricks How to use full text search engine 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 -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 ... +2 How To Use MySQL Well After you went through a ... 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 -MATCH(title, body) AGAINST('full text' WITH QUERY EXPANSION); +MATCH(title, body) AGAINST('full text' WITH QUERY EXPANSION) +ORDER BY id; 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 ... +2 How To Use MySQL Well After you went through a ... 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 MATCH(title, body) AGAINST('"mysql database"' IN BOOLEAN MODE); id title body @@ -135,27 +138,27 @@ INSERT INTO articles (title, body) VALUES ('1001 MySQL Tricks','How to use full-text search engine'), ('Go MariaDB Tricks','How to use full text search engine'); SELECT * FROM articles WHERE -MATCH(title, body) AGAINST('MySQL'); +MATCH(title, body) AGAINST('MySQL') ORDER BY id; id title body 6 MySQL Tutorial DBMS stands for MySQL DataBase ... 7 How To Use MySQL Well After you went through a ... 8 Optimizing MySQL In this tutorial we will show ... 9 1001 MySQL Tricks How to use full-text search engine SELECT * FROM articles WHERE -MATCH(title, body) AGAINST('tutorial'); +MATCH(title, body) AGAINST('tutorial') ORDER BY id; id title body 6 MySQL Tutorial DBMS stands for MySQL DataBase ... 8 Optimizing MySQL In this tutorial we will show ... SELECT * FROM articles WHERE -MATCH(title, body) AGAINST('Tricks'); +MATCH(title, body) AGAINST('Tricks') ORDER BY id; id title body 9 1001 MySQL Tricks How to use full-text search engine 10 Go MariaDB Tricks How to use full text search engine SELECT * FROM articles WHERE -MATCH(title, body) AGAINST('full text search'); +MATCH(title, body) AGAINST('full text search') ORDER BY id; 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 +10 Go MariaDB Tricks How to use full text search engine SELECT COUNT(*) FROM articles; COUNT(*) 5 @@ -183,7 +186,8 @@ UNINSTALL PLUGIN simple_parser; Warnings: Warning 1620 Plugin is busy and will be uninstalled on shutdown SELECT * FROM articles WHERE -MATCH(title, body) AGAINST('mysql'); +MATCH(title, body) AGAINST('mysql') +ORDER BY id; id title body 1 MySQL Tutorial DBMS stands for MySQL DataBase ... 2 How To Use MySQL Well After you went through a ... diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_plugin.test b/mysql-test/suite/innodb_fts/t/innodb_fts_plugin.test index b22ac45666850..7279925386b80 100644 --- a/mysql-test/suite/innodb_fts/t/innodb_fts_plugin.test +++ b/mysql-test/suite/innodb_fts/t/innodb_fts_plugin.test @@ -6,6 +6,9 @@ # Install fts parser plugin 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 # Create a myisam table and alter it to innodb table CREATE TABLE articles ( @@ -52,7 +55,7 @@ INSERT INTO articles (title, body) VALUES # Simple term search 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 SELECT * FROM articles WHERE @@ -90,7 +93,7 @@ ALTER TABLE articles ADD FULLTEXT INDEX (title, body) WITH PARSER simple_parser; # Simple term search 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 SELECT * FROM articles WHERE @@ -105,10 +108,12 @@ SELECT * FROM articles WHERE # Test query expansion 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 - 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 SELECT * FROM articles WHERE @@ -150,13 +155,13 @@ INSERT INTO articles (title, body) VALUES --source include/restart_mysqld.inc SELECT * FROM articles WHERE - MATCH(title, body) AGAINST('MySQL'); + MATCH(title, body) AGAINST('MySQL') ORDER BY id; SELECT * FROM articles WHERE - MATCH(title, body) AGAINST('tutorial'); + MATCH(title, body) AGAINST('tutorial') ORDER BY id; SELECT * FROM articles WHERE - MATCH(title, body) AGAINST('Tricks'); + MATCH(title, body) AGAINST('Tricks') ORDER BY id; 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; INSERT INTO articles (title, body) VALUES ('111', '1234 1234 1234'); @@ -193,7 +198,8 @@ UNINSTALL PLUGIN simple_parser; # Simple term search 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 SELECT * FROM articles WHERE