Merge InnoDB test cases from MySQL 5.7 (MDEV-13626)

[MDEV-14252] innodb_fts.limit_union failed, results mismatch, MATCH .. AGAINST (.. IN BOOLEAN MODE) Created: 2017-11-02  Updated: 2023-11-08

Status: Open
Project: MariaDB Server
Component/s: Full-text Search, Storage Engine - InnoDB, Tests
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6
Fix Version/s: 10.6

Type: Technical task Priority: Major
Reporter: Alice Sherepa Assignee: Thirunarayanan Balathandayuthapani
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-14231 MATCH() AGAINST( IN BOOLEAN MODE), re... Open

 Description   

https://github.com/MariaDB/server/tree/bb-10.2-alice/mysql-test/suite/innodb_fts/t/limit_union.test

 
innodb_fts.limit_union 'innodb'          [ fail ]
        Test ended at 2017-11-02 10:51:19
 
CURRENT_TEST: innodb_fts.limit_union
--- /home/alice/aliska/10.2/mysql-test/suite/innodb_fts/r/limit_union.result	2017-11-02 10:51:13.094313965 +0100
+++ /home/alice/aliska/10.2/mysql-test/suite/innodb_fts/r/limit_union.reject	2017-11-02 10:51:19.166304127 +0100
@@ -32,7 +32,7 @@
 WHERE MATCH (title,body)
 AGAINST ('MySQL' IN BOOLEAN MODE) limit 1;
 id	title	body
-1	MySQL Tutorial	DBMS stands for DataBase ...
+6	MySQL Security	When configured properly, MySQL ...
 # Without optimization
 SET debug_dbug = '+d,fts_union_limit_off';
 SELECT * FROM articles
 
mysqltest: Result length mismatch



 Comments   
Comment by Marko Mäkelä [ 2023-11-08 ]

If I remove the LIMIT 1 and include the MATCH expression in the output, we see that the returned row indeed is the best match, and everything else comes second:

10.4 228b7e4db59441656abfb194da0e239fd091cfd0

+rank	id	title	body
+0.000000003771856604828372	6	MySQL Security	When configured properly, MySQL ...
+0.000000001885928302414186	1	MySQL Tutorial	DBMS stands for DataBase ...
+0.000000001885928302414186	2	How To Use MySQL Well	After you went through a ...
+0.000000001885928302414186	3	Optimizing MySQL	In this tutorial we will show ...
+0.000000001885928302414186	4	1001 MySQL Tricks	1. Never run mysqld as root. 2. ...
+0.000000001885928302414186	5	MySQL vs. YourSQL	In the following database comparison ...

This is the patch that I applied:

diff --git a/mysql-test/suite/innodb_fts/t/limit_union.test b/mysql-test/suite/innodb_fts/t/limit_union.test
index 71c9af6929e..f2a26be0936 100644
--- a/mysql-test/suite/innodb_fts/t/limit_union.test
+++ b/mysql-test/suite/innodb_fts/t/limit_union.test
@@ -29,9 +29,10 @@ SELECT * FROM articles
 --echo # Without optimization
 SET @save_dbug = @@debug_dbug;
 SET debug_dbug = '+d,fts_union_limit_off';
-SELECT * FROM articles
+SELECT MATCH (title,body)
+	AGAINST ('MySQL' IN NATURAL LANGUAGE MODE) rank, articles.* FROM articles
 	WHERE MATCH (title,body)
-	AGAINST ('MySQL' IN NATURAL LANGUAGE MODE) LIMIT 1;
+	AGAINST ('MySQL' IN NATURAL LANGUAGE MODE);
 SET debug_dbug = @save_dbug;
 
 --echo # Query involves No Ranking and fts_union operations

thiru, can you please analyze this?

Generated at Thu Feb 08 08:12:06 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.